2023-07-27 14:31:52 +09:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2022-07-03 14:40:02 +09:00
|
|
|
<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">
|
2022-07-03 14:40:02 +09:00
|
|
|
<template #label>{{ x.type ?? i18n.ts.notSet }}</template>
|
|
|
|
<template #suffix>{{ x.name }}</template>
|
2023-05-19 20:52:15 +09:00
|
|
|
<XStatusbar :_id="x.id" :userLists="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>
|
2022-07-03 14:40:02 +09:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-12-07 14:42:09 +09:00
|
|
|
import { onMounted, ref, computed } from 'vue';
|
2023-12-26 14:19:35 +09:00
|
|
|
import * as Misskey from 'misskey-js';
|
2022-07-03 14:40:02 +09:00
|
|
|
import { v4 as uuid } from 'uuid';
|
2022-07-20 19:59:27 +09:00
|
|
|
import XStatusbar from './statusbar.statusbar.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';
|
2024-01-04 18:32:46 +09:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
2023-09-19 16:37:43 +09:00
|
|
|
import { defaultStore } from '@/store.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2022-07-03 14:40:02 +09:00
|
|
|
|
|
|
|
const statusbars = defaultStore.reactiveState.statusbars;
|
|
|
|
|
2023-12-26 14:19:35 +09:00
|
|
|
const userLists = ref<Misskey.entities.UserList[] | null>(null);
|
2022-07-03 14:40:02 +09:00
|
|
|
|
|
|
|
onMounted(() => {
|
2024-01-04 18:32:46 +09:00
|
|
|
misskeyApi('users/lists/list').then(res => {
|
2023-12-07 14:42:09 +09:00
|
|
|
userLists.value = res;
|
2022-07-03 14:40:02 +09:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
async function add() {
|
|
|
|
defaultStore.push('statusbars', {
|
|
|
|
id: uuid(),
|
|
|
|
type: null,
|
|
|
|
black: false,
|
2022-07-04 01:37:47 +09:00
|
|
|
size: 'medium',
|
2022-07-03 14:40:02 +09:00
|
|
|
props: {},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-12-07 14:42:09 +09:00
|
|
|
const headerActions = computed(() => []);
|
2022-07-03 14:40:02 +09:00
|
|
|
|
2023-12-07 14:42:09 +09:00
|
|
|
const headerTabs = computed(() => []);
|
2022-07-03 14:40:02 +09:00
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.statusbar,
|
2022-12-19 19:01:30 +09:00
|
|
|
icon: 'ti ti-list',
|
2022-07-03 14:40:02 +09:00
|
|
|
});
|
|
|
|
</script>
|