Sharkey/packages/frontend/src/pages/settings/statusbar.vue

57 lines
1.3 KiB
Vue
Raw Normal View History

<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
2023-01-06 06:40:17 +02:00
<div class="_gaps_m">
2023-01-09 02:41:25 +02:00
<MkFolder v-for="x in statusbars" :key="x.id">
<template #label>{{ x.type ?? i18n.ts.notSet }}</template>
<template #suffix>{{ x.name }}</template>
2023-05-19 14:52:15 +03:00
<XStatusbar :_id="x.id" :userLists="userLists"/>
2023-01-09 02:41:25 +02:00
</MkFolder>
2023-01-06 02:41:14 +02:00
<MkButton primary @click="add">{{ i18n.ts.add }}</MkButton>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, computed } from 'vue';
import { v4 as uuid } from 'uuid';
import XStatusbar from './statusbar.statusbar.vue';
2023-01-09 02:41:25 +02:00
import MkFolder from '@/components/MkFolder.vue';
2023-01-06 02:41:14 +02:00
import MkButton from '@/components/MkButton.vue';
2023-09-19 10:37:43 +03:00
import * as os from '@/os.js';
import { defaultStore } from '@/store.js';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
const statusbars = defaultStore.reactiveState.statusbars;
const userLists = ref();
onMounted(() => {
os.api('users/lists/list').then(res => {
userLists.value = res;
});
});
async function add() {
defaultStore.push('statusbars', {
id: uuid(),
type: null,
black: false,
2022-07-03 19:37:47 +03:00
size: 'medium',
props: {},
});
}
const headerActions = computed(() => []);
const headerTabs = computed(() => []);
definePageMetadata({
title: i18n.ts.statusbar,
icon: 'ph-list ph-bold ph-lg',
});
</script>