2022-07-03 08:40:02 +03:00
|
|
|
<template>
|
2023-01-06 06:40:17 +02:00
|
|
|
<div class="_gaps_m">
|
2023-01-05 14:04:56 +02:00
|
|
|
<FormFolder v-for="x in statusbars" :key="x.id">
|
2022-07-03 08:40:02 +03:00
|
|
|
<template #label>{{ x.type ?? i18n.ts.notSet }}</template>
|
|
|
|
<template #suffix>{{ x.name }}</template>
|
|
|
|
<XStatusbar :_id="x.id" :user-lists="userLists"/>
|
|
|
|
</FormFolder>
|
2023-01-06 02:41:14 +02:00
|
|
|
<MkButton primary @click="add">{{ i18n.ts.add }}</MkButton>
|
2022-07-03 08:40:02 +03:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed, onMounted, ref, watch } from 'vue';
|
|
|
|
import { v4 as uuid } from 'uuid';
|
2022-07-20 13:59:27 +03:00
|
|
|
import XStatusbar from './statusbar.statusbar.vue';
|
2023-01-07 08:09:46 +02:00
|
|
|
import MkRadios from '@/components/MkRadios.vue';
|
2022-07-03 08:40:02 +03:00
|
|
|
import FormFolder from '@/components/form/folder.vue';
|
2023-01-06 02:41:14 +02:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2022-07-03 08:40:02 +03: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 19:37:47 +03:00
|
|
|
size: 'medium',
|
2022-07-03 08:40:02 +03:00
|
|
|
props: {},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.statusbar,
|
2022-12-19 12:01:30 +02:00
|
|
|
icon: 'ti ti-list',
|
2022-07-03 08:40:02 +03:00
|
|
|
bg: 'var(--bg)',
|
|
|
|
});
|
|
|
|
</script>
|