feat(系统设置): 文件大小限制
This commit is contained in:
parent
c113036641
commit
d676e5d3eb
|
@ -52,6 +52,7 @@
|
|||
onBeforeMount(async () => {
|
||||
try {
|
||||
appStore.initSystemVersion(); // 初始化系统版本
|
||||
appStore.initFileSizeLimit(); // 初始化文件大小限制
|
||||
// 企业版才校验license
|
||||
if (appStore.getPackageType === 'enterprise') {
|
||||
licenseStore.getValidateLicense();
|
||||
|
|
|
@ -2,6 +2,7 @@ import MSR from '@/api/http/index';
|
|||
import {
|
||||
AddAuthUrl,
|
||||
DeleteAuthUrl,
|
||||
EditUploadConfigUrl,
|
||||
GetAuthDetailByTypeUrl,
|
||||
GetAuthDetailUrl,
|
||||
GetAuthListUrl,
|
||||
|
@ -54,7 +55,7 @@ export function saveBaseUrl(baseUrl: string) {
|
|||
|
||||
// 获取基础信息
|
||||
export function getBaseInfo() {
|
||||
return MSR.get<BaseConfig>({ url: GetBaseInfoUrl });
|
||||
return MSR.get<BaseConfig>({ url: GetBaseInfoUrl }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 保存邮箱信息
|
||||
|
@ -131,3 +132,8 @@ export function saveCleanupConfig(data: SaveInfoParams) {
|
|||
export function getCleanupConfig() {
|
||||
return MSR.get<CleanupConfig>({ url: GetCleanConfigUrl });
|
||||
}
|
||||
|
||||
// 保存内存清理配置
|
||||
export function saveUploadConfig(data: SaveInfoParams) {
|
||||
return MSR.post({ url: EditUploadConfigUrl, data });
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@ export const TestLdapLoginUrl = '/system/authsource/ldap/test-login';
|
|||
export const SaveCleanConfigUrl = '/system/parameter/edit/clean-config';
|
||||
// 获取内存清理配置
|
||||
export const GetCleanConfigUrl = '/system/parameter/get/clean-config';
|
||||
// 设置上传配置
|
||||
export const EditUploadConfigUrl = '/system/parameter/edit/upload-config';
|
||||
|
||||
// 获取系统主页左上角图片
|
||||
export const GetTitleImgUrl = `${import.meta.env.VITE_API_BASE_URL}/base-display/get/logo-platform`;
|
||||
|
|
|
@ -374,7 +374,7 @@
|
|||
.arco-input-number-step-button {
|
||||
@apply !bg-white;
|
||||
|
||||
border: 1px solid var(--color-text-input-border);
|
||||
border: 1px solid var(--color-text-n8) !important;
|
||||
border-radius: var(--border-radius-small) !important;
|
||||
.btn-outline-sec-hover();
|
||||
.btn-outline-sec-active();
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
</a-dropdown>
|
||||
</div>
|
||||
<div v-if="!props.onlyButton" class="!hover:bg-[rgb(var(--primary-1))] !text-[var(--color-text-4)]">
|
||||
{{ t('system.orgTemplate.addAttachmentTip') }}
|
||||
{{ t('system.orgTemplate.addAttachmentTip', { size: appStore.getFileMaxSize }) }}
|
||||
</div>
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
@ -238,6 +238,7 @@
|
|||
import { getAssociatedFileListUrl } from '@/api/modules/case-management/featureCase';
|
||||
import { getModules, getModulesCount } from '@/api/modules/project-management/fileManagement';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
|
||||
import { AssociatedList } from '@/models/caseManagement/featureCase';
|
||||
|
@ -280,6 +281,7 @@
|
|||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const appStore = useAppStore();
|
||||
|
||||
const fileList = defineModel<MsFileItem[]>('fileList', {
|
||||
// TODO:这里的文件含有组件内部定义的属性,应该继承MsFileItem类型并扩展声明组件定义的类型属性
|
||||
|
|
|
@ -203,8 +203,8 @@
|
|||
{
|
||||
data: {
|
||||
id: 'fakeNode',
|
||||
text: 'fakeNode',
|
||||
resource: ['fakeNode'],
|
||||
text: '...',
|
||||
resource: [''],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
@ -194,8 +194,8 @@
|
|||
{
|
||||
data: {
|
||||
id: 'fakeNode',
|
||||
text: 'fakeNode',
|
||||
resource: ['fakeNode'],
|
||||
text: '...',
|
||||
resource: [''],
|
||||
isNew: false,
|
||||
changed: false,
|
||||
},
|
||||
|
|
|
@ -315,8 +315,8 @@
|
|||
{
|
||||
data: {
|
||||
id: 'fakeNode',
|
||||
text: 'fakeNode',
|
||||
resource: ['fakeNode'],
|
||||
text: '...',
|
||||
resource: [''],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
{{
|
||||
t(props.subText || 'ms.upload.importModalFileTip', {
|
||||
type: UploadAcceptEnum[props.accept],
|
||||
size: props.maxSize || defaultMaxSize,
|
||||
size: props.maxSize || appStore.getFileMaxSize,
|
||||
})
|
||||
}}
|
||||
</slot>
|
||||
|
@ -69,6 +69,7 @@
|
|||
import { FileIconMap, getFileEnum, getFileIcon } from '@/components/pure/ms-upload/iconMap';
|
||||
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import { formatFileSize } from '@/utils';
|
||||
|
||||
import { UploadAcceptEnum, UploadStatus } from '@/enums/uploadEnum';
|
||||
|
@ -111,7 +112,7 @@
|
|||
|
||||
const emit = defineEmits(['update:fileList', 'change']);
|
||||
|
||||
const defaultMaxSize = 50;
|
||||
const appStore = useAppStore();
|
||||
|
||||
const innerFileList = defineModel<MsFileItem[]>('fileList', {
|
||||
default: () => [],
|
||||
|
@ -137,7 +138,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
const maxSize = props.maxSize || defaultMaxSize;
|
||||
const maxSize = props.maxSize || appStore.getFileMaxSize;
|
||||
const _maxSize = props.sizeUnit === 'MB' ? maxSize * 1024 * 1024 : maxSize * 1024;
|
||||
if (props.isLimit && file.size > _maxSize) {
|
||||
Message.warning(t('ms.upload.overSize'));
|
||||
|
|
|
@ -6,6 +6,7 @@ import { Recordable } from '#/global';
|
|||
export interface BaseConfig {
|
||||
url: string;
|
||||
prometheusHost: string;
|
||||
fileMaxSize: string;
|
||||
}
|
||||
|
||||
// 邮箱信息配置
|
||||
|
|
|
@ -7,7 +7,7 @@ import type { BreadcrumbItem } from '@/components/business/ms-breadcrumb/types';
|
|||
import { getEnvironment, getEnvList } from '@/api/modules/api-test/common';
|
||||
import { getProjectInfo } from '@/api/modules/project-management/basicInfo';
|
||||
import { getProjectList } from '@/api/modules/project-management/project';
|
||||
import { getPageConfig } from '@/api/modules/setting/config';
|
||||
import { getBaseInfo, getPageConfig } from '@/api/modules/setting/config';
|
||||
import { getPackageType, getSystemVersion } from '@/api/modules/system';
|
||||
import { getMenuList } from '@/api/modules/user';
|
||||
import defaultSettings from '@/config/settings.json';
|
||||
|
@ -71,6 +71,7 @@ const useAppStore = defineStore('app', {
|
|||
ordList: [],
|
||||
envList: [],
|
||||
currentEnvConfig: undefined,
|
||||
fileMaxSize: 50,
|
||||
}),
|
||||
|
||||
getters: {
|
||||
|
@ -120,6 +121,9 @@ const useAppStore = defineStore('app', {
|
|||
getPackageType(state: AppState): string {
|
||||
return state.packageType;
|
||||
},
|
||||
getFileMaxSize(state: AppState): number {
|
||||
return state.fileMaxSize;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
|
@ -401,6 +405,18 @@ const useAppStore = defineStore('app', {
|
|||
console.log(error);
|
||||
}
|
||||
},
|
||||
async initFileSizeLimit() {
|
||||
try {
|
||||
const res = await getBaseInfo();
|
||||
this.fileMaxSize = Number(res.fileMaxSize) || 50;
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
setFileMaxSize(size: number) {
|
||||
this.fileMaxSize = size;
|
||||
},
|
||||
},
|
||||
persist: {
|
||||
paths: ['currentOrgId', 'currentProjectId', 'pageConfig', 'menuCollapse'],
|
||||
|
|
|
@ -45,6 +45,7 @@ export interface AppState {
|
|||
ordList: { id: string; name: string }[];
|
||||
envList: EnvironmentItem[];
|
||||
currentEnvConfig?: EnvConfig; // 当前环境配置信息
|
||||
fileMaxSize: number;
|
||||
}
|
||||
|
||||
export interface UploadFileTaskState {
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
<span class="text-[rgb(var(--warning-6))]" @click.stop="openLink">
|
||||
{{ t('apiTestManagement.importSwaggerFileTip2') }}
|
||||
</span>
|
||||
{{ t('apiTestManagement.importSwaggerFileTip3') }}
|
||||
{{ t('apiTestManagement.importSwaggerFileTip3', { size: appStore.getFileMaxSize }) }}
|
||||
</div>
|
||||
<div v-else-if="importForm.platform === RequestImportFormat.Postman" class="flex">
|
||||
{{ t('apiTestManagement.importPostmanFileTip') }}
|
||||
|
|
|
@ -87,7 +87,7 @@ export default {
|
|||
'apiTestManagement.syncUpdateDirectory': 'Sync Update API Directory',
|
||||
'apiTestManagement.importSwaggerFileTip1': 'Supports Swagger 3.0 version JSON files,',
|
||||
'apiTestManagement.importSwaggerFileTip2': '2.0 files can be converted to 3.0 on the official website',
|
||||
'apiTestManagement.importSwaggerFileTip3': 'with a size limit of 50MB',
|
||||
'apiTestManagement.importSwaggerFileTip3': 'with a size limit of {size}MB',
|
||||
'apiTestManagement.importPostmanFileTip':
|
||||
'Postman only supports file import, and only supports json files in v2.1 format',
|
||||
'apiTestManagement.urlImportPlaceholder': 'Please enter OpenAPI/URL',
|
||||
|
|
|
@ -83,7 +83,7 @@ export default {
|
|||
'apiTestManagement.syncUpdateDirectory': '同步更新接口所在目录',
|
||||
'apiTestManagement.importSwaggerFileTip1': '支持 Swagger 3.0 版本的 json 文件,',
|
||||
'apiTestManagement.importSwaggerFileTip2': '2.0 文件可以在官网一键转换 3.0',
|
||||
'apiTestManagement.importSwaggerFileTip3': ',大小不超过 50M',
|
||||
'apiTestManagement.importSwaggerFileTip3': ',大小不超过 {size}M',
|
||||
'apiTestManagement.importPostmanFileTip': 'Postman仅支持文件导入,且只支持v2.1格式的json文件',
|
||||
'apiTestManagement.urlImportPlaceholder': '请输入OpenAPI/URL',
|
||||
'apiTestManagement.swaggerURLRequired': 'SwaggerURL 不能为空',
|
||||
|
|
|
@ -184,7 +184,6 @@
|
|||
multiple
|
||||
draggable
|
||||
size-unit="MB"
|
||||
:max-size="50"
|
||||
:is-all-screen="true"
|
||||
class="mb-[16px]"
|
||||
/>
|
||||
|
|
|
@ -165,7 +165,6 @@
|
|||
multiple
|
||||
draggable
|
||||
size-unit="MB"
|
||||
:max-size="50"
|
||||
:is-all-screen="true"
|
||||
class="mb-[16px]"
|
||||
@change="handleChange"
|
||||
|
|
|
@ -42,7 +42,7 @@ export default {
|
|||
defaultSystemTemplate: 'System template is defaulted',
|
||||
content: 'Bug content',
|
||||
file: 'Attachment files',
|
||||
fileExtra: 'Max of file is 50MB',
|
||||
fileExtra: 'Max of file is {size}MB',
|
||||
pleaseInputBugName: 'Please input bug name',
|
||||
nameIsRequired: 'Bug name cannot be empty',
|
||||
pleaseInputBugContent: 'Please input bug content',
|
||||
|
|
|
@ -41,7 +41,7 @@ export default {
|
|||
defaultSystemTemplate: '默认为系统模板',
|
||||
content: '缺陷内容',
|
||||
file: '附件',
|
||||
fileExtra: '支持任意类型文件,单个文件大小不超过 50MB',
|
||||
fileExtra: '支持任意类型文件,单个文件大小不超过 {size}MB',
|
||||
pleaseInputBugName: '请输入缺陷名称',
|
||||
nameIsRequired: '缺陷名称不能为空',
|
||||
pleaseInputBugContent: '请输入缺陷内容',
|
||||
|
|
|
@ -212,7 +212,6 @@
|
|||
multiple
|
||||
draggable
|
||||
size-unit="MB"
|
||||
:max-size="50"
|
||||
:is-all-screen="true"
|
||||
class="mb-[16px]"
|
||||
@change="handleChange"
|
||||
|
|
|
@ -26,13 +26,12 @@
|
|||
v-model:file-list="fileList"
|
||||
class="mb-6 w-full"
|
||||
:accept="validateType === 'Excel' ? 'excel' : 'xmind'"
|
||||
:max-size="100"
|
||||
size-unit="MB"
|
||||
main-text="caseManagement.featureCase.dragOrClick"
|
||||
:sub-text="
|
||||
validateType === 'Excel'
|
||||
? t('caseManagement.featureCase.onlyEXcelTip')
|
||||
: t('caseManagement.featureCase.onlyXmindTip')
|
||||
? t('caseManagement.featureCase.onlyEXcelTip', { size: appStore.getFileMaxSize })
|
||||
: t('caseManagement.featureCase.onlyXmindTip', { size: appStore.getFileMaxSize })
|
||||
"
|
||||
:show-file-list="false"
|
||||
:auto-upload="false"
|
||||
|
|
|
@ -207,7 +207,6 @@
|
|||
multiple
|
||||
draggable
|
||||
size-unit="MB"
|
||||
:max-size="50"
|
||||
:is-all-screen="true"
|
||||
class="mb-[16px]"
|
||||
@change="handleChange"
|
||||
|
|
|
@ -226,8 +226,8 @@ export default {
|
|||
'caseManagement.featureCase.formXMindExport': 'Import use cases from Xmind files',
|
||||
'caseManagement.featureCase.dragOrClick': 'Drag or click this area to select a file',
|
||||
'caseManagement.featureCase.onlyEXcelTip':
|
||||
'Only xls and xlsx are supported, and the size of each device cannot exceed 100 MB',
|
||||
'caseManagement.featureCase.onlyXmindTip': 'Only supports xmind, with a single size not exceeding 50M',
|
||||
'Only xls and xlsx are supported, and the size of each device cannot exceed {size} MB',
|
||||
'caseManagement.featureCase.onlyXmindTip': 'Only supports xmind, with a single size not exceeding {size}M',
|
||||
'caseManagement.featureCase.checkTemplate': 'Check template',
|
||||
'caseManagement.featureCase.checkImportFile': 'Check file',
|
||||
'caseManagement.featureCase.selectedRecoverCase':
|
||||
|
|
|
@ -224,8 +224,8 @@ export default {
|
|||
'caseManagement.featureCase.formExcelExport': '从 Excel 文件导入用例',
|
||||
'caseManagement.featureCase.formXMindExport': '从 Xmind 文件导入用例',
|
||||
'caseManagement.featureCase.dragOrClick': '拖拽或点击此区域选择文件',
|
||||
'caseManagement.featureCase.onlyEXcelTip': '仅支持 xls/xlsx,单个大小不超过 100M',
|
||||
'caseManagement.featureCase.onlyXmindTip': '仅支持 xmind,单个大小不超过 50M',
|
||||
'caseManagement.featureCase.onlyEXcelTip': '仅支持 xls/xlsx,单个大小不超过 {size}M',
|
||||
'caseManagement.featureCase.onlyXmindTip': '仅支持 xmind,单个大小不超过 {size}M',
|
||||
'caseManagement.featureCase.checkTemplate': '校验模板',
|
||||
'caseManagement.featureCase.checkImportFile': '校验文件',
|
||||
'caseManagement.featureCase.selectedRecoverCase': '勾选,ID相同时覆盖原用例',
|
||||
|
|
|
@ -21,10 +21,9 @@
|
|||
v-model:file-list="fileList"
|
||||
class="w-full"
|
||||
accept="json"
|
||||
:max-size="50"
|
||||
size-unit="MB"
|
||||
main-text="system.user.importModalDragText"
|
||||
:sub-text="t('project.environmental.supportFormat')"
|
||||
:sub-text="t('project.environmental.supportFormat', { size: appStore.getFileMaxSize })"
|
||||
:show-file-list="false"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
|
@ -73,6 +72,7 @@
|
|||
|
||||
import { importEnv, importGlobalParam } from '@/api/modules/project-management/envManagement';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
|
||||
import { EnvAuthTypeEnum } from '@/enums/envEnum';
|
||||
|
||||
|
@ -87,6 +87,7 @@
|
|||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const appStore = useAppStore();
|
||||
const visible = defineModel<boolean>('visible', { required: true, default: false });
|
||||
|
||||
const fileList = ref<FileItem[]>([]);
|
||||
|
|
|
@ -12,7 +12,7 @@ export default {
|
|||
'project.environmental.ENVIRONMENT': '环境',
|
||||
'project.environmental.ENVIRONMENT_PARAM': '全局参数',
|
||||
'project.environmental.globalVariable': '参数',
|
||||
'project.environmental.supportFormat': '仅支持MeterSphere导出的Json文件,单个大小不超过 50M',
|
||||
'project.environmental.supportFormat': '仅支持MeterSphere导出的Json文件,单个大小不超过 {size}M',
|
||||
'project.environmental.importTile': '注意!导入后会覆盖原全局参数',
|
||||
'project.environmental.mustContain': '必含',
|
||||
'project.environmental.searchParamsHolder': '通过名称/标签搜索',
|
||||
|
|
|
@ -105,7 +105,7 @@ export default {
|
|||
'system.orgTemplate.expectationTip': 'Please enter expectations',
|
||||
'system.orgTemplate.actualResultTip': 'Please enter actuality',
|
||||
'system.orgTemplate.addAttachment': 'Add attachment',
|
||||
'system.orgTemplate.addAttachmentTip': 'Support any type of file, the file size does not exceed 50MB',
|
||||
'system.orgTemplate.addAttachmentTip': 'Support any type of file, the file size does not exceed {size}MB',
|
||||
'system.orgTemplate.enabledSuccessfully': 'Enabled successfully',
|
||||
'system.orgTemplate.thirdPartyPlatforms': 'Used to map field values for third-party platforms such as JIRA',
|
||||
'system.orgTemplate.optionsIdNoRepeat': 'The option ID must be unique',
|
||||
|
|
|
@ -104,7 +104,7 @@ export default {
|
|||
'system.orgTemplate.expectationTip': '请输入预期',
|
||||
'system.orgTemplate.actualResultTip': '请输入实际',
|
||||
'system.orgTemplate.addAttachment': '添加附件',
|
||||
'system.orgTemplate.addAttachmentTip': '支持任意类型文件,文件大小不超过 50MB',
|
||||
'system.orgTemplate.addAttachmentTip': '支持任意类型文件,文件大小不超过 {size}MB',
|
||||
'system.orgTemplate.enabledSuccessfully': '启用成功',
|
||||
'system.orgTemplate.thirdPartyPlatforms': '用于映射 JIRA 等第三方平台字段值',
|
||||
'system.orgTemplate.optionsIdNoRepeat': '选项 ID 不可以重复',
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
<div>
|
||||
<MsCard class="mb-[16px]" :loading="baseLoading" simple auto-height>
|
||||
<div class="mb-[16px] flex justify-between">
|
||||
<div class="text-[var(--color-text-000)]">{{ t('system.config.baseInfo') }}</div>
|
||||
<div class="card-title">
|
||||
<div class="card-title-line"></div>
|
||||
<div class="card-title-text">{{ t('system.config.baseInfo') }}</div>
|
||||
</div>
|
||||
<a-button
|
||||
v-permission="['SYSTEM_PARAMETER_SETTING_BASE:READ+UPDATE']"
|
||||
type="outline"
|
||||
|
@ -16,7 +19,10 @@
|
|||
</MsCard>
|
||||
<MsCard class="mb-[16px]" :loading="emailLoading" simple auto-height>
|
||||
<div class="mb-[16px] flex justify-between">
|
||||
<div class="text-[var(--color-text-000)]">{{ t('system.config.emailConfig') }}</div>
|
||||
<div class="card-title">
|
||||
<div class="card-title-line"></div>
|
||||
<div class="card-title-text">{{ t('system.config.emailConfig') }}</div>
|
||||
</div>
|
||||
<a-button
|
||||
v-permission="['SYSTEM_PARAMETER_SETTING_BASE:READ+UPDATE']"
|
||||
type="outline"
|
||||
|
@ -66,6 +72,25 @@
|
|||
{{ t('system.config.email.test') }}
|
||||
</a-button>
|
||||
</MsCard>
|
||||
<MsCard class="mb-[16px]" :loading="fileSizeLimitLoading" simple auto-height>
|
||||
<div class="mb-[16px] flex justify-between">
|
||||
<div class="card-title">
|
||||
<div class="card-title-line"></div>
|
||||
<div class="card-title-text">
|
||||
{{ t('system.config.fileLimit') }}
|
||||
<div class="text-[var(--color-text-4)]">(M)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a-input-number
|
||||
v-model:model-value="fileSizeLimit"
|
||||
class="w-[130px]"
|
||||
:disabled="fileSizeLimitLoading || !hasAnyPermission(['SYSTEM_PARAMETER_SETTING_BASE:READ+UPDATE'])"
|
||||
:min="0"
|
||||
mode="button"
|
||||
@blur="() => saveFileSizeLimitConfig()"
|
||||
/>
|
||||
</MsCard>
|
||||
<a-modal
|
||||
v-model:visible="baseInfoModalVisible"
|
||||
:title="t('system.config.baseInfo.updateTitle')"
|
||||
|
@ -211,10 +236,19 @@
|
|||
import MsIcon from '@/components/pure/ms-icon-font/index.vue';
|
||||
import MsFormItemSub from '@/components/business/ms-form-item-sub/index.vue';
|
||||
|
||||
import { getBaseInfo, getEmailInfo, saveBaseInfo, saveEmailInfo, testEmail } from '@/api/modules/setting/config';
|
||||
import {
|
||||
getBaseInfo,
|
||||
getEmailInfo,
|
||||
saveBaseInfo,
|
||||
saveEmailInfo,
|
||||
saveUploadConfig,
|
||||
testEmail,
|
||||
} from '@/api/modules/setting/config';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import useLicenseStore from '@/store/modules/setting/license';
|
||||
import { desensitize } from '@/utils';
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
import { validateEmail } from '@/utils/validate';
|
||||
|
||||
import type { EmailConfig, TestEmailParams } from '@/models/setting/config';
|
||||
|
@ -222,6 +256,7 @@
|
|||
import type { FormInstance, ValidatedError } from '@arco-design/web-vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const appStore = useAppStore();
|
||||
|
||||
const baseLoading = ref(false);
|
||||
const baseModalLoading = ref(false);
|
||||
|
@ -234,6 +269,7 @@
|
|||
const baseInfoDesc = ref<Description[]>([]);
|
||||
// 默认示例
|
||||
const defaultUrl = 'https://metersphere.com';
|
||||
const fileSizeLimit = ref(50);
|
||||
|
||||
function fillDefaultUrl() {
|
||||
baseInfoForm.value.url = defaultUrl;
|
||||
|
@ -242,7 +278,6 @@
|
|||
/**
|
||||
* 初始化基础信息
|
||||
*/
|
||||
|
||||
const licenseStore = useLicenseStore();
|
||||
async function initBaseInfo() {
|
||||
try {
|
||||
|
@ -265,6 +300,7 @@
|
|||
},
|
||||
];
|
||||
}
|
||||
fileSizeLimit.value = Number(res.fileMaxSize);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
|
@ -502,6 +538,28 @@
|
|||
}
|
||||
}
|
||||
|
||||
const fileSizeLimitLoading = ref(false);
|
||||
|
||||
async function saveFileSizeLimitConfig() {
|
||||
try {
|
||||
fileSizeLimitLoading.value = true;
|
||||
await saveUploadConfig([
|
||||
{
|
||||
paramKey: 'upload.file.size',
|
||||
paramValue: fileSizeLimit.value.toString(),
|
||||
type: 'text',
|
||||
},
|
||||
]);
|
||||
Message.success(t('common.updateSuccess'));
|
||||
appStore.setFileMaxSize(fileSizeLimit.value);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
} finally {
|
||||
fileSizeLimitLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
initBaseInfo();
|
||||
initEmailInfo();
|
||||
|
@ -515,4 +573,21 @@
|
|||
@apply pb-0;
|
||||
}
|
||||
}
|
||||
.card-title {
|
||||
@apply flex items-center;
|
||||
|
||||
gap: 8px;
|
||||
.card-title-line {
|
||||
width: 3px;
|
||||
height: 14px;
|
||||
border-radius: var(--border-radius-small);
|
||||
background: rgb(var(--primary-4));
|
||||
}
|
||||
.card-title-text {
|
||||
@apply flex items-center;
|
||||
|
||||
gap: 2px;
|
||||
color: var(--color-text-000);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -222,4 +222,5 @@ export default {
|
|||
'system.config.qrCodeConfig.appKey.required': 'App Key is empty',
|
||||
'system.config.qrCodeConfig.appSecret.required': 'App Secret is empty',
|
||||
'system.config.qrCodeConfig.callBack.required': 'CallBack is empty',
|
||||
'system.config.fileLimit': 'File size limit',
|
||||
};
|
||||
|
|
|
@ -214,4 +214,5 @@ export default {
|
|||
'system.config.qrCodeConfig.appKey.required': '应用key不能为空',
|
||||
'system.config.qrCodeConfig.appSecret.required': '应用密钥不能为空',
|
||||
'system.config.qrCodeConfig.callBack.required': '回调域名不能为空',
|
||||
'system.config.fileLimit': '文件大小限制',
|
||||
};
|
||||
|
|
|
@ -69,10 +69,9 @@
|
|||
<MsUpload
|
||||
v-model:file-list="fileList"
|
||||
accept="jar"
|
||||
:max-size="50"
|
||||
size-unit="MB"
|
||||
main-text="system.user.importModalDragText"
|
||||
:sub-text="t('system.plugin.supportFormat')"
|
||||
:sub-text="t('system.plugin.supportFormat', { size: appStore.getFileMaxSize })"
|
||||
:show-file-list="false"
|
||||
:auto-upload="false"
|
||||
:disabled="confirmLoading"
|
||||
|
@ -126,21 +125,25 @@
|
|||
import { addPlugin } from '@/api/modules/setting/pluginManger';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useVisit from '@/hooks/useVisit';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
|
||||
import type { FileItem, FormInstance, SelectOptionData, ValidatedError } from '@arco-design/web-vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const visitedKey = 'doNotShowAgain';
|
||||
const { getIsVisited } = useVisit(visitedKey);
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
organizeList: SelectOptionData;
|
||||
}>();
|
||||
const emits = defineEmits<{
|
||||
(event: 'update:visible', visible: boolean): void;
|
||||
(e: 'success'): void;
|
||||
(e: 'brash'): void;
|
||||
}>();
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
organizeList: SelectOptionData;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const appStore = useAppStore();
|
||||
const visitedKey = 'doNotShowAgain';
|
||||
const { getIsVisited } = useVisit(visitedKey);
|
||||
|
||||
const pluginVisible = ref(false);
|
||||
const fileName = ref<string>('');
|
||||
const fileList = ref<FileItem[]>([]);
|
||||
|
|
|
@ -28,7 +28,7 @@ export default {
|
|||
'system.plugin.tableColumnsJar': 'Jar packages',
|
||||
'system.plugin.tableNoData': 'No data, please',
|
||||
'system.plugin.pluginDescription': 'Please describe the plug-in',
|
||||
'system.plugin.supportFormat': 'Only JAR format files are supported and the file size does not exceed 50M',
|
||||
'system.plugin.supportFormat': 'Only JAR format files are supported and the file size does not exceed {size}M',
|
||||
'system.plugin.interfaceTestDescribe': 'Plug-ins for protocol classes recommend choosing an interface test',
|
||||
'system.plugin.projectMangerDescribe': 'The project management platform class recommends choosing project management',
|
||||
'system.resourcePool.disablePoolConfirm': 'Confirm',
|
||||
|
|
|
@ -28,7 +28,7 @@ export default {
|
|||
'system.plugin.tableColumnsJar': 'jar包',
|
||||
'system.plugin.tableNoData': '暂无数据,请',
|
||||
'system.plugin.pluginDescription': '请对该插件进行描述',
|
||||
'system.plugin.supportFormat': '只支持JAR格式文件,文件大小不超过50M',
|
||||
'system.plugin.supportFormat': '只支持JAR格式文件,文件大小不超过{size}M',
|
||||
'system.plugin.interfaceTestDescribe': '协议类的插件建议选择接口测试',
|
||||
'system.plugin.projectMangerDescribe': '项目管理平台类建议选择项目管理',
|
||||
'system.plugin.deletePluginTip': '确认删除 {name} 这个插件吗?',
|
||||
|
|
|
@ -75,7 +75,7 @@ export default {
|
|||
'system.user.importDownload': 'Download the template',
|
||||
'system.user.importModalTip': 'User groups only support adding user groups that exist in the system',
|
||||
'system.user.importModalDragText': 'Drag or click this area to select a file',
|
||||
'system.user.importModalFileTip': 'Only supports xls/xlsx format files, and the file size should not exceed 50M',
|
||||
'system.user.importModalFileTip': 'Only supports xls/xlsx format files, and the file size should not exceed {size}M',
|
||||
'system.user.importModalCancel': 'Cancel',
|
||||
'system.user.importModalConfirm': 'Import',
|
||||
'system.user.importModalUploading': 'File is uploading...',
|
||||
|
|
|
@ -74,7 +74,7 @@ export default {
|
|||
'system.user.importModalTip': '用户组仅支持添加系统存在的用户组',
|
||||
'system.user.importDownload': '下载模板',
|
||||
'system.user.importModalDragText': '拖拽或点击此区域选择文件',
|
||||
'system.user.importModalFileTip': '只支持 xls/xlsx格式文件,文件大小不超过 50M',
|
||||
'system.user.importModalFileTip': '只支持 xls/xlsx格式文件,文件大小不超过 {size}M',
|
||||
'system.user.importModalCancel': '取消',
|
||||
'system.user.importModalConfirm': '导入',
|
||||
'system.user.importModalUploading': '文件上传中...',
|
||||
|
|
Loading…
Reference in New Issue