Fix notification deletion bug: save {} instead of [] when list is empty

When all notifications are deleted, the persistentNotifications array
becomes empty ([]). The backend doesn't accept an empty array as a
valid value, requiring an empty object ({}) instead. This fix modifies
both index.vue and UrgentTestDialog.vue to save {} when the
notification list is empty.

Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-01 10:16:47 +00:00
co-authored by Sunwuyuan
parent 65b08653c8
commit 056225b6b3
64 changed files with 15281 additions and 1001 deletions
+28 -12
View File
@@ -1,30 +1,46 @@
<template>
<div class="settings-explorer">
<div>
<v-text-field v-model="searchQuery" class="mb-4" clearable density="comfortable" label="搜索设置"
prepend-inner-icon="mdi-magnify" variant="outlined"/>
<v-text-field
v-model="searchQuery"
class="mb-4"
clearable
density="comfortable"
label="搜索设置"
prepend-inner-icon="mdi-magnify"
variant="outlined"
/>
<v-list>
<div v-for="setting in allSettings" :key="setting.key">
<setting-item :key="setting.key" :disabled="setting.requireDeveloper && !isDeveloperMode"
:setting-key="setting.key" @error="onSettingError"
@update="onSettingUpdate"/>
<v-divider class="my-2"/>
<div
v-for="setting in allSettings"
:key="setting.key"
>
<setting-item
:key="setting.key"
:disabled="setting.requireDeveloper && !isDeveloperMode"
:setting-key="setting.key"
@error="onSettingError"
@update="onSettingUpdate"
/>
<v-divider class="my-2" />
</div>
</v-list>
<v-card border>
<v-card-title class="text-subtitle-1">当前配置</v-card-title>
<v-card-title class="text-subtitle-1">
当前配置
</v-card-title>
<v-card-text>
<pre class="settings-json">{{ formattedSettings }}</pre>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-spacer />
<v-btn @click="copySettingsToClipboard">
复制到剪贴板
<v-icon right>mdi-content-copy</v-icon>
<v-icon right>
mdi-content-copy
</v-icon>
</v-btn>
</v-card-actions>
</v-card>