Skip to content

Commit

Permalink
fixed: Fixed an issue where user information could not be seen under …
Browse files Browse the repository at this point in the history
…SSH connections
  • Loading branch information
ZhaoJiSen committed Nov 18, 2024
1 parent fbdb74e commit 537b6df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
6 changes: 5 additions & 1 deletion ui/src/components/Settings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
{{ item.title }}
</n-text>
</n-button>

<!-- 用户 -->
<n-list class="mt-[-15px]" clickable v-else-if="item.label === 'User'">
<n-list-item>
<n-thing class="ml-[15px] mt-[10px]">
Expand All @@ -24,7 +26,7 @@
<n-icon :component="item.icon" :size="18"></n-icon>
<n-text class="text-[14px]">
{{ item.title }}
{{ `(${item.content().length})` }}
{{ `(${item?.content() ? item?.content().length : 0})` }}
</n-text>
</n-flex>
</template>
Expand Down Expand Up @@ -65,6 +67,8 @@
</n-thing>
</n-list-item>
</n-list>

<!-- 快捷键 -->
<n-list class="mt-[-15px]" clickable v-else-if="item.label === 'Keyboard'">
<n-list-item>
<n-thing class="ml-[15px] mt-[10px]">
Expand Down
19 changes: 10 additions & 9 deletions ui/src/views/Connection/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,15 @@ const settings = computed((): ISettingProp[] => {
title: t('User'),
icon: PersonOutline,
disabled: () => Object.keys(onlineUsersMap).length < 1,
content: Object.values(onlineUsersMap)
.map((item: any) => {
item.name = item.user;
item.icon = item.writable ? markRaw(PersonAdd) : markRaw(LockClosedOutline);
item.tip = item.writable ? t('Writable') : t('ReadOnly');
return item;
})
.sort((a, b) => new Date(a.created).getTime() - new Date(b.created).getTime()),
content: () =>
Object.values(onlineUsersMap)
.map((item: any) => {
item.name = item.user;
item.icon = item.writable ? markRaw(PersonAdd) : markRaw(LockClosedOutline);
item.tip = item.writable ? t('Writable') : t('ReadOnly');
return item;
})
.sort((a, b) => new Date(a.created).getTime() - new Date(b.created).getTime()),
click: user => {
if (user.primary) return;
Expand Down Expand Up @@ -390,7 +391,7 @@ const onSocketData = (msgType: string, msg: any, terminal: Terminal) => {
}
};
const onEvent = (event: string, data: any) => {
const onEvent = (event: string, _data: any) => {
switch (event) {
case 'reconnect':
Object.keys(onlineUsersMap).filter(key => {
Expand Down

0 comments on commit 537b6df

Please sign in to comment.