mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-05 16:37:09 +00:00
refactor(control): add HighlightedText
This commit is contained in:
Generated
+1
-2
@@ -5360,8 +5360,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.14.tgz",
|
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.14.tgz",
|
||||||
"integrity": "sha512-b7pCxjGO98LnxVkKjaZSDeNuljC4ueKUddjENJOADtubtdo8llTaJy7HwBMeLNSSo2N5QIAgklslK1+Ir8r6CA==",
|
"integrity": "sha512-b7pCxjGO98LnxVkKjaZSDeNuljC4ueKUddjENJOADtubtdo8llTaJy7HwBMeLNSSo2N5QIAgklslK1+Ir8r6CA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"peer": true
|
|
||||||
},
|
},
|
||||||
"node_modules/tapable": {
|
"node_modules/tapable": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
transition:fade={{ duration: 50 }}
|
transition:fade={{ duration: 50 }}
|
||||||
class="absolute {position_bottom
|
class="absolute {position_bottom
|
||||||
? 'top-full'
|
? 'top-full'
|
||||||
: 'bottom-full'} {menu_class} z-100 my-1.5 min-w-64 rounded-xl backdrop-blur bg-black/20 border border-stone-400/10 shadow-xl/20 p-2 flex flex-col gap-2 text-stone-200 cursor-auto"
|
: 'bottom-full'} {menu_class} z-100 my-1.5 min-w-64 rounded-xl backdrop-blur bg-stone-800/45 border border-stone-400/10 shadow-xl/20 p-2 flex flex-col gap-2 text-stone-200 cursor-auto"
|
||||||
onclick={(e) => {
|
onclick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
import { flip } from 'svelte/animate';
|
import { flip } from 'svelte/animate';
|
||||||
import DisplayGroupObject from './DisplayGroupObject.svelte';
|
import DisplayGroupObject from './DisplayGroupObject.svelte';
|
||||||
import { Pane, Splitpanes } from 'svelte-splitpanes';
|
import { Pane, Splitpanes } from 'svelte-splitpanes';
|
||||||
|
import HighlightedText from './HighlightedText.svelte';
|
||||||
|
|
||||||
let { handle_display_deletion, handle_display_editing } = $props<{
|
let { handle_display_deletion, handle_display_editing } = $props<{
|
||||||
handle_display_deletion: (display_id: string) => void;
|
handle_display_deletion: (display_id: string) => void;
|
||||||
@@ -104,7 +105,12 @@
|
|||||||
<svelte:window on:wheel={on_wheel} />
|
<svelte:window on:wheel={on_wheel} />
|
||||||
|
|
||||||
<div class="h-[calc(100dvh-3rem-(6*var(--spacing)))] flex flex-col gap-2">
|
<div class="h-[calc(100dvh-3rem-(6*var(--spacing)))] flex flex-col gap-2">
|
||||||
<Splitpanes horizontal theme="mudics-stone-theme" on:resized={handle_splitpane_resize} dblClickSplitter={false}>
|
<Splitpanes
|
||||||
|
horizontal
|
||||||
|
theme="mudics-stone-theme"
|
||||||
|
on:resized={handle_splitpane_resize}
|
||||||
|
dblClickSplitter={false}
|
||||||
|
>
|
||||||
{#if $pinned_display_id}
|
{#if $pinned_display_id}
|
||||||
<!-- Pinned Item -->
|
<!-- Pinned Item -->
|
||||||
<Pane maxSize={60} snapSize={20} bind:size={pinned_pane_size}>
|
<Pane maxSize={60} snapSize={20} bind:size={pinned_pane_size}>
|
||||||
@@ -245,9 +251,10 @@
|
|||||||
>
|
>
|
||||||
{#if $displays.length === 1 && $displays[0].data.length === 0}
|
{#if $displays.length === 1 && $displays[0].data.length === 0}
|
||||||
<div class="text-stone-500 px-10 py-6 leading-relaxed text-center">
|
<div class="text-stone-500 px-10 py-6 leading-relaxed text-center">
|
||||||
Es wurden noch keine Bildschirme hinzugefügt. Klicke oben rechts auf <Settings
|
Es wurden noch keine Bildschirme hinzugefügt. Klicke oben rechts auf
|
||||||
class="inline pb-1"
|
<HighlightedText fg="text-stone-450" className="!p-1"><Settings class="inline pb-1" /></HighlightedText>
|
||||||
/> und "Neuen Bildschirm hinzufügen".
|
und
|
||||||
|
<HighlightedText fg="text-stone-450">Neuen Bildschirm hinzufügen</HighlightedText>.
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
{#each $displays as display_group (display_group.id)}
|
{#each $displays as display_group (display_group.id)}
|
||||||
@@ -257,7 +264,11 @@
|
|||||||
animate:flip={{ duration: dnd_flip_duration_ms, easing: cubicOut }}
|
animate:flip={{ duration: dnd_flip_duration_ms, easing: cubicOut }}
|
||||||
class="outline-none"
|
class="outline-none"
|
||||||
>
|
>
|
||||||
<DisplayGroupObject {display_group} {get_display_menu_options} {close_pinned_display} />
|
<DisplayGroupObject
|
||||||
|
{display_group}
|
||||||
|
{get_display_menu_options}
|
||||||
|
{close_pinned_display}
|
||||||
|
/>
|
||||||
</section>
|
</section>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
import type { PopupContent } from '../ts/types';
|
import type { PopupContent } from '../ts/types';
|
||||||
import TextInput from './TextInput.svelte';
|
import TextInput from './TextInput.svelte';
|
||||||
import { is_valid_name } from '../ts/utils';
|
import { is_valid_name } from '../ts/utils';
|
||||||
|
import HighlightedText from './HighlightedText.svelte';
|
||||||
|
|
||||||
let current_name: string = '';
|
let current_name: string = '';
|
||||||
let current_valid: boolean = false;
|
let current_valid: boolean = false;
|
||||||
@@ -169,12 +170,14 @@
|
|||||||
</section>
|
</section>
|
||||||
{/each}
|
{/each}
|
||||||
{#if get_current_folder_elements($all_files, $current_file_path, $selected_display_ids).length === 0}
|
{#if get_current_folder_elements($all_files, $current_file_path, $selected_display_ids).length === 0}
|
||||||
<span class="text-stone-450 px-10 py-6 leading-relaxed text-center">
|
<span class="text-stone-450 px-10 py-6 leading-relaxed text-center max-w-full">
|
||||||
Es sind keine Dateien auf {$selected_display_ids.length === 1
|
Es existieren keine Dateien auf {$selected_display_ids.length === 1
|
||||||
? 'dem ausgewähltem Bildchirm'
|
? 'dem ausgewähltem Bildchirm'
|
||||||
: 'den ausgewählten Bildschirmen'} vorhanden. Klicke auf <Upload
|
: 'den ausgewählten Bildschirmen'} im aktuellen Ordner. Klicke auf <HighlightedText
|
||||||
class="inline pb-1"
|
bg="bg-stone-700"
|
||||||
/> um Datei(en) hochzuladen.
|
fg="text-stone-400"
|
||||||
|
className="!p-1"><Upload class="inline pb-1" /></HighlightedText
|
||||||
|
> um Datei(en) hochzuladen.
|
||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
let {
|
||||||
|
children,
|
||||||
|
bg = 'bg-stone-750',
|
||||||
|
fg = 'text-stone-200',
|
||||||
|
className = ''
|
||||||
|
} = $props<{ children: any; bg?: string; fg?: string; className?: string }>();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="{bg} {fg} {className} rounded-lg py-0.5 px-1 inline-block truncate min-w-0 max-w-full align-middle my-[1.5px]">
|
||||||
|
{@render children()}
|
||||||
|
</div>
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { on_start } from '../ts/main';
|
import { on_start } from '../ts/main';
|
||||||
import { display_status_to_info } from '../ts/utils';
|
import { display_status_to_info } from '../ts/utils';
|
||||||
|
import HighlightedText from '../components/HighlightedText.svelte';
|
||||||
|
|
||||||
const ip_regex =
|
const ip_regex =
|
||||||
/^(?:(?:10|127)\.(?:25[0-5]|2[0-4]\d|1?\d?\d)\.(?:25[0-5]|2[0-4]\d|1?\d?\d)\.(?:25[0-5]|2[0-4]\d|1?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|1?\d?\d)\.(?:25[0-5]|2[0-4]\d|1?\d?\d)|172\.(?:1[6-9]|2\d|3[0-1])\.(?:25[0-5]|2[0-4]\d|1?\d?\d)\.(?:25[0-5]|2[0-4]\d|1?\d?\d))$/;
|
/^(?:(?:10|127)\.(?:25[0-5]|2[0-4]\d|1?\d?\d)\.(?:25[0-5]|2[0-4]\d|1?\d?\d)\.(?:25[0-5]|2[0-4]\d|1?\d?\d)|192\.168\.(?:25[0-5]|2[0-4]\d|1?\d?\d)\.(?:25[0-5]|2[0-4]\d|1?\d?\d)|172\.(?:1[6-9]|2\d|3[0-1])\.(?:25[0-5]|2[0-4]\d|1?\d?\d)\.(?:25[0-5]|2[0-4]\d|1?\d?\d))$/;
|
||||||
@@ -118,9 +119,10 @@
|
|||||||
|
|
||||||
{#snippet remove_display_popup(display_id: string)}
|
{#snippet remove_display_popup(display_id: string)}
|
||||||
<div class="max-w-prose px-2">
|
<div class="max-w-prose px-2">
|
||||||
Soll der Bildschirm "{get_display_by_id(display_id, $displays)?.name || '?'}" wirklich gelöscht
|
Soll der Bildschirm <HighlightedText
|
||||||
werden? Dadurch wird es von diesem Controller nicht mehr erreichbar. Die Installation auf dem
|
>{get_display_by_id(display_id, $displays)?.name || '?'}</HighlightedText
|
||||||
Gerät bleibt bestehen. Mit dem erneuten Hinzufügen des Bildschirms wird er wieder steuerbar.
|
> wirklich gelöscht werden? Dadurch wird es von diesem Controller nicht mehr erreichbar. Die Installation
|
||||||
|
auf dem Gerät bleibt bestehen. Mit dem erneuten Hinzufügen des Bildschirms wird er wieder steuerbar.
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row justify-end gap-2">
|
<div class="flex flex-row justify-end gap-2">
|
||||||
<Button className="px-4 font-bold" click_function={popup_close_function}>Abbrechen</Button>
|
<Button className="px-4 font-bold" click_function={popup_close_function}>Abbrechen</Button>
|
||||||
@@ -216,11 +218,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
<style>
|
|
||||||
:root {
|
|
||||||
--splash-fade-out-delay: 4s !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<main class="bg-stone-900 h-dvh w-dvw text-stone-200 px-4 py-2 gap-2 grid grid-rows-[3rem_auto]">
|
<main class="bg-stone-900 h-dvh w-dvw text-stone-200 px-4 py-2 gap-2 grid grid-rows-[3rem_auto]">
|
||||||
<!-- {@html SplashScreen} -->
|
<!-- {@html SplashScreen} -->
|
||||||
@@ -258,5 +255,11 @@
|
|||||||
<FileView />
|
<FileView />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<PopUp content={popup_content} close_function={popup_close_function} className="bg-white/10" snippet_container_class="min-w-115" />
|
<PopUp
|
||||||
|
content={popup_content}
|
||||||
|
close_function={popup_close_function}
|
||||||
|
className="bg-white/10"
|
||||||
|
snippet_container_class="min-w-115"
|
||||||
|
/>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user