Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: 优化样式 #1407

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/common/handle/impl/pdf_split_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def handle_toc(doc):
chapter_text += text # 提取文本

# 保存章节内容和章节标题
chapters.append({"title": chapter_title, "content": chapter_text})
chapters.append({"title": chapter_title, "content": chapter_text if chapter_text else chapter_title})
return chapters

@staticmethod
Expand Down
58 changes: 36 additions & 22 deletions ui/src/views/application-overview/component/LimitDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form label-position="top" ref="limitFormRef" :model="form" :rules="rules">
<el-form label-position="top" ref="limitFormRef" :model="form">
<!-- <el-form-item
:label="$t('views.applicationOverview.appInfo.LimitDialog.showSourceLabel')"
@click.prevent
Expand All @@ -21,6 +21,7 @@
:step="1"
:value-on-clear="0"
controls-position="right"
style="width: 268px"
step-strictly
/>
<span class="ml-4">{{
Expand All @@ -32,25 +33,40 @@
:label="$t('views.applicationOverview.appInfo.LimitDialog.authentication')"
v-hasPermission="new ComplexPermission([], ['x-pack'], 'OR')"
>
<el-switch size="small" v-model="form.authentication"></el-switch>
<el-switch size="small" v-model="form.authentication" @change="firstGeneration"></el-switch>
</el-form-item>
<el-form-item
prop="authentication_value"
v-if="form.authentication"
:label="$t('views.applicationOverview.appInfo.LimitDialog.authenticationValue')"
v-hasPermission="new ComplexPermission([], ['x-pack'], 'OR')"
>
<el-input
v-model="form.authentication_value"
readonly
style="width: 300px; margin-right: 10px"
></el-input>
<el-button type="primary" text @click="copyClick(form.authentication_value)">
<AppIcon iconName="app-copy"></AppIcon>
</el-button>
<el-button @click="refreshAuthentication" type="primary" text style="margin-left: 1px">
<el-icon><RefreshRight /></el-icon>
</el-button>
<el-input v-model="form.authentication_value" readonly style="width: 268px" disabled>
<template #append>
<div class="button-container">
<el-tooltip content="复制" placement="top">
<el-button
type="primary"
text
@click="copyClick(form.authentication_value)"
style="width: 24px; height: 24px"
>
<AppIcon iconName="app-copy"></AppIcon>
</el-button>
</el-tooltip>
<el-tooltip content="刷新" placement="top">
<el-button
@click="refreshAuthentication"
type="primary"
text
style="width: 24px; height: 24px; margin-left: 20px"
>
<el-icon><RefreshRight /></el-icon>
</el-button>
</el-tooltip>
</div>
</template>
</el-input>
</el-form-item>
<el-form-item
:label="$t('views.applicationOverview.appInfo.LimitDialog.whitelistLabel')"
Expand Down Expand Up @@ -88,6 +104,7 @@ import { MsgSuccess, MsgConfirm } from '@/utils/message'
import { t } from '@/locales'
import { copyClick } from '@/utils/clipboard'
import { ComplexPermission } from '@/utils/permission/type'
import { first } from 'lodash'

const route = useRoute()
const {
Expand All @@ -104,15 +121,6 @@ const form = ref<any>({
authentication_value: '',
authentication: false
})
const rules: FormRules = {
authentication_value: [
{
required: true,
message: '身份验证值不能为空',
trigger: 'blur'
}
]
}

const dialogVisible = ref<boolean>(false)
const loading = ref(false)
Expand Down Expand Up @@ -168,6 +176,12 @@ function refreshAuthentication() {
form.value.authentication_value = generateAuthenticationValue()
}

function firstGeneration() {
if (form.value.authentication && !form.value.authentication_value) {
form.value.authentication_value = generateAuthenticationValue()
}
}

defineExpose({ open })
</script>
<style lang="scss" scope></style>
Loading