('/groups')
let next: Detail | undefined
if (list.some((group) => group.id === selected)) {
try {
@@ -111,6 +111,15 @@ function change(action: string, target?: string, value?: string) {
})
}
+function setPreference(key: keyof GroupPreferences) {
+ const current = detail.value
+ if (current?.state !== 'active') return
+ void run(async () => {
+ await session.authorized('/groups/' + current.id + '/preferences', 'POST', { [key]: !current[key] })
+ await refresh()
+ })
+}
+
watch(id, () => {
detail.value = undefined
confirmation.value = undefined
@@ -120,6 +129,7 @@ watch(id, () => {
else reload()
})
watch(() => session.groupListChanges, queueRefresh)
+watch(() => session.groupChange, queueRefresh)
watch(() => session.connection, (connection) => { if (connection === '实时连接已建立') queueRefresh() })
onMounted(() => {
reload()
@@ -144,7 +154,14 @@ onBeforeUnmount(() => {
- {{ group.name }}{{ group.state === 'invited' ? '待接受邀请' : roles[group.role] }}
+
+ {{ group.name }}
+ {{ group.state === 'invited' ? '待接受邀请' : roles[group.role] }} · 已置顶 · 免打扰
+
+
+ {{ group.unread >= 100 ? '99+' : group.unread }}
+ {{ group.unread >= 100 ? '99 条以上未读' : group.unread + ' 条未读' }}
+
@@ -159,7 +176,11 @@ onBeforeUnmount(() => {
-
+
+
+
+
+
+
+
diff --git a/web/src/views/Workspace.vue b/web/src/views/Workspace.vue
index 9c9d35e..5d97f52 100644
--- a/web/src/views/Workspace.vue
+++ b/web/src/views/Workspace.vue
@@ -1,11 +1,29 @@