mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 22:09:55 +00:00
Add current user message in settings dialog (#1740)
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
:value="category.label"
|
||||
>
|
||||
<template #header>
|
||||
<CurrentUserMessage v-if="tabValue === 'Comfy'" />
|
||||
<FirstTimeUIMessage v-if="tabValue === 'Comfy'" />
|
||||
</template>
|
||||
<SettingsPanel :settingGroups="sortedGroups(category)" />
|
||||
@@ -74,6 +75,7 @@ import SettingsPanel from './setting/SettingsPanel.vue'
|
||||
import PanelTemplate from './setting/PanelTemplate.vue'
|
||||
import AboutPanel from './setting/AboutPanel.vue'
|
||||
import FirstTimeUIMessage from './setting/FirstTimeUIMessage.vue'
|
||||
import CurrentUserMessage from './setting/CurrentUserMessage.vue'
|
||||
import { flattenTree } from '@/utils/treeUtil'
|
||||
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>
|
||||
<Message
|
||||
v-if="show"
|
||||
class="first-time-ui-message m-2"
|
||||
class="first-time-ui-message"
|
||||
severity="info"
|
||||
:closable="true"
|
||||
@close="handleClose"
|
||||
|
||||
@@ -88,6 +88,7 @@ export default {
|
||||
revertChanges: 'Revert Changes',
|
||||
restart: 'Restart'
|
||||
},
|
||||
currentUser: 'Current user',
|
||||
empty: 'Empty',
|
||||
noWorkflowsFound: 'No workflows found.',
|
||||
comingSoon: 'Coming Soon',
|
||||
|
||||
@@ -81,6 +81,7 @@ export default {
|
||||
revertChanges: '変更を元に戻す',
|
||||
restart: '再起動'
|
||||
},
|
||||
currentUser: '現在のユーザー',
|
||||
empty: '表示する項目がありません',
|
||||
noWorkflowsFound: 'ワークフローが見つかりませんでした。',
|
||||
comingSoon: '近日公開',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export default {
|
||||
currentUser: 'Текущий пользователь',
|
||||
empty: 'Пусто',
|
||||
noWorkflowsFound: 'Рабочие процессы не найдены.',
|
||||
download: 'Скачать',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export default {
|
||||
currentUser: '当前用户',
|
||||
empty: '空',
|
||||
noWorkflowsFound: '未找到工作流',
|
||||
firstTimeUIMessage:
|
||||
|
||||
Reference in New Issue
Block a user