2022-07-02 23:40:02 -06:00
|
|
|
<template>
|
|
|
|
<div class="_formRoot">
|
|
|
|
<FormFolder v-for="x in statusbars" :key="x.id" class="_formBlock">
|
|
|
|
<template #label>{{ x.type ?? i18n.ts.notSet }}</template>
|
|
|
|
<template #suffix>{{ x.name }}</template>
|
|
|
|
<XStatusbar :_id="x.id" :user-lists="userLists"/>
|
|
|
|
</FormFolder>
|
2022-07-07 06:00:42 -06:00
|
|
|
<FormButton primary @click="add">{{ i18n.ts.add }}</FormButton>
|
2022-07-02 23:40:02 -06:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed, onMounted, ref, watch } from 'vue';
|
|
|
|
import { v4 as uuid } from 'uuid';
|
2022-07-20 04:59:27 -06:00
|
|
|
import XStatusbar from './statusbar.statusbar.vue';
|
2022-07-02 23:40:02 -06:00
|
|
|
import FormRadios from '@/components/form/radios.vue';
|
|
|
|
import FormFolder from '@/components/form/folder.vue';
|
2022-09-06 03:21:49 -06:00
|
|
|
import FormButton from '@/components/MkButton.vue';
|
2022-07-02 23:40:02 -06:00
|
|
|
import * as os from '@/os';
|
|
|
|
import { defaultStore } from '@/store';
|
|
|
|
import { unisonReload } from '@/scripts/unison-reload';
|
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
|
|
|
|
|
|
|
const statusbars = defaultStore.reactiveState.statusbars;
|
|
|
|
|
|
|
|
let userLists = $ref();
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
os.api('users/lists/list').then(res => {
|
|
|
|
userLists = res;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
async function add() {
|
|
|
|
defaultStore.push('statusbars', {
|
|
|
|
id: uuid(),
|
|
|
|
type: null,
|
|
|
|
black: false,
|
2022-07-03 10:37:47 -06:00
|
|
|
size: 'medium',
|
2022-07-02 23:40:02 -06:00
|
|
|
props: {},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.statusbar,
|
2022-11-06 18:33:52 -07:00
|
|
|
icon: 'ph-list-bullets',
|
2022-07-02 23:40:02 -06:00
|
|
|
bg: 'var(--bg)',
|
|
|
|
});
|
|
|
|
</script>
|