Skip to content

Commit 8aae8b8

Browse files
feat: Simultaneously export the source file style(#6137)
1 parent 2f54328 commit 8aae8b8

5 files changed

Lines changed: 55 additions & 48 deletions

File tree

ui/src/locales/lang/en-US/views/document.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default {
1717
},
1818

1919
tip: {
20+
exportSimultaneously: 'Export Source Files',
21+
exportSimultaneouslyTip:
22+
'By checking this option, the original files will be packaged together with the ZIP file, allowing automatic restoration of file associations upon import; if unchecked, only the text content will be exported.',
2023
saveMessage: 'Current changes have not been saved. Confirm exit?',
2124
cancelSuccess: 'Successful',
2225
sendMessage: 'Successful',

ui/src/locales/lang/zh-CN/views/document.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export default {
1717
replace: '替换原文档',
1818
},
1919
tip: {
20+
exportSimultaneously: '同时导出源文件',
21+
exportSimultaneouslyTip:'勾选后将原始文件一并打包至ZIP,导入时可自动恢复文件关联;不勾选则仅导出文本内容。',
2022
saveMessage: '当前的更改尚未保存,确认退出吗?',
2123
cancelSuccess: '批量取消成功',
2224
sendMessage: '发送成功',

ui/src/locales/lang/zh-Hant/views/document.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default {
1616
replace: '替換原文件',
1717
},
1818
tip: {
19+
exportSimultaneously: '同時匯出源文件',
20+
exportSimultaneouslyTip:
21+
'勾選後將原始文件一併打包至ZIP,匯入時可自動恢復文件關聯;不勾選則僅匯出文本內容。',
1922
saveMessage: '當前的更改尚未保存,確認退出嗎?',
2023
cancelSuccess: '批量取消成功',
2124
sendMessage: '發送成功',

ui/src/views/knowledge/component/ExportKnowledgeDialog.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<template>
22
<el-dialog
33
v-model="dialogVisible"
4-
:title="$t('components.selectParagraph.title')"
4+
:title="$t('views.document.setting.exportKnowledge')"
55
:before-close="close"
66
width="450"
77
>
8-
<el-checkbox v-model="with_source_file" label="同时导出源文件"/>
9-
<div>
10-
勾选后将原始文件一并打包至ZIP,导入时可自动恢复文件关联;不勾选则仅导出文本内容
11-
</div>
8+
<el-checkbox v-model="with_source_file" style="align-items: start; min-height: 60px;">
9+
<p class="bold mb-8">同时导出源文件</p>
10+
<p class="color-secondary pre-wrap line-height-22">勾选后将原始文件一并打包至ZIP,导入时可自动恢复文件关联;不勾选则仅导出文本内容。</p>
11+
</el-checkbox>
12+
1213
<template #footer>
1314
<div class="dialog-footer">
1415
<el-button @click="close">{{ $t('common.cancel') }} </el-button>
15-
<el-button type="primary" @click="submit"> {{ $t('common.submit') }} </el-button>
16+
<el-button type="primary" @click="submit"> {{ $t('common.confirm') }} </el-button>
1617
</div>
1718
</template>
1819
</el-dialog>

ui/src/views/system-setting/authentication/component/OIDC.vue

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
/>
3838
</el-form-item>
3939
<el-form-item label="Scope" prop="config.scope">
40-
<el-input v-model="form.config.scope" placeholder="openid+profile+email "/>
40+
<el-input v-model="form.config.scope" placeholder="openid+profile+email " />
4141
</el-form-item>
4242
<el-form-item label="State" prop="config.state">
43-
<el-input v-model="form.config.state" placeholder=""/>
43+
<el-input v-model="form.config.state" placeholder="" />
4444
</el-form-item>
4545
<el-form-item
4646
:label="$t('views.system.authentication.oidc.clientId')"
@@ -81,18 +81,19 @@
8181
</el-form-item>
8282
<el-form-item>
8383
<el-checkbox v-model="form.is_active"
84-
>{{ $t('views.system.authentication.oidc.enableAuthentication') }}
84+
>{{ $t('views.system.authentication.oidc.enableAuthentication') }}
8585
</el-checkbox>
8686
</el-form-item>
8787
</el-form>
8888

8989
<div>
90-
<el-button @click="submit(authFormRef)" type="primary" :disabled="loading"
91-
v-hasPermission="
92-
new ComplexPermission(
93-
[RoleConst.ADMIN],
94-
[PermissionConst.LOGIN_AUTH_EDIT],
95-
[],'OR',)"
90+
<el-button
91+
@click="submit(authFormRef)"
92+
type="primary"
93+
:disabled="loading"
94+
v-hasPermission="
95+
new ComplexPermission([RoleConst.ADMIN], [PermissionConst.LOGIN_AUTH_EDIT], [], 'OR')
96+
"
9697
>
9798
{{ $t('common.save') }}
9899
</el-button>
@@ -102,13 +103,13 @@
102103
</div>
103104
</template>
104105
<script setup lang="ts">
105-
import {reactive, ref, watch, onMounted} from 'vue'
106+
import { reactive, ref, watch, onMounted } from 'vue'
106107
import authApi from '@/api/system-settings/auth-setting'
107-
import type {FormInstance, FormRules} from 'element-plus'
108-
import {t} from '@/locales'
109-
import {MsgSuccess} from '@/utils/message'
110-
import {PermissionConst, RoleConst} from '@/utils/permission/data'
111-
import {ComplexPermission} from '@/utils/permission/type'
108+
import type { FormInstance, FormRules } from 'element-plus'
109+
import { t } from '@/locales'
110+
import { MsgSuccess } from '@/utils/message'
111+
import { PermissionConst, RoleConst } from '@/utils/permission/data'
112+
import { ComplexPermission } from '@/utils/permission/type'
112113
113114
const form = ref<any>({
114115
id: '',
@@ -122,9 +123,9 @@ const form = ref<any>({
122123
clientId: '',
123124
clientSecret: '',
124125
fieldMapping: '{"username": "preferred_username", "email": "email"}',
125-
redirectUrl: ''
126+
redirectUrl: '',
126127
},
127-
is_active: true
128+
is_active: true,
128129
})
129130
130131
const authFormRef = ref()
@@ -136,65 +137,65 @@ const rules = reactive<FormRules<any>>({
136137
{
137138
required: true,
138139
message: t('views.system.authentication.oidc.authEndpointPlaceholder'),
139-
trigger: 'blur'
140-
}
140+
trigger: 'blur',
141+
},
141142
],
142143
'config.tokenEndpoint': [
143144
{
144145
required: true,
145146
message: t('views.system.authentication.oidc.tokenEndpointPlaceholder'),
146-
trigger: 'blur'
147-
}
147+
trigger: 'blur',
148+
},
148149
],
149150
'config.userInfoEndpoint': [
150151
{
151152
required: true,
152153
message: t('views.system.authentication.oidc.userInfoEndpointPlaceholder'),
153-
trigger: 'blur'
154-
}
154+
trigger: 'blur',
155+
},
155156
],
156157
'config.scope': [
157158
{
158159
required: true,
159160
message: t('views.system.authentication.oidc.scopePlaceholder'),
160-
trigger: 'blur'
161-
}
161+
trigger: 'blur',
162+
},
162163
],
163164
'config.clientId': [
164165
{
165166
required: true,
166167
message: t('views.system.authentication.oidc.clientIdPlaceholder'),
167-
trigger: 'blur'
168-
}
168+
trigger: 'blur',
169+
},
169170
],
170171
'config.clientSecret': [
171172
{
172173
required: true,
173174
message: t('views.system.authentication.oidc.clientSecretPlaceholder'),
174-
trigger: 'blur'
175-
}
175+
trigger: 'blur',
176+
},
176177
],
177178
'config.fieldMapping': [
178179
{
179180
required: true,
180181
message: t('views.system.authentication.oauth2.filedMappingPlaceholder'),
181-
trigger: 'blur'
182-
}
182+
trigger: 'blur',
183+
},
183184
],
184185
'config.redirectUrl': [
185186
{
186187
required: true,
187188
message: t('views.system.authentication.oidc.redirectUrlPlaceholder'),
188-
trigger: 'blur'
189-
}
189+
trigger: 'blur',
190+
},
190191
],
191192
'config.logoutEndpoint': [
192193
{
193194
required: true,
194195
message: t('views.system.authentication.oidc.logoutEndpointPlaceholder'),
195-
trigger: 'blur'
196-
}
197-
]
196+
trigger: 'blur',
197+
},
198+
],
198199
})
199200
200201
const submit = async (formEl: FormInstance | undefined, test?: string) => {
@@ -212,16 +213,13 @@ function getDetail() {
212213
authApi.getAuthSetting(form.value.auth_type, loading).then((res: any) => {
213214
if (res.data && JSON.stringify(res.data) !== '{}') {
214215
form.value = res.data
215-
if (
216-
form.value.config.fieldMapping === '' ||
217-
form.value.config.fieldMapping === undefined
218-
) {
216+
if (form.value.config.fieldMapping === '' || form.value.config.fieldMapping === undefined) {
219217
form.value.config.fieldMapping = '{"username": "preferred_username", "email": "email"}'
220218
}
221219
}
222220
if (!form.value.config.redirectUrl) {
223-
form.value.config.redirectUrl = window.location.origin + window.MaxKB.prefix + '/api/oidc'
224-
}
221+
form.value.config.redirectUrl = window.location.origin + window.MaxKB.prefix + '/api/oidc'
222+
}
225223
})
226224
}
227225

0 commit comments

Comments
 (0)