mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 18:22:40 +00:00
Add current user message in settings dialog (#1740)
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
:value="category.label"
|
:value="category.label"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
|
<CurrentUserMessage v-if="tabValue === 'Comfy'" />
|
||||||
<FirstTimeUIMessage v-if="tabValue === 'Comfy'" />
|
<FirstTimeUIMessage v-if="tabValue === 'Comfy'" />
|
||||||
</template>
|
</template>
|
||||||
<SettingsPanel :settingGroups="sortedGroups(category)" />
|
<SettingsPanel :settingGroups="sortedGroups(category)" />
|
||||||
@@ -74,6 +75,7 @@ import SettingsPanel from './setting/SettingsPanel.vue'
|
|||||||
import PanelTemplate from './setting/PanelTemplate.vue'
|
import PanelTemplate from './setting/PanelTemplate.vue'
|
||||||
import AboutPanel from './setting/AboutPanel.vue'
|
import AboutPanel from './setting/AboutPanel.vue'
|
||||||
import FirstTimeUIMessage from './setting/FirstTimeUIMessage.vue'
|
import FirstTimeUIMessage from './setting/FirstTimeUIMessage.vue'
|
||||||
|
import CurrentUserMessage from './setting/CurrentUserMessage.vue'
|
||||||
import { flattenTree } from '@/utils/treeUtil'
|
import { flattenTree } from '@/utils/treeUtil'
|
||||||
import { isElectron } from '@/utils/envUtil'
|
import { isElectron } from '@/utils/envUtil'
|
||||||
|
|
||||||
|
|||||||
26
src/components/dialog/content/setting/CurrentUserMessage.vue
Normal file
26
src/components/dialog/content/setting/CurrentUserMessage.vue
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<!-- A message that displays the current user -->
|
||||||
|
<template>
|
||||||
|
<Message
|
||||||
|
v-if="userStore.isMultiUserServer"
|
||||||
|
severity="info"
|
||||||
|
icon="pi pi-user"
|
||||||
|
pt:text="w-full"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>{{ $t('currentUser') }}: {{ userStore.currentUser?.username }}</div>
|
||||||
|
<Button icon="pi pi-sign-out" @click="logout" text />
|
||||||
|
</div>
|
||||||
|
</Message>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import Message from 'primevue/message'
|
||||||
|
import Button from 'primevue/button'
|
||||||
|
import { useUserStore } from '@/stores/userStore'
|
||||||
|
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const logout = () => {
|
||||||
|
userStore.logout()
|
||||||
|
window.location.reload()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<Message
|
<Message
|
||||||
v-if="show"
|
v-if="show"
|
||||||
class="first-time-ui-message m-2"
|
class="first-time-ui-message"
|
||||||
severity="info"
|
severity="info"
|
||||||
:closable="true"
|
:closable="true"
|
||||||
@close="handleClose"
|
@close="handleClose"
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ export default {
|
|||||||
revertChanges: 'Revert Changes',
|
revertChanges: 'Revert Changes',
|
||||||
restart: 'Restart'
|
restart: 'Restart'
|
||||||
},
|
},
|
||||||
|
currentUser: 'Current user',
|
||||||
empty: 'Empty',
|
empty: 'Empty',
|
||||||
noWorkflowsFound: 'No workflows found.',
|
noWorkflowsFound: 'No workflows found.',
|
||||||
comingSoon: 'Coming Soon',
|
comingSoon: 'Coming Soon',
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ export default {
|
|||||||
revertChanges: '変更を元に戻す',
|
revertChanges: '変更を元に戻す',
|
||||||
restart: '再起動'
|
restart: '再起動'
|
||||||
},
|
},
|
||||||
|
currentUser: '現在のユーザー',
|
||||||
empty: '表示する項目がありません',
|
empty: '表示する項目がありません',
|
||||||
noWorkflowsFound: 'ワークフローが見つかりませんでした。',
|
noWorkflowsFound: 'ワークフローが見つかりませんでした。',
|
||||||
comingSoon: '近日公開',
|
comingSoon: '近日公開',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
|
currentUser: 'Текущий пользователь',
|
||||||
empty: 'Пусто',
|
empty: 'Пусто',
|
||||||
noWorkflowsFound: 'Рабочие процессы не найдены.',
|
noWorkflowsFound: 'Рабочие процессы не найдены.',
|
||||||
download: 'Скачать',
|
download: 'Скачать',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
|
currentUser: '当前用户',
|
||||||
empty: '空',
|
empty: '空',
|
||||||
noWorkflowsFound: '未找到工作流',
|
noWorkflowsFound: '未找到工作流',
|
||||||
firstTimeUIMessage:
|
firstTimeUIMessage:
|
||||||
|
|||||||
Reference in New Issue
Block a user