mirror of
https://github.com/smartyellow/status.git
synced 2025-01-18 13:37:59 +00:00
Some UI improvements
This commit is contained in:
parent
9c8b939fc0
commit
59d36ed208
@ -40,7 +40,7 @@ button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
border: 1px solid var(--dark);
|
border: 1px solid var(--body-fg);
|
||||||
padding: 0.7rem;
|
padding: 0.7rem;
|
||||||
border-radius: var(--radius);
|
border-radius: var(--radius);
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,11 @@
|
|||||||
|
|
||||||
let open = false;
|
let open = false;
|
||||||
let showCopyCheck = false;
|
let showCopyCheck = false;
|
||||||
|
let copyButton;
|
||||||
|
|
||||||
function toggle() {
|
function openModal() {
|
||||||
open = !open;
|
open = true;
|
||||||
|
copyButton?.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function copy() {
|
function copy() {
|
||||||
@ -16,15 +18,24 @@
|
|||||||
setTimeout(() => showCopyCheck = false, 2000);
|
setTimeout(() => showCopyCheck = false, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function keydown(event) {
|
||||||
|
if ((event.key === ',') && (event.metaKey || event.ctrlKey)) {
|
||||||
|
event.preventDefault();
|
||||||
|
openModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button class="settings" on:click={toggle}>
|
<svelte:window on:keydown={keydown} />
|
||||||
|
|
||||||
|
<button class="settings" on:click={openModal}>
|
||||||
Settings
|
Settings
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<Modal title="Settings" bind:open>
|
<Modal title="Settings" bind:open>
|
||||||
<div class="mb">
|
<div class="mb">
|
||||||
<button on:click={copy} class="btn copy">
|
<button on:click={copy} class="btn copy" bind:this={copyButton}>
|
||||||
Copy settings to clipboard
|
Copy settings to clipboard
|
||||||
{#if showCopyCheck}
|
{#if showCopyCheck}
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 405.27 405.27">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 405.27 405.27">
|
||||||
|
16
index.js
16
index.js
@ -803,7 +803,9 @@ module.exports = {
|
|||||||
{ route: '/status/dashboard',
|
{ route: '/status/dashboard',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
handler: async (req, res) => {
|
handler: async (req, res) => {
|
||||||
if (!renderedDashboard) {
|
// const cacheValid = !!renderedDashboard;
|
||||||
|
const cacheValid = true;
|
||||||
|
if (!cacheValid) {
|
||||||
// Build dashboard
|
// Build dashboard
|
||||||
let cssOutput = '';
|
let cssOutput = '';
|
||||||
|
|
||||||
@ -811,17 +813,9 @@ module.exports = {
|
|||||||
const bundle = await buildDeps.rollup({
|
const bundle = await buildDeps.rollup({
|
||||||
input: __dirname + '/gui/dashboard/index.js',
|
input: __dirname + '/gui/dashboard/index.js',
|
||||||
plugins: [
|
plugins: [
|
||||||
buildDeps.svelte({
|
buildDeps.svelte({ compilerOptions: { dev: false, generate: 'dom' } }),
|
||||||
compilerOptions: {
|
|
||||||
dev: false,
|
|
||||||
generate: 'dom',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
buildDeps.css({ output: style => cssOutput = style }),
|
buildDeps.css({ output: style => cssOutput = style }),
|
||||||
buildDeps.resolve({
|
buildDeps.resolve({ browser: true, dedupe: [ 'svelte' ] }),
|
||||||
browser: true,
|
|
||||||
dedupe: [ 'svelte' ],
|
|
||||||
}),
|
|
||||||
buildDeps.commonjs(),
|
buildDeps.commonjs(),
|
||||||
buildDeps.terser(),
|
buildDeps.terser(),
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user