Fixed mutation
parent
0bebec7111
commit
29afc95ff1
|
@ -101,7 +101,7 @@ export default {
|
||||||
if (this.themeName == null || !this.themeName.trim().length) {
|
if (this.themeName == null || !this.themeName.trim().length) {
|
||||||
this.$toast.add({ severity: 'error', summary: 'Error', detail: 'Name is required', life: 3000 });
|
this.$toast.add({ severity: 'error', summary: 'Error', detail: 'Name is required', life: 3000 });
|
||||||
} else {
|
} else {
|
||||||
const newPreset = presets[this.basePreset];
|
const newPreset = structuredClone(presets[this.basePreset]);
|
||||||
|
|
||||||
if (this.$appState.designer.verified) {
|
if (this.$appState.designer.verified) {
|
||||||
const { data, error } = await $fetch(this.designerApiUrl + '/theme/create', {
|
const { data, error } = await $fetch(this.designerApiUrl + '/theme/create', {
|
||||||
|
|
|
@ -48,39 +48,33 @@
|
||||||
>
|
>
|
||||||
<i class="pi pi-plus"></i>
|
<i class="pi pi-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
<template v-if="loading">
|
<div v-for="theme of $appState.designer.themes" :key="theme.t_key" class="flex flex-col gap-2 relative">
|
||||||
<Skeleton class="!rounded-xl !h-32 !w-32">-</Skeleton>
|
<button
|
||||||
<Skeleton class="!rounded-xl !h-32 !w-32">-</Skeleton>
|
type="button"
|
||||||
</template>
|
class="rounded-xl h-32 w-32 px-4 overflow-hidden text-ellipsis bg-transparent border border-surface-200 dark:border-surface-700 hover:border-surface-400 dark:hover:border-surface-500 text-black dark:text-white"
|
||||||
<template v-else>
|
@click="loadTheme(theme)"
|
||||||
<div v-for="theme of $appState.designer.themes" :key="theme.t_key" class="flex flex-col gap-2 relative">
|
>
|
||||||
<button
|
<span class="text-2xl uppercase font-bold">{{ abbrThemeName(theme) }}</span>
|
||||||
type="button"
|
</button>
|
||||||
class="rounded-xl h-32 w-32 px-4 overflow-hidden text-ellipsis bg-transparent border border-surface-200 dark:border-surface-700 hover:border-surface-400 dark:hover:border-surface-500 text-black dark:text-white"
|
<div class="flex flex-col items-center gap-1">
|
||||||
@click="loadTheme(theme)"
|
<div class="group flex items-center gap-2 relative">
|
||||||
>
|
<input
|
||||||
<span class="text-2xl uppercase font-bold">{{ abbrThemeName(theme) }}</span>
|
v-model="theme.t_name"
|
||||||
</button>
|
type="text"
|
||||||
<div class="flex flex-col items-center gap-1">
|
:class="['w-24 text-sm px-2 text-center pr-4', { 'bg-red-50 dark:bg-red-500/30': !theme.t_name }]"
|
||||||
<div class="group flex items-center gap-2 relative">
|
maxlength="100"
|
||||||
<input
|
@blur="renameTheme(theme)"
|
||||||
v-model="theme.t_name"
|
@keydown.enter="onThemeNameEnterKey($event)"
|
||||||
type="text"
|
@keydown.escape="onThemeNameEscape($event)"
|
||||||
:class="['w-24 text-sm px-2 text-center pr-4', { 'bg-red-50 dark:bg-red-500/30': !theme.t_name }]"
|
/>
|
||||||
maxlength="100"
|
<i class="hidden group-hover:block pi pi-pencil !text-xs absolute top-50 text-muted-color" style="right: 2px"></i>
|
||||||
@blur="renameTheme(theme)"
|
|
||||||
@keydown.enter="onThemeNameEnterKey($event)"
|
|
||||||
@keydown.escape="onThemeNameEscape($event)"
|
|
||||||
/>
|
|
||||||
<i class="hidden group-hover:block pi pi-pencil !text-xs absolute top-50 text-muted-color" style="right: 2px"></i>
|
|
||||||
</div>
|
|
||||||
<span class="text-muted-color text-xs">{{ formatTimestamp(theme.t_last_updated) }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<button type="button" @click="toggleMenuOptions($event, theme)" class="hover:bg-surface-100 dark:hover:bg-surface-800 text-surface-500 dark:text-surface-400 flex absolute top-1 right-1 w-8 h-8 rounded-lg items-center justify-center">
|
<span class="text-muted-color text-xs">{{ formatTimestamp(theme.t_last_updated) }}</span>
|
||||||
<i class="pi pi-ellipsis-h !text-xs" />
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<button type="button" @click="toggleMenuOptions($event, theme)" class="hover:bg-surface-100 dark:hover:bg-surface-800 text-surface-500 dark:text-surface-400 flex absolute top-1 right-1 w-8 h-8 rounded-lg items-center justify-center">
|
||||||
|
<i class="pi pi-ellipsis-h !text-xs" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<Menu ref="themeMenu" :model="themeOptions" :popup="true" @show="onMenuShow" @hide="onMenuHide" />
|
<Menu ref="themeMenu" :model="themeOptions" :popup="true" @show="onMenuShow" @hide="onMenuHide" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue