1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-18 08:38:11 +09:00
hotomoe/packages/frontend/src/pages/settings/statusbar.vue

55 lines
1.3 KiB
Vue
Raw Normal View History

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