Skip to content

Commit af8172a

Browse files
feat: resource authorization
1 parent 3f56560 commit af8172a

File tree

127 files changed

+17661
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+17661
-145
lines changed

ui/src/api/user/resource-authorization.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ import type { pageRequest } from '@/api/type/common'
44
import type { Ref } from 'vue'
55

66
const prefix = '/workspace'
7+
8+
/**
9+
* 获取成员列表
10+
* @query 参数
11+
*/
12+
const getUserList: (workspace_id: String) => Promise<Result<any>> = (workspace_id) => {
13+
return get(`${prefix}/${workspace_id}/user_list`)
14+
}
15+
716
/**
817
* 获取资源权限
918
* @query 参数
@@ -40,4 +49,5 @@ const putResourceAuthorization: (workspace_id: String, body: any) => Promise<Res
4049
export default {
4150
getResourceAuthorization,
4251
putResourceAuthorization,
52+
getUserList
4353
}

ui/src/enums/system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export enum AuthorizationEnum {
22
MANAGE = 'MANAGE',
33
USE = 'USE',
4-
DATASET = 'DATASET',
4+
KNOWLEDGE = 'KNOWLEDGE',
55
APPLICATION = 'APPLICATION'
66
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
export default {
2+
noHistory: '暂无历史记录',
3+
createChat: '新建对话',
4+
history: '历史记录',
5+
only20history: '仅显示最近 20 条对话',
6+
question_count: '条提问',
7+
exportRecords: '导出聊天记录',
8+
chatId: '对话 ID',
9+
userInput: '用户输入',
10+
quote: '引用',
11+
download: '点击下载文件',
12+
transcribing: '转文字中',
13+
passwordValidator: {
14+
title: '请输入密码打开链接',
15+
errorMessage1: '密码不能为空',
16+
errorMessage2: '密码错误'
17+
},
18+
operation: {
19+
play: '点击播放',
20+
pause: '停止',
21+
regeneration: '换个答案',
22+
like: '赞同',
23+
cancelLike: '取消赞同',
24+
oppose: '反对',
25+
cancelOppose: '取消反对',
26+
continue: '继续',
27+
stopChat: '停止回答',
28+
startChat: '开始对话'
29+
},
30+
tip: {
31+
error500Message: '抱歉,当前正在维护,无法提供服务,请稍后再试!',
32+
errorIdentifyMessage: '无法识别用户身份',
33+
errorLimitMessage: '抱歉,您的提问已达到最大限制,请明天再来吧!',
34+
answerMessage: '抱歉,没有查找到相关内容,请重新描述您的问题或提供更多信息。',
35+
stopAnswer: '已停止回答',
36+
answerLoading: '回答中',
37+
recorderTip: `<p>该功能需要使用麦克风,浏览器禁止不安全页面录音,解决方案如下:<br/>
38+
1、可开启 https 解决;<br/>
39+
2、若无 https 配置则需要修改浏览器安全配置,Chrome 设置如下:<br/>
40+
(1) 地址栏输入chrome://flags/#unsafely-treat-insecure-origin-as-secure;<br/>
41+
(2) 将 http 站点配置在文本框中,例如: http://127.0.0.1:8080。</p>`,
42+
recorderError: '录音失败',
43+
confirm: '我知道了',
44+
requiredMessage: '请填写所有必填字段',
45+
inputParamMessage1: '请在URL中填写参数',
46+
inputParamMessage2: '的值',
47+
prologueMessage: '抱歉,当前正在维护,无法提供服务,请稍后再试!'
48+
},
49+
inputPlaceholder: {
50+
speaking: '说话中',
51+
recorderLoading: '转文字中',
52+
default: '请输入问题'
53+
},
54+
uploadFile: {
55+
label: '上传文件',
56+
most: '最多',
57+
limit: '个,每个文件限制',
58+
fileType: '文件类型',
59+
tipMessage: '请在文件上传配置中选择文件类型',
60+
limitMessage1: '最多上传',
61+
limitMessage2: '个文件',
62+
sizeLimit: '单个文件大小不能超过',
63+
imageMessage: '请解析图片内容',
64+
errorMessage: '上传失败'
65+
},
66+
executionDetails: {
67+
title: '执行详情',
68+
paramOutputTooltip: '每个文档仅支持预览500字',
69+
audioFile: '语音文件',
70+
searchContent: '检索内容',
71+
searchResult: '检索结果',
72+
conditionResult: '判断结果',
73+
currentChat: '本次对话',
74+
answer: 'AI 回答',
75+
replyContent: '回复内容',
76+
textContent: '文本内容',
77+
input: '输入',
78+
output: '输出',
79+
rerankerContent: '重排内容',
80+
rerankerResult: '重排结果',
81+
paragraph: '分段',
82+
noSubmit: '用户未提交',
83+
errMessage: '错误日志'
84+
},
85+
KnowledgeSource: {
86+
title: '知识来源',
87+
referenceParagraph: '引用分段',
88+
consume: '消耗tokens',
89+
consumeTime: '耗时'
90+
},
91+
paragraphSource: {
92+
title: '知识库引用',
93+
question: '用户问题',
94+
optimizationQuestion: '优化后问题'
95+
},
96+
editTitle: '编辑标题'
97+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
quickCreatePlaceholder: '快速创建空白文档',
3+
quickCreateName: '文档名称',
4+
noData: '无匹配数据',
5+
loading: '加载中',
6+
noMore: '到底啦!',
7+
selectParagraph: {
8+
title: '选择分段',
9+
error: '仅执行未成功分段',
10+
all: '全部分段'
11+
}
12+
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import zhCn from 'element-plus/es/locale/lang/zh-cn'
2-
// import components from './components'
2+
import components from './components'
33
import views from './views'
44
import theme from './theme'
55
import layout from './layout'
66
import dynamicsForm from './dynamics-form'
77
import common from './common'
8-
// import chat from './ai-chat'
8+
import chat from './ai-chat'
99
export default {
1010
lang: '简体中文',
1111
zhCn,
@@ -14,4 +14,6 @@ export default {
1414
layout,
1515
dynamicsForm,
1616
common,
17+
chat,
18+
components,
1719
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
export default {
2+
title: '概览',
3+
appInfo: {
4+
header: '应用信息',
5+
publicAccessLink: '公开访问链接',
6+
openText: '开',
7+
closeText: '关',
8+
copyLinkText: '复制链接',
9+
refreshLinkText: '刷新链接',
10+
demo: '演示',
11+
embedInWebsite: '嵌入第三方',
12+
accessControl: '访问限制',
13+
displaySetting: '显示设置',
14+
apiAccessCredentials: 'API 访问凭据',
15+
apiKey: 'API Key',
16+
refreshToken: {
17+
msgConfirm1: '是否重新生成公开访问链接?',
18+
msgConfirm2:
19+
'重新生成公开访问链接会影响嵌入第三方脚本变更,需要将新脚本重新嵌入第三方,请谨慎操作!',
20+
refreshSuccess: '刷新成功'
21+
},
22+
23+
APIKeyDialog: {
24+
saveSettings: '保存设置',
25+
msgConfirm1: '是否删除API Key',
26+
msgConfirm2: '删除API Key后将无法恢复,请确认是否删除?',
27+
enabledSuccess: '已启用',
28+
disabledSuccess: '已禁用'
29+
},
30+
EditAvatarDialog: {
31+
title: '应用头像',
32+
customizeUpload: '自定义上传',
33+
upload: '上传',
34+
default: '默认logo',
35+
custom: '自定义',
36+
sizeTip: '建议尺寸 32*32,支持 JPG、PNG、GIF,大小不超过 10 MB',
37+
fileSizeExceeded: '文件大小超过 10 MB',
38+
uploadImagePrompt: '请上传一张图片'
39+
},
40+
EmbedDialog: {
41+
fullscreenModeTitle: '全屏模式',
42+
copyInstructions: '复制以下代码进行嵌入',
43+
floatingModeTitle: '浮窗模式',
44+
mobileModeTitle: '移动端模式'
45+
},
46+
LimitDialog: {
47+
showSourceLabel: '显示知识来源',
48+
clientQueryLimitLabel: '每个客户端提问限制',
49+
timesDays: '次/天',
50+
authentication: '身份验证',
51+
authenticationValue: '验证密码',
52+
whitelistLabel: '白名单',
53+
whitelistPlaceholder:
54+
'请输入允许嵌入第三方的源地址,一行一个,如:\nhttp://127.0.0.1:5678\nhttps://dataease.io'
55+
},
56+
SettingAPIKeyDialog: {
57+
dialogTitle: '设置',
58+
allowCrossDomainLabel: '允许跨域地址',
59+
crossDomainPlaceholder:
60+
'请输入允许的跨域地址,开启后不输入跨域地址则不限制。\n跨域地址一行一个,如:\nhttp://127.0.0.1:5678 \nhttps://dataease.io'
61+
},
62+
SettingDisplayDialog: {
63+
dialogTitle: '显示设置',
64+
languageLabel: '语言',
65+
showSourceLabel: '显示知识来源',
66+
showExecutionDetail: '显示执行详情',
67+
restoreDefault: '恢复默认',
68+
customThemeColor: '自定义主题色',
69+
headerTitleFontColor: '头部标题字体颜色',
70+
default: '默认',
71+
askUserAvatar: '提问用户头像',
72+
replace: '替换',
73+
imageMessage: '建议尺寸 32*32,支持 JPG、PNG、GIF,大小不超过 10 MB',
74+
AIAvatar: 'AI 回复头像',
75+
display: '显示',
76+
floatIcon: '浮窗入口图标',
77+
iconDefaultPosition: '图标默认位置',
78+
iconPosition: {
79+
left: '左',
80+
right: '右',
81+
bottom: '下',
82+
top: '上'
83+
},
84+
draggablePosition: '可拖拽位置',
85+
showHistory: '显示历史记录',
86+
displayGuide: '显示引导图(浮窗模式)',
87+
disclaimer: '免责声明',
88+
disclaimerValue: '「以上内容均由 AI 生成,仅供参考和借鉴」'
89+
}
90+
},
91+
monitor: {
92+
monitoringStatistics: '监控统计',
93+
customRange: '自定义范围',
94+
startDatePlaceholder: '开始时间',
95+
endDatePlaceholder: '结束时间',
96+
pastDayOptions: {
97+
past7Days: '过去7天',
98+
past30Days: '过去30天',
99+
past90Days: '过去90天',
100+
past183Days: '过去半年',
101+
other: '自定义'
102+
},
103+
charts: {
104+
customerTotal: '用户总数',
105+
customerNew: '用户新增数',
106+
queryCount: '提问次数',
107+
tokensTotal: 'Tokens 总数',
108+
userSatisfaction: '用户满意度',
109+
approval: '赞同',
110+
disapproval: '反对'
111+
}
112+
}
113+
}

0 commit comments

Comments
 (0)