Skip to content

Commit 4ffec85

Browse files
committed
refactor: Optimization of operation menu
--bug=1054069 --user=王孝刚 【操作日志】-操作菜单优化建议 https://www.tapd.cn/57709429/s/1677900
1 parent bd098e6 commit 4ffec85

File tree

6 files changed

+57
-23
lines changed

6 files changed

+57
-23
lines changed

apps/application/views/application_views.py

-4
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,6 @@ class SpeechToText(APIView):
644644
dynamic_tag=keywords.get(
645645
'application_id'))],
646646
compare=CompareConstants.AND))
647-
@log(menu='Application', operate="speech to text",
648-
get_operation_object=lambda r, k: get_application_operation_object(k.get('application_id')))
649647
def post(self, request: Request, application_id: str):
650648
return result.success(
651649
ApplicationSerializer.Operate(data={'application_id': application_id, 'user_id': request.user.id})
@@ -668,8 +666,6 @@ class TextToSpeech(APIView):
668666
dynamic_tag=keywords.get(
669667
'application_id'))],
670668
compare=CompareConstants.AND))
671-
@log(menu='Application', operate="text to speech",
672-
get_operation_object=lambda r, k: get_application_operation_object(k.get('application_id')))
673669
def post(self, request: Request, application_id: str):
674670
byte_data = ApplicationSerializer.Operate(
675671
data={'application_id': application_id, 'user_id': request.user.id}).text_to_speech(

apps/application/views/chat_views.py

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class Export(APIView):
6060
[lambda r, keywords: Permission(group=Group.APPLICATION, operate=Operate.USE,
6161
dynamic_tag=keywords.get('application_id'))])
6262
)
63+
@log(menu='Conversation Log', operate="Export conversation",
64+
get_operation_object=lambda r, k: get_application_operation_object(k.get('application_id')))
6365
def post(self, request: Request, application_id: str):
6466
return ChatSerializers.Query(
6567
data={**query_params_to_single_dict(request.query_params), 'application_id': application_id,

apps/locales/en_US/LC_MESSAGES/django.po

+13-4
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ msgstr ""
234234

235235
#: apps/xpack/serializers/channel/chat_manage.py:298
236236
msgid "Thinking, please wait a moment!"
237-
msgstr ""
237+
msgstr "Thinking, please wait a moment......"
238238

239239
#: apps/xpack/serializers/channel/ding_talk.py:19
240240
#: apps/xpack/serializers/channel/wechat.py:89
@@ -1210,7 +1210,7 @@ msgstr "Details"
12101210
#: apps/xpack/views/application_setting_views.py:23
12111211
#| msgid "Modification time"
12121212
msgid "Modify Application Settings"
1213-
msgstr ""
1213+
msgstr "Modify Application Display Settings"
12141214

12151215
#: apps/xpack/views/application_setting_views.py:24
12161216
#: apps/xpack/views/application_setting_views.py:40
@@ -4478,7 +4478,7 @@ msgstr ""
44784478
#: community/apps/dataset/views/dataset.py:184
44794479
#: community/apps/dataset/views/dataset.py:185
44804480
msgid "Export knowledge base containing images"
4481-
msgstr ""
4481+
msgstr "Export ZIP Knowledge Base"
44824482

44834483
#: community/apps/dataset/views/dataset.py:199
44844484
msgid "Delete knowledge base"
@@ -7448,7 +7448,7 @@ msgid "Operate Time"
74487448
msgstr "Operate time"
74497449

74507450
msgid "System Settings/API Key"
7451-
msgstr "System Settings/API Key"
7451+
msgstr "System API Key"
74527452

74537453
msgid "Appearance Settings"
74547454
msgstr "Appearance Settings"
@@ -7463,4 +7463,13 @@ msgid "Paragraph"
74637463
msgstr ""
74647464

74657465
msgid "Batch generate related"
7466+
msgstr "Paragraph generate related problems"
7467+
7468+
msgid "Application access"
7469+
msgstr ""
7470+
7471+
msgid "Add internal function"
7472+
msgstr ""
7473+
7474+
msgid "Batch generate related documents"
74667475
msgstr "Batch generate related problems"

apps/locales/zh_CN/LC_MESSAGES/django.po

+16-7
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ msgstr "AI 回复: "
234234

235235
#: apps/xpack/serializers/channel/chat_manage.py:298
236236
msgid "Thinking, please wait a moment!"
237-
msgstr "正在思考中,请稍后"
237+
msgstr "正在思考中,请稍后......"
238238

239239
#: apps/xpack/serializers/channel/ding_talk.py:19
240240
#: apps/xpack/serializers/channel/wechat.py:89
@@ -1229,7 +1229,7 @@ msgstr "详情"
12291229
#: apps/xpack/views/application_setting_views.py:23
12301230
#| msgid "Pro/Modify Application Settings"
12311231
msgid "Modify Application Settings"
1232-
msgstr "修改应用设置"
1232+
msgstr "修改应用显示设置"
12331233

12341234
#: apps/xpack/views/application_setting_views.py:24
12351235
#: apps/xpack/views/application_setting_views.py:40
@@ -4515,7 +4515,7 @@ msgstr "导出知识库"
45154515
#: community/apps/dataset/views/dataset.py:184
45164516
#: community/apps/dataset/views/dataset.py:185
45174517
msgid "Export knowledge base containing images"
4518-
msgstr "导出包含图片的知识库"
4518+
msgstr "导出ZIP知识库"
45194519

45204520
#: community/apps/dataset/views/dataset.py:199
45214521
msgid "Delete knowledge base"
@@ -4606,12 +4606,12 @@ msgstr "批量取消任务"
46064606
#: community/apps/dataset/views/document.py:279
46074607
#: community/apps/dataset/views/document.py:280
46084608
msgid "Refresh document vector library"
4609-
msgstr "刷新文档向量库"
4609+
msgstr "文档向量化"
46104610

46114611
#: community/apps/dataset/views/document.py:300
46124612
#: community/apps/dataset/views/document.py:301
46134613
msgid "Batch refresh document vector library"
4614-
msgstr "批量刷新文档向量库"
4614+
msgstr "批量文档向量化"
46154615

46164616
#: community/apps/dataset/views/document.py:319
46174617
#: community/apps/dataset/views/document.py:320
@@ -7611,7 +7611,7 @@ msgid "Operate Time"
76117611
msgstr "操作时间"
76127612

76137613
msgid "System Settings/API Key"
7614-
msgstr "系统设置/API Key"
7614+
msgstr "系统 API Key"
76157615

76167616
msgid "Appearance Settings"
76177617
msgstr "外观设置"
@@ -7626,4 +7626,13 @@ msgid "Paragraph"
76267626
msgstr "段落"
76277627

76287628
msgid "Batch generate related"
7629-
msgstr "批量生成相关问题"
7629+
msgstr "分段生成问题"
7630+
7631+
msgid "Application access"
7632+
msgstr "应用接入"
7633+
7634+
msgid "Add internal function"
7635+
msgstr "添加内部函数"
7636+
7637+
msgid "Batch generate related documents"
7638+
msgstr "批量生成问题"

apps/locales/zh_Hant/LC_MESSAGES/django.po

+16-7
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ msgstr "AI 回覆: "
235235

236236
#: apps/xpack/serializers/channel/chat_manage.py:298
237237
msgid "Thinking, please wait a moment!"
238-
msgstr "正在思考,請稍等"
238+
msgstr "正在思考中,請稍等......"
239239

240240
#: apps/xpack/serializers/channel/ding_talk.py:19
241241
#: apps/xpack/serializers/channel/wechat.py:89
@@ -1231,7 +1231,7 @@ msgstr "詳情"
12311231
#: apps/xpack/views/application_setting_views.py:23
12321232
#| msgid "Pro/Modify Application Settings"
12331233
msgid "Modify Application Settings"
1234-
msgstr "修改應用設置"
1234+
msgstr "修改應用显示設置"
12351235

12361236
#: apps/xpack/views/application_setting_views.py:24
12371237
#: apps/xpack/views/application_setting_views.py:40
@@ -4524,7 +4524,7 @@ msgstr "導出知識庫"
45244524
#: community/apps/dataset/views/dataset.py:184
45254525
#: community/apps/dataset/views/dataset.py:185
45264526
msgid "Export knowledge base containing images"
4527-
msgstr "導出包含圖片的知識庫"
4527+
msgstr "導出ZIP知識庫"
45284528

45294529
#: community/apps/dataset/views/dataset.py:199
45304530
msgid "Delete knowledge base"
@@ -4615,12 +4615,12 @@ msgstr "批量取消任務"
46154615
#: community/apps/dataset/views/document.py:279
46164616
#: community/apps/dataset/views/document.py:280
46174617
msgid "Refresh document vector library"
4618-
msgstr "刷新文檔向量庫"
4618+
msgstr "文檔向量化"
46194619

46204620
#: community/apps/dataset/views/document.py:300
46214621
#: community/apps/dataset/views/document.py:301
46224622
msgid "Batch refresh document vector library"
4623-
msgstr "批量刷新文檔向量庫"
4623+
msgstr "批量文檔向量化"
46244624

46254625
#: community/apps/dataset/views/document.py:319
46264626
#: community/apps/dataset/views/document.py:320
@@ -7621,7 +7621,7 @@ msgid "Operate Time"
76217621
msgstr "操作時間"
76227622

76237623
msgid "System Settings/API Key"
7624-
msgstr "系統設置/API Key"
7624+
msgstr "系統 API Key"
76257625

76267626
msgid "Appearance Settings"
76277627
msgstr "外觀設置"
@@ -7636,4 +7636,13 @@ msgid "Paragraph"
76367636
msgstr "段落"
76377637

76387638
msgid "Batch generate related"
7639-
msgstr "批量生成相關问题"
7639+
msgstr "分段生成问题"
7640+
7641+
msgid "Application access"
7642+
msgstr "應用接入"
7643+
7644+
msgid "Add internal function"
7645+
msgstr "添加內部函數"
7646+
7647+
msgid "Batch generate related documents"
7648+
msgstr "批量生成问题"

ui/src/views/operate-log/index.vue

+10-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,16 @@
129129
</div>
130130
</template>
131131
</el-table-column>
132-
<el-table-column prop="operate" :label="$t('views.operateLog.table.operate.detail')" />
132+
<el-table-column prop="operate" :label="$t('views.operateLog.table.operate.detail')">
133+
<template #default="{ row }">
134+
{{
135+
row.operate +
136+
(row.operation_object && row.operation_object.name
137+
? `【${row.operation_object.name}】`
138+
: '')
139+
}}
140+
</template>
141+
</el-table-column>
133142
<el-table-column
134143
width="120"
135144
prop="user.username"

0 commit comments

Comments
 (0)