Advance journal config modal parity
This commit is contained in:
@@ -246,7 +246,7 @@ async function create_journal() {
|
|||||||
|
|
||||||
{#if $journals_sess.show__modal__journals_config}
|
{#if $journals_sess.show__modal__journals_config}
|
||||||
<AE_Comp_Modal_Journal_Config
|
<AE_Comp_Modal_Journal_Config
|
||||||
show={$journals_sess.show__modal__journals_config} />
|
bind:show={$journals_sess.show__modal__journals_config} />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<AE_Comp_Modal_Journal_Import
|
<AE_Comp_Modal_Journal_Import
|
||||||
|
|||||||
@@ -8,12 +8,10 @@ import { untrack } from 'svelte';
|
|||||||
import {
|
import {
|
||||||
CalendarClock,
|
CalendarClock,
|
||||||
Check,
|
Check,
|
||||||
|
CircleAlert,
|
||||||
CodeXml,
|
CodeXml,
|
||||||
Database,
|
Database,
|
||||||
Layout,
|
|
||||||
MonitorPlay,
|
|
||||||
MousePointerClick,
|
MousePointerClick,
|
||||||
Palette,
|
|
||||||
Settings,
|
Settings,
|
||||||
ShieldCheck,
|
ShieldCheck,
|
||||||
Wrench,
|
Wrench,
|
||||||
@@ -22,7 +20,8 @@ import {
|
|||||||
import { Modal } from 'flowbite-svelte';
|
import { Modal } from 'flowbite-svelte';
|
||||||
|
|
||||||
// *** Import Aether specific variables and functions
|
// *** Import Aether specific variables and functions
|
||||||
import { ae_loc, ae_api } from '$lib/stores/ae_stores';
|
import { ae_loc } from '$lib/stores/ae_stores';
|
||||||
|
import type { key_val } from '$lib/stores/ae_stores';
|
||||||
import {
|
import {
|
||||||
journals_loc,
|
journals_loc,
|
||||||
journals_sess
|
journals_sess
|
||||||
@@ -30,21 +29,21 @@ import {
|
|||||||
import AE_Comp_Editor_CodeMirror from '$lib/elements/element_editor_codemirror.svelte';
|
import AE_Comp_Editor_CodeMirror from '$lib/elements/element_editor_codemirror.svelte';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
log_lvl?: number;
|
|
||||||
show?: boolean;
|
show?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { log_lvl = 0, show = $bindable(false) }: Props = $props();
|
let { show = $bindable(false) }: Props = $props();
|
||||||
|
|
||||||
// Internal State
|
// Internal State
|
||||||
let tab: 'form' | 'local_json' | 'session_json' = $state('form');
|
let tab: 'config' | 'local_json' | 'session_json' = $state('config');
|
||||||
let tmp_config: any = $state({
|
let tmp_config: key_val = $state({
|
||||||
journal: {},
|
journal: {},
|
||||||
entry: {}
|
entry: {}
|
||||||
});
|
});
|
||||||
|
|
||||||
const panel_class = 'space-y-4 rounded-xl border border-surface-500/20 bg-surface-500/5 p-4 shadow-sm';
|
const panel_class = 'space-y-4 rounded-xl border border-surface-500/20 bg-surface-500/5 p-4 shadow-sm';
|
||||||
const panel_title_class = 'flex items-center gap-2 border-b border-surface-500/20 pb-2 text-lg font-bold';
|
const panel_title_class = 'flex items-center gap-2 border-b border-surface-500/20 pb-2 text-lg font-bold';
|
||||||
|
const field_card_class = 'bg-surface-500/5 border-surface-500/10 flex cursor-pointer items-center space-x-3 rounded-lg border p-3 transition-colors hover:bg-surface-500/10';
|
||||||
const tab_button_base_class = 'btn btn-sm border transition-all duration-200';
|
const tab_button_base_class = 'btn btn-sm border transition-all duration-200';
|
||||||
const tab_button_active_class = 'border-surface-200-800 bg-surface-200-800 text-surface-950-50 shadow-sm';
|
const tab_button_active_class = 'border-surface-200-800 bg-surface-200-800 text-surface-950-50 shadow-sm';
|
||||||
const tab_button_inactive_class = 'border-transparent bg-surface-50-900/60 text-surface-600-400 hover:border-surface-200-800 hover:bg-surface-100-900 hover:text-surface-950-50';
|
const tab_button_inactive_class = 'border-transparent bg-surface-50-900/60 text-surface-600-400 hover:border-surface-200-800 hover:bg-surface-100-900 hover:text-surface-950-50';
|
||||||
@@ -98,8 +97,8 @@ function handle_save() {
|
|||||||
class="bg-surface-500/10 sticky top-0 z-10 mx-auto mb-4 flex max-w-fit justify-center gap-1 rounded-lg p-1 backdrop-blur-sm">
|
class="bg-surface-500/10 sticky top-0 z-10 mx-auto mb-4 flex max-w-fit justify-center gap-1 rounded-lg p-1 backdrop-blur-sm">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class={tab_button_class(tab === 'form')}
|
class={tab_button_class(tab === 'config')}
|
||||||
onclick={() => (tab = 'form')}>
|
onclick={() => (tab = 'config')}>
|
||||||
<Settings size="1.1em" class="mr-1" /> Config
|
<Settings size="1.1em" class="mr-1" /> Config
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@@ -116,16 +115,16 @@ function handle_save() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if tab === 'form'}
|
{#if tab === 'config'}
|
||||||
<div class="animate-in fade-in space-y-8 duration-300">
|
<div class="animate-in fade-in space-y-4 duration-300">
|
||||||
<!-- Date/Time Section -->
|
<!-- Date/Time Section -->
|
||||||
<section class={panel_class}>
|
<section class={panel_class}>
|
||||||
<h2 class={panel_title_class}>
|
<h2 class={panel_title_class}>
|
||||||
<CalendarClock size="1.2em" class="text-primary-500" />
|
<CalendarClock size="1.2em" class="text-primary-500" />
|
||||||
Date and Time Display
|
Date and Time Display
|
||||||
</h2>
|
</h2>
|
||||||
<div class="grid grid-cols-1 gap-6 p-2 md:grid-cols-2">
|
<div class="grid grid-cols-1 gap-4 p-2 md:grid-cols-2">
|
||||||
<label class="label">
|
<label class="label flex flex-col items-start gap-1">
|
||||||
<span class="text-sm font-bold opacity-70"
|
<span class="text-sm font-bold opacity-70"
|
||||||
>DateTime Format</span>
|
>DateTime Format</span>
|
||||||
<select
|
<select
|
||||||
@@ -145,7 +144,7 @@ function handle_save() {
|
|||||||
>ISO (YYYY-MM-DD HH:mm:ss)</option>
|
>ISO (YYYY-MM-DD HH:mm:ss)</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<label class="label">
|
<label class="label flex flex-col items-start gap-1">
|
||||||
<span class="text-sm font-bold opacity-70"
|
<span class="text-sm font-bold opacity-70"
|
||||||
>Time-Only Format</span>
|
>Time-Only Format</span>
|
||||||
<select
|
<select
|
||||||
@@ -172,9 +171,8 @@ function handle_save() {
|
|||||||
class="text-primary-500" />
|
class="text-primary-500" />
|
||||||
User Interface Preferences
|
User Interface Preferences
|
||||||
</h2>
|
</h2>
|
||||||
<div class="grid grid-cols-1 gap-6 p-2 md:grid-cols-2">
|
<div class="grid grid-cols-1 gap-4 p-2 md:grid-cols-2">
|
||||||
<label
|
<label class={field_card_class}>
|
||||||
class="bg-surface-500/5 border-surface-500/10 flex cursor-pointer items-center space-x-3 rounded-lg border p-2">
|
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
bind:checked={tmp_config.entry.auto_save}
|
bind:checked={tmp_config.entry.auto_save}
|
||||||
@@ -186,8 +184,7 @@ function handle_save() {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
<label
|
<label class={field_card_class}>
|
||||||
class="bg-surface-500/5 border-surface-500/10 flex cursor-pointer items-center space-x-3 rounded-lg border p-2">
|
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
bind:checked={tmp_config.show_id_random}
|
bind:checked={tmp_config.show_id_random}
|
||||||
@@ -209,8 +206,8 @@ function handle_save() {
|
|||||||
<Database size="1.2em" class="text-primary-500" />
|
<Database size="1.2em" class="text-primary-500" />
|
||||||
Journal Query Filters
|
Journal Query Filters
|
||||||
</h2>
|
</h2>
|
||||||
<div class="grid grid-cols-1 gap-6 p-2 md:grid-cols-3">
|
<div class="grid grid-cols-1 gap-4 p-2 md:grid-cols-3">
|
||||||
<label class="label">
|
<label class="label flex flex-col items-start gap-1">
|
||||||
<span class="text-sm font-bold opacity-70"
|
<span class="text-sm font-bold opacity-70"
|
||||||
>Enabled Status</span>
|
>Enabled Status</span>
|
||||||
<select
|
<select
|
||||||
@@ -223,7 +220,7 @@ function handle_save() {
|
|||||||
>All (Enabled & Disabled & NULL)</option>
|
>All (Enabled & Disabled & NULL)</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<label class="label">
|
<label class="label flex flex-col items-start gap-1">
|
||||||
<span class="text-sm font-bold opacity-70"
|
<span class="text-sm font-bold opacity-70"
|
||||||
>Hidden Status</span>
|
>Hidden Status</span>
|
||||||
<select
|
<select
|
||||||
@@ -235,7 +232,7 @@ function handle_save() {
|
|||||||
>All (Visible & Hidden & NULL)</option>
|
>All (Visible & Hidden & NULL)</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<label class="label">
|
<label class="label flex flex-col items-start gap-1">
|
||||||
<span class="text-sm font-bold opacity-70"
|
<span class="text-sm font-bold opacity-70"
|
||||||
>Query Limit</span>
|
>Query Limit</span>
|
||||||
<select
|
<select
|
||||||
@@ -259,8 +256,8 @@ function handle_save() {
|
|||||||
<Database size="1.2em" class="text-primary-500" />
|
<Database size="1.2em" class="text-primary-500" />
|
||||||
Entry Query Filters
|
Entry Query Filters
|
||||||
</h2>
|
</h2>
|
||||||
<div class="grid grid-cols-1 gap-6 p-2 md:grid-cols-3">
|
<div class="grid grid-cols-1 gap-4 p-2 md:grid-cols-3">
|
||||||
<label class="label">
|
<label class="label flex flex-col items-start gap-1">
|
||||||
<span class="text-sm font-bold opacity-70"
|
<span class="text-sm font-bold opacity-70"
|
||||||
>Enabled Status</span>
|
>Enabled Status</span>
|
||||||
<select
|
<select
|
||||||
@@ -273,7 +270,7 @@ function handle_save() {
|
|||||||
>All (Enabled & Disabled & NULL)</option>
|
>All (Enabled & Disabled & NULL)</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<label class="label">
|
<label class="label flex flex-col items-start gap-1">
|
||||||
<span class="text-sm font-bold opacity-70"
|
<span class="text-sm font-bold opacity-70"
|
||||||
>Hidden Status</span>
|
>Hidden Status</span>
|
||||||
<select
|
<select
|
||||||
@@ -285,7 +282,7 @@ function handle_save() {
|
|||||||
>All (Visible & Hidden & NULL)</option>
|
>All (Visible & Hidden & NULL)</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<label class="label">
|
<label class="label flex flex-col items-start gap-1">
|
||||||
<span class="text-sm font-bold opacity-70"
|
<span class="text-sm font-bold opacity-70"
|
||||||
>Query Limit</span>
|
>Query Limit</span>
|
||||||
<select
|
<select
|
||||||
@@ -313,8 +310,7 @@ function handle_save() {
|
|||||||
<div class="text-sm italic opacity-80">
|
<div class="text-sm italic opacity-80">
|
||||||
Global security overrides for the journal module.
|
Global security overrides for the journal module.
|
||||||
</div>
|
</div>
|
||||||
<label
|
<label class={field_card_class}>
|
||||||
class="flex cursor-pointer items-center space-x-3">
|
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
bind:checked={
|
bind:checked={
|
||||||
@@ -326,6 +322,121 @@ function handle_save() {
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- Alerts Section -->
|
||||||
|
<section class={panel_class}>
|
||||||
|
<h2 class={panel_title_class}>
|
||||||
|
<CircleAlert size="1.2em" class="text-primary-500" />
|
||||||
|
Alerts & Messaging
|
||||||
|
</h2>
|
||||||
|
<div class="space-y-4 rounded-xl border border-surface-500/10 bg-surface-500/5 p-4">
|
||||||
|
<label class="label flex flex-col items-start gap-1">
|
||||||
|
<span class="text-sm font-bold opacity-70"
|
||||||
|
>Alert Message</span>
|
||||||
|
<textarea
|
||||||
|
bind:value={tmp_config.alert_msg}
|
||||||
|
class="textarea min-h-24 w-full"
|
||||||
|
placeholder="Optional alert or notice shown with the journal"
|
||||||
|
></textarea>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class={field_card_class}>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
bind:checked={tmp_config.alert}
|
||||||
|
class="checkbox checkbox-primary" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="font-bold">Enable Alert</span>
|
||||||
|
<span class="text-xs opacity-60">
|
||||||
|
Mark this journal for attention in lists and
|
||||||
|
headers.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Admin Section -->
|
||||||
|
<section class={panel_class}>
|
||||||
|
<h2 class={panel_title_class}>
|
||||||
|
<Settings size="1.2em" class="text-primary-500" />
|
||||||
|
Admin
|
||||||
|
</h2>
|
||||||
|
<div class="space-y-4 rounded-xl border border-surface-500/10 bg-surface-500/5 p-4">
|
||||||
|
<label class="label flex flex-col items-start gap-1">
|
||||||
|
<span class="text-sm font-bold opacity-70"
|
||||||
|
>Notes</span>
|
||||||
|
<textarea
|
||||||
|
bind:value={tmp_config.notes}
|
||||||
|
class="textarea min-h-24 w-full"
|
||||||
|
placeholder="Internal notes for administrators and trusted access"
|
||||||
|
></textarea>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
|
||||||
|
<label class={field_card_class}>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
bind:checked={tmp_config.enable}
|
||||||
|
class="checkbox checkbox-primary" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="font-bold">Enabled</span>
|
||||||
|
<span class="text-xs opacity-60">
|
||||||
|
Allow access to this journal.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class={field_card_class}>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
bind:checked={tmp_config.hide}
|
||||||
|
class="checkbox checkbox-primary" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="font-bold">Hidden</span>
|
||||||
|
<span class="text-xs opacity-60">
|
||||||
|
Hide this journal from standard lists.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class={field_card_class}>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
bind:checked={tmp_config.priority}
|
||||||
|
class="checkbox checkbox-primary" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="font-bold">Priority</span>
|
||||||
|
<span class="text-xs opacity-60">
|
||||||
|
Pin this journal ahead of the standard
|
||||||
|
order.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="bg-surface-500/5 border-surface-500/10 flex items-center justify-between rounded-lg border p-3">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-sm font-bold"
|
||||||
|
>Sort Order</span>
|
||||||
|
<span class="text-xs opacity-60">
|
||||||
|
Lower numbers appear earlier in lists.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
bind:value={tmp_config.sort}
|
||||||
|
class="input input-sm w-24 text-right" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="rounded-xl border border-surface-500/10 bg-surface-500/5 p-4">
|
||||||
|
<p class="text-xs italic opacity-70">
|
||||||
|
Admin changes apply to the journal module state
|
||||||
|
and are saved with the rest of this config.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
{:else if tab === 'local_json'}
|
{:else if tab === 'local_json'}
|
||||||
<div class="h-full min-h-100">
|
<div class="h-full min-h-100">
|
||||||
|
|||||||
Reference in New Issue
Block a user