Skip to content

Commit c17dfed

Browse files
fix: workspace
1 parent acb00e9 commit c17dfed

File tree

5 files changed

+20
-48
lines changed

5 files changed

+20
-48
lines changed

ui/src/layout/layout-header/workspace-dropdown/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async function getWorkspaceList() {
5555
5656
onBeforeMount(async () => {
5757
await getWorkspaceList()
58-
const id = user.getWorkspaceId() ?? 'default'
58+
const id = localStorage.getItem('workspace_id') ?? 'default'
5959
currentWorkspace.value = workspaceList.value.find((item) => item.id === id)
6060
})
6161

ui/src/stores/modules/user.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const useUserStore = defineStore('user', {
3232
license_is_valid: false,
3333
edition: 'CE',
3434
themeInfo: null,
35-
workspace_id: 'default',
35+
workspace_id: '',
3636
}),
3737
actions: {
3838
getLanguage() {
@@ -53,14 +53,8 @@ const useUserStore = defineStore('user', {
5353
localStorage.setItem('workspace_id', workspace_id)
5454
},
5555
getWorkspaceId(): string | null {
56-
if (this.workspace_id) {
57-
return this.workspace_id
58-
}
59-
const workspace_id = localStorage.getItem('workspace_id')
60-
if (workspace_id) {
61-
this.workspace_id = workspace_id
62-
}
63-
return workspace_id
56+
this.workspace_id = this.workspace_id || localStorage.getItem('workspace_id') || 'default'
57+
return this.workspace_id
6458
},
6559

6660
getPermissions() {

ui/src/views/document/component/SelectKnowledgeDialog.vue

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,14 @@
88
:close-on-press-escape="false"
99
>
1010
<template #header="{ titleId, titleClass }">
11-
<div class="my-header flex">
12-
<h4 :id="titleId" :class="titleClass">{{ $t('views.chatLog.selectKnowledge') }}</h4>
13-
<el-button link class="ml-16" @click="refresh">
14-
<el-icon class="mr-4"><Refresh /></el-icon>{{ $t('common.refresh') }}
15-
</el-button>
16-
</div>
11+
<h4 :id="titleId" :class="titleClass">{{ $t('views.chatLog.selectKnowledge') }}</h4>
1712
</template>
18-
<div class="content-height">
19-
<el-radio-group v-model="selectKnowledge" class="card__radio">
20-
<el-scrollbar height="500">
21-
<div class="p-16">
22-
<el-row :gutter="12" v-loading="loading">
23-
<el-col :span="12" v-for="(item, index) in knowledgeList" :key="index" class="mb-16">
24-
<el-card shadow="never" :class="item.id === selectKnowledge ? 'active' : ''">
25-
<el-radio :value="item.id" size="large">
26-
<div class="flex align-center">
27-
<KnowledgeIcon :type="item.type" class="mr-12" />
2813

29-
<span class="ellipsis" :title="item.name">
30-
{{ item.name }}
31-
</span>
32-
</div>
33-
</el-radio>
34-
</el-card>
35-
</el-col>
36-
</el-row>
37-
</div>
38-
</el-scrollbar>
39-
</el-radio-group>
40-
</div>
14+
<el-tree-select v-model="selectKnowledge" :data="knowledgeList" style="width: 240px">
15+
<template #default="{ data: { label } }">
16+
{{ label }}<span style="color: gray">(suffix)</span>
17+
</template>
18+
</el-tree-select>
4119
<template #footer>
4220
<span class="dialog-footer">
4321
<el-button @click.prevent="dialogVisible = false"> {{ $t('common.cancel') }} </el-button>

ui/src/views/resource-authorization/component/PermissionSetting.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@
2020
>
2121
<img :src="row?.icon" alt="" />
2222
</el-avatar>
23-
24-
<LogoIcon
25-
v-if="isApplication"
26-
height="28px"
27-
style="width: 28px; height: 28px; display: block"
28-
class="mr-12"
29-
/>
3023
<el-avatar
3124
v-else-if="row.isFolder"
3225
class="mr-12"
@@ -40,11 +33,18 @@
4033
alt=""
4134
/>
4235
</el-avatar>
36+
<LogoIcon
37+
v-else-if="isApplication"
38+
height="28px"
39+
style="width: 28px; height: 28px; display: block"
40+
class="mr-12"
41+
/>
42+
4343
<KnowledgeIcon class="mr-12" :size="20" v-else-if="isKnowledge" :type="row.icon" />
4444

45-
<auto-tooltip :content="row?.name">
45+
<span :title="row?.name">
4646
{{ row?.name }}
47-
</auto-tooltip>
47+
</span>
4848
</div>
4949
</template>
5050
</el-table-column>

ui/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default defineConfig(({ mode }) => {
1717
const prefix = process.env.VITE_DYNAMIC_PREFIX || ENV.VITE_BASE_PATH
1818
const proxyConf: Record<string, string | ProxyOptions> = {}
1919
proxyConf['/api'] = {
20-
target: 'http://127.0.0.1:8080',
20+
target: 'http://43.166.1.146:8080/',
2121
changeOrigin: true,
2222
rewrite: (path: string) => path.replace(ENV.VITE_BASE_PATH, '/'),
2323
}

0 commit comments

Comments
 (0)