Skip to content

Commit 636f961

Browse files
feat: document
1 parent a4b6570 commit 636f961

File tree

6 files changed

+111
-25
lines changed

6 files changed

+111
-25
lines changed
Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
11
import { h } from 'vue'
2-
export default {}
2+
export default {
3+
'app-go': {
4+
iconReader: () => {
5+
return h('i', [
6+
h(
7+
'svg',
8+
{
9+
style: { height: '100%', width: '100%' },
10+
viewBox: '0 0 16 16',
11+
version: '1.1',
12+
xmlns: 'http://www.w3.org/2000/svg',
13+
},
14+
[
15+
h('path', {
16+
d: 'M2.66671 4.66665V13.3333H13.3334V8.66665H14.6667V14C14.6667 14.3682 14.3682 14.6666 14 14.6666H2.00004C1.63185 14.6666 1.33337 14.3682 1.33337 14V3.99998C1.33337 3.63179 1.63185 3.33331 2.00004 3.33331H7.33337V4.66665H2.66671Z',
17+
fill: 'currentColor',
18+
}),
19+
h('path', {
20+
d: 'M14.6665 1.99998V6.66665H13.3332V3.60931L9.34987 7.59265C9.28736 7.65514 9.20259 7.69024 9.11421 7.69024C9.02582 7.69024 8.94105 7.65514 8.87854 7.59265L8.40721 7.12131C8.34472 7.0588 8.30961 6.97403 8.30961 6.88565C8.30961 6.79726 8.34472 6.71249 8.40721 6.64998L12.3905 2.66665H9.33321V1.33331H13.9999C14.1767 1.33331 14.3463 1.40355 14.4713 1.52858C14.5963 1.6536 14.6665 1.82317 14.6665 1.99998Z',
21+
fill: 'currentColor',
22+
}),
23+
],
24+
),
25+
])
26+
},
27+
},
28+
}

ui/src/layout/layout-header/avatar/index.vue

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,34 @@
1212

1313
<template #dropdown>
1414
<el-dropdown-menu class="avatar-dropdown">
15-
<div class="userInfo">
16-
<p class="bold mb-4" style="font-size: 14px">{{ user.userInfo?.username }}</p>
17-
<p>
18-
<el-text type="info">
19-
{{ user.userInfo?.email }}
20-
</el-text>
21-
</p>
15+
<div class="userInfo flex align-center">
16+
<div class="mr-12 flex align-center">
17+
<el-avatar :size="30">
18+
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
19+
</el-avatar>
20+
</div>
21+
<div style="width: 90%">
22+
<p class="bold mb-4" style="font-size: 14px">{{ user.userInfo?.username }}</p>
23+
<template
24+
v-for="item in user.userInfo?.role"
25+
v-if="user.userInfo?.role && user.userInfo.role.length > 0"
26+
>
27+
<el-tag size="small" class="default-tag">{{ user.userInfo?.role[0] }}</el-tag>
28+
<el-tag size="small" class="default-tag ml-4" v-if="user.userInfo?.role?.length > 1"
29+
>+{{ user.userInfo?.role?.length - 1 }}</el-tag
30+
>
31+
</template>
32+
</div>
2233
</div>
2334
<el-dropdown-item class="border-t p-8" @click="openResetPassword">
2435
{{ $t('views.login.resetPassword') }}
2536
</el-dropdown-item>
2637
<div v-hasPermission="new ComplexPermission([], ['x-pack'], 'OR')">
27-
<el-dropdown-item class="border-t p-8" @click="openAPIKeyDialog">
38+
<el-dropdown-item class="p-8" @click="openAPIKeyDialog">
2839
{{ $t('layout.apiKey') }}
2940
</el-dropdown-item>
3041
</div>
31-
<el-dropdown-item class="border-t" style="padding: 0" @click.stop>
42+
<el-dropdown-item style="padding: 0" @click.stop>
3243
<el-dropdown class="w-full" trigger="hover" placement="left-start">
3344
<div class="flex-between w-full" style="line-height: 22px; padding: 12px 11px">
3445
<span> {{ $t('layout.language') }}</span>
@@ -59,10 +70,17 @@
5970
</template>
6071
</el-dropdown>
6172
</el-dropdown-item>
62-
<el-dropdown-item class="border-t" @click="openAbout">
73+
<el-dropdown-item @click="openAbout">
6374
{{ $t('layout.about.title') }}
6475
</el-dropdown-item>
6576

77+
<el-dropdown-item @click="router.push({ path: `/system/user` })">
78+
<div class="flex-between w-full">
79+
{{ $t('views.system.title') }}
80+
<AppIcon iconName="app-go"></AppIcon>
81+
</div>
82+
</el-dropdown-item>
83+
6684
<el-dropdown-item class="border-t" @click="logout">
6785
{{ $t('layout.logout') }}
6886
</el-dropdown-item>

ui/src/locales/lang/zh-CN/layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default {
22
github: '项目地址',
33
wiki: '用户手册',
44
forum: '论坛求助',
5-
logout: '退出',
5+
logout: '退出登录',
66
apiKey: 'API Key 管理',
77
apiServiceAddress: 'API 服务地址',
88
language: '语言',

ui/src/locales/lang/zh-Hant/layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default {
22
github: '項目地址',
33
wiki: '使用者手冊',
44
forum: '論壇求助',
5-
logout: '退出',
5+
logout: '登出',
66

77
apiKey: 'API Key 管理',
88
apiServiceAddress: 'API 服務地址',

ui/src/styles/app.scss

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,46 @@ h5 {
410410
}
411411
}
412412

413+
/* tag */
414+
.default-tag {
415+
background: var(--el-color-primary-light-8);
416+
color: var(--el-color-primary);
417+
border: none;
418+
}
419+
.danger-tag {
420+
background: var(--tag-danger-bg);
421+
color: #d03f3b;
422+
border: none;
423+
}
424+
.success-tag {
425+
background: var(--tag-success-bg);
426+
color: var(--el-color-success);
427+
border: none;
428+
}
429+
.warning-tag {
430+
background: var(--tag-warning-bg);
431+
color: var(--el-color-warning);
432+
border: none;
433+
}
434+
435+
.info-tag {
436+
background: var(--app-text-color-light-1);
437+
color: var(--app-text-color-secondary);
438+
border: none;
439+
}
440+
441+
.purple-tag {
442+
background: #f2ebfe;
443+
color: #7f3bf5;
444+
border-color: #e0d7f0;
445+
}
446+
447+
.blue-tag {
448+
background: #ebf1ff;
449+
color: #3370ff;
450+
border-color: #d6e2ff;
451+
}
452+
413453
/*
414454
内容部分 自适应高度
415455
*/

ui/src/views/document/index.vue

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325
{{ datetimeFormat(row.update_time) }}
326326
</template>
327327
</el-table-column>
328-
<el-table-column :label="$t('common.operation')" align="left" width="110" fixed="right">
328+
<el-table-column :label="$t('common.operation')" align="left" width="160" fixed="right">
329329
<template #default="{ row }">
330330
<span @click.stop>
331331
<el-switch
@@ -336,14 +336,16 @@
336336
/>
337337
</span>
338338
<el-divider direction="vertical" />
339-
<div v-if="datasetDetail.type === 0">
340-
<span class="mr-4">
339+
<template v-if="datasetDetail.type === 0">
340+
<span
341+
class="mr-4"
342+
v-if="
343+
([State.STARTED, State.PENDING] as Array<string>).includes(
344+
getTaskState(row.status, TaskType.EMBEDDING),
345+
)
346+
"
347+
>
341348
<el-button
342-
v-if="
343-
([State.STARTED, State.PENDING] as Array<string>).includes(
344-
getTaskState(row.status, TaskType.EMBEDDING),
345-
)
346-
"
347349
type="primary"
348350
text
349351
@click.stop="cancelTask(row, TaskType.EMBEDDING)"
@@ -352,7 +354,7 @@
352354
<AppIcon iconName="app-close" style="font-size: 16px"></AppIcon>
353355
</el-button>
354356
</span>
355-
<span class="mr-4">
357+
<span class="mr-4" v-else>
356358
<el-button
357359
type="primary"
358360
text
@@ -413,8 +415,8 @@
413415
</template>
414416
</el-dropdown>
415417
</span>
416-
</div>
417-
<div v-if="datasetDetail.type === 1 || datasetDetail.type === 2">
418+
</template>
419+
<template v-if="datasetDetail.type === 1 || datasetDetail.type === 2">
418420
<span class="mr-4">
419421
<el-button
420422
type="primary"
@@ -495,7 +497,7 @@
495497
</template>
496498
</el-dropdown>
497499
</span>
498-
</div>
500+
</template>
499501
</template>
500502
</el-table-column>
501503
</app-table>

0 commit comments

Comments
 (0)