2022-07-03 07:40:02 +02:00
|
|
|
<template>
|
2023-04-08 02:01:42 +02:00
|
|
|
<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>
|
|
|
|
<FormButton primary @click="add">{{ i18n.ts.add }}</FormButton>
|
|
|
|
</div>
|
2022-07-03 07:40:02 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-04-08 02:01:42 +02:00
|
|
|
import { computed, onMounted, ref, watch } from "vue";
|
|
|
|
import { v4 as uuid } from "uuid";
|
|
|
|
import XStatusbar from "./statusbar.statusbar.vue";
|
|
|
|
import FormRadios from "@/components/form/radios.vue";
|
|
|
|
import FormFolder from "@/components/form/folder.vue";
|
|
|
|
import FormButton 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";
|
2022-07-03 07:40:02 +02:00
|
|
|
|
|
|
|
const statusbars = defaultStore.reactiveState.statusbars;
|
|
|
|
|
|
|
|
let userLists = $ref();
|
|
|
|
|
|
|
|
onMounted(() => {
|
2023-04-08 02:01:42 +02:00
|
|
|
os.api("users/lists/list").then((res) => {
|
2022-07-03 07:40:02 +02:00
|
|
|
userLists = res;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
async function add() {
|
2023-04-08 02:01:42 +02:00
|
|
|
defaultStore.push("statusbars", {
|
2022-07-03 07:40:02 +02:00
|
|
|
id: uuid(),
|
|
|
|
type: null,
|
|
|
|
black: false,
|
2023-04-08 02:01:42 +02:00
|
|
|
size: "medium",
|
2022-07-03 07:40:02 +02:00
|
|
|
props: {},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.statusbar,
|
2023-04-08 02:01:42 +02:00
|
|
|
icon: "ph-list-bullets ph-bold ph-lg",
|
|
|
|
bg: "var(--bg)",
|
2022-07-03 07:40:02 +02:00
|
|
|
});
|
|
|
|
</script>
|