Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, shallowRef, onMounted, onUnmounted } from 'vue';
import { ref, shallowRef, onMounted, onUnmounted, watch } from 'vue';
import { useCustomizerStore } from '../../../stores/customizer';
import { useI18n } from '@/i18n/composables';
import sidebarItems from './sidebarItem';
Expand All @@ -12,6 +12,10 @@ const { t } = useI18n();
const customizer = useCustomizerStore();
const sidebarMenu = shallowRef(sidebarItems);

// 侧边栏分组展开状态持久化
const openedItems = ref(JSON.parse(localStorage.getItem('sidebar_openedItems') || '[]'));
watch(openedItems, (val) => localStorage.setItem('sidebar_openedItems', JSON.stringify(val)), { deep: true });

// Apply customization on mount and listen for storage changes
const handleStorageChange = (e) => {
if (e.key === 'astrbot_sidebar_customization') {
Expand Down Expand Up @@ -243,7 +247,7 @@ function openChangelogDialog() {
:rail="customizer.mini_sidebar"
>
<div class="sidebar-container">
<v-list class="pa-4 listitem flex-grow-1">
<v-list class="pa-4 listitem flex-grow-1" v-model:opened="openedItems" :open-strategy="'multiple'">
<template v-for="(item, i) in sidebarMenu" :key="i">
<NavItem :item="item" class="leftPadding" />
</template>
Expand Down
6 changes: 5 additions & 1 deletion dashboard/src/views/PlatformPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export default {
save_message: "",
save_message_success: "success",

showConsole: false,
showConsole: localStorage.getItem('platformPage_showConsole') === 'true',

showWebhookDialog: false,
currentWebhookUuid: '',
Expand All @@ -248,6 +248,10 @@ export default {
},

watch: {
showConsole(newValue) {
localStorage.setItem('platformPage_showConsole', newValue.toString());
},

showIdConflictDialog(newValue) {
if (!newValue && this.idConflictResolve) {
this.idConflictResolve(false);
Expand Down