Formatting/Linting
This commit is contained in:
parent
c4e1b5e445
commit
08520ac616
|
@ -1,2 +1,3 @@
|
||||||
# LinkyLinky Extension
|
# LinkyLinky Extension
|
||||||
|
|
||||||
> The companion extension for LinkyLinky
|
> The companion extension for LinkyLinky
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "LinkyLinky",
|
"name": "LinkyLinky",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "A simple url shortener",
|
"description": "A simple url shortener",
|
||||||
"short_name": "LinkyLinky",
|
"short_name": "LinkyLinky",
|
||||||
"permissions": [
|
"permissions": ["activeTab"],
|
||||||
"activeTab"
|
"browser_action": {
|
||||||
],
|
"default_popup": "build/index.html"
|
||||||
"browser_action": {
|
}
|
||||||
"default_popup": "build/index.html"
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,20 +1,21 @@
|
||||||
const tailwindcss = require("tailwindcss");
|
const tailwindcss = require('tailwindcss');
|
||||||
const autoprefixer = require("autoprefixer");
|
const autoprefixer = require('autoprefixer');
|
||||||
const cssnano = require("cssnano");
|
const cssnano = require('cssnano');
|
||||||
|
|
||||||
const mode = process.env.NODE_ENV;
|
const mode = process.env.NODE_ENV;
|
||||||
const dev = mode === "development";
|
const dev = mode === 'development';
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
plugins: [
|
plugins: [
|
||||||
//Some plugins, like postcss-nested, need to run before Tailwind,
|
//Some plugins, like postcss-nested, need to run before Tailwind,
|
||||||
tailwindcss(),
|
tailwindcss(),
|
||||||
//But others, like autoprefixer, need to run after,
|
//But others, like autoprefixer, need to run after,
|
||||||
autoprefixer(),
|
autoprefixer(),
|
||||||
!dev && cssnano({
|
!dev &&
|
||||||
preset: "default",
|
cssnano({
|
||||||
})
|
preset: 'default'
|
||||||
],
|
})
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
|
@ -1,4 +1,4 @@
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
/* Write your global styles here, in PostCSS syntax */
|
/* Write your global styles here, in PostCSS syntax */
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities
|
@tailwind utilities;
|
||||||
|
|
|
@ -1,30 +1,38 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
const config = {
|
const config = {
|
||||||
username: "niggl",
|
username: 'niggl',
|
||||||
password: "niggl"
|
password: '9VEBc596T7tiPB7mNJukfeH9LfGzrrJN'
|
||||||
}
|
};
|
||||||
export default class Apiclient {
|
export default class Apiclient {
|
||||||
static async getUrls() {
|
static async getUrls() {
|
||||||
return (await axios.get("https://kauft.es/api?showVisits=true", {
|
return (
|
||||||
auth: config
|
await axios.get('https://kauft.es/api?showVisits=true', {
|
||||||
})).data
|
auth: config
|
||||||
}
|
})
|
||||||
|
).data;
|
||||||
|
}
|
||||||
|
|
||||||
static async getUrlDetails(shortcode) {
|
static async getUrlDetails(shortcode) {
|
||||||
return (await axios.get(`https://kauft.es/api/${shortcode}`, {
|
return (
|
||||||
auth: config
|
await axios.get(`https://kauft.es/api/${shortcode}`, {
|
||||||
})).data
|
auth: config
|
||||||
}
|
})
|
||||||
|
).data;
|
||||||
|
}
|
||||||
|
|
||||||
static async getUrlVisits(shortcode) {
|
static async getUrlVisits(shortcode) {
|
||||||
return (await axios.get(`https://kauft.es/api/${shortcode}/visits`, {
|
return (
|
||||||
auth: config
|
await axios.get(`https://kauft.es/api/${shortcode}/visits`, {
|
||||||
})).data
|
auth: config
|
||||||
}
|
})
|
||||||
|
).data;
|
||||||
|
}
|
||||||
|
|
||||||
static async deleteUrl(shortcode) {
|
static async deleteUrl(shortcode) {
|
||||||
return (await axios.delete(`https://kauft.es/api/${shortcode}`, {
|
return (
|
||||||
auth: config
|
await axios.delete(`https://kauft.es/api/${shortcode}`, {
|
||||||
})).status
|
auth: config
|
||||||
}
|
})
|
||||||
|
).status;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,15 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
export let title = 'Title';
|
export let title = 'Title';
|
||||||
export let count = 0;
|
export let count = 0;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-900">
|
<div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-900">
|
||||||
<div
|
<div class="p-3 mr-4 text-red-500 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-500">
|
||||||
class="p-3 mr-4 text-red-500 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-500"
|
<slot />
|
||||||
>
|
</div>
|
||||||
<slot></slot>
|
<div>
|
||||||
</div>
|
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">{title}</p>
|
||||||
<div>
|
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200">{count}</p>
|
||||||
<p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">{title}</p>
|
</div>
|
||||||
<p class="text-lg font-semibold text-gray-700 dark:text-gray-200">{count}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
|
@ -6,7 +6,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
function deleteUrl(shortcode) {
|
function deleteUrl(shortcode) {
|
||||||
Apiclient.deleteUrl(shortcode).then((res) => {
|
Apiclient.deleteUrl(shortcode).then(() => {
|
||||||
urls = urls.filter((url) => url.shortcode != shortcode);
|
urls = urls.filter((url) => url.shortcode != shortcode);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -63,18 +63,18 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm"> {url.visits} </td>
|
<td class="px-6 py-4 whitespace-nowrap text-sm"> {url.visits} </td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
|
||||||
<button
|
<button
|
||||||
on:click={deleteUrl(url.shortcode)}
|
on:click={deleteUrl(url.shortcode)}
|
||||||
class="px-4 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-red-600 rounded-md hover:bg-red-700 focus:outline-none focus:bg-red-700"
|
class="px-4 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-red-600 rounded-md hover:bg-red-700 focus:outline-none focus:bg-red-700"
|
||||||
>
|
>
|
||||||
Delete
|
Delete
|
||||||
</button>
|
</button>
|
||||||
<a
|
<a
|
||||||
href={`/details?shortcode=${url.shortcode}`}
|
href={`/details?shortcode=${url.shortcode}`}
|
||||||
class="px-4 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:bg-blue-700"
|
class="px-4 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:bg-blue-700"
|
||||||
>
|
>
|
||||||
Details
|
Details
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
import preprocess from "svelte-preprocess";
|
import preprocess from 'svelte-preprocess';
|
||||||
import staticAdapter from '@sveltejs/adapter-static';
|
import staticAdapter from '@sveltejs/adapter-static';
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
const config = {
|
const config = {
|
||||||
kit: {
|
kit: {
|
||||||
// hydrate the <div id="svelte"> element in src/app.html
|
// hydrate the <div id="svelte"> element in src/app.html
|
||||||
target: '#svelte',
|
target: '#svelte',
|
||||||
adapter: staticAdapter(),
|
adapter: staticAdapter(),
|
||||||
files: {
|
files: {
|
||||||
assets: 'static'
|
assets: 'static'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
preprocess: [preprocess({
|
preprocess: [
|
||||||
"postcss": true
|
preprocess({
|
||||||
})]
|
postcss: true
|
||||||
|
})
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
const config = {
|
const config = {
|
||||||
mode: "jit",
|
mode: 'jit',
|
||||||
darkMode: 'media',
|
darkMode: 'media',
|
||||||
purge: [
|
purge: ['./src/**/*.{html,js,svelte,ts}'],
|
||||||
"./src/**/*.{html,js,svelte,ts}",
|
|
||||||
],
|
|
||||||
theme: {
|
theme: {
|
||||||
extend: {},
|
extend: {}
|
||||||
},
|
},
|
||||||
plugins: [],
|
plugins: []
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
|
Loading…
Reference in New Issue