diff --git a/frontend/src/api/modules/setting/authorizedManagement.ts b/frontend/src/api/modules/setting/authorizedManagement.ts new file mode 100644 index 0000000000..6e2b179303 --- /dev/null +++ b/frontend/src/api/modules/setting/authorizedManagement.ts @@ -0,0 +1,11 @@ +import MSR from '@/api/http/index'; +import { getLicenseUrl, addLicenseUrl } from '@/api/requrls/setting/authorizedManagement'; +import type { LicenseInfo } from '@/models/setting/authorizedManagement'; +// 获取当前信息 +export function getLicenseInfo() { + return MSR.get({ url: getLicenseUrl }); +} +// 添加License +export function addLicense(data: string) { + return MSR.post({ url: addLicenseUrl, data }); +} diff --git a/frontend/src/api/requrls/setting/authorizedManagement.ts b/frontend/src/api/requrls/setting/authorizedManagement.ts new file mode 100644 index 0000000000..78d4eb8780 --- /dev/null +++ b/frontend/src/api/requrls/setting/authorizedManagement.ts @@ -0,0 +1,2 @@ +export const getLicenseUrl = '/license/validate'; +export const addLicenseUrl = '/license/add'; diff --git a/frontend/src/assets/images/authorized_bg.png b/frontend/src/assets/images/authorized_bg.png new file mode 100644 index 0000000000..f9568d3ca2 Binary files /dev/null and b/frontend/src/assets/images/authorized_bg.png differ diff --git a/frontend/src/assets/style/arco-reset.less b/frontend/src/assets/style/arco-reset.less index d3f6a7e713..7833c216a9 100644 --- a/frontend/src/assets/style/arco-reset.less +++ b/frontend/src/assets/style/arco-reset.less @@ -249,6 +249,14 @@ } } } +.arco-form-item-status-success .arco-input-wrapper:not(.arco-input-disabled).arco-input-focus { + border: 1px solid rgb(var(--primary-5)) !important; + background: none; + box-shadow: none; +} +.arco-form-item-status-success .arco-input-wrapper:not(.arco-input-disabled) { + border-color: var(--color-text-input-border); +} /** form-item **/ .arco-form-item-content-flex { diff --git a/frontend/src/assets/svg/authorized_logo.svg b/frontend/src/assets/svg/authorized_logo.svg new file mode 100644 index 0000000000..91488f28a0 --- /dev/null +++ b/frontend/src/assets/svg/authorized_logo.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/components/pure/ms-upload/index.vue b/frontend/src/components/pure/ms-upload/index.vue index 6b5e778c08..b674ae8e74 100644 --- a/frontend/src/components/pure/ms-upload/index.vue +++ b/frontend/src/components/pure/ms-upload/index.vue @@ -18,7 +18,7 @@
{{ t(props.mainText || 'ms.upload.importModalDragtext') }}
-
+
{{ t(props.subText || 'ms.upload.importModalFileTip', { type: UploadAcceptEnum[props.accept], @@ -55,6 +55,7 @@ type UploadProps = Partial<{ mainText: string; // 主要文案 subText: string; // 次要文案 + showSubText: boolean; // 是否显示次要文案 class: string; multiple: boolean; imagePreview: boolean; @@ -68,7 +69,9 @@ fileList: FileItem[]; }; - const props = defineProps(); + const props = withDefaults(defineProps(), { + showSubText: true, + }); const emit = defineEmits(['update:fileList']); const defaultMaxSize = 50; @@ -101,6 +104,7 @@ xmind: 'icon-icon_file-xmind_colorful1', image: 'icon-icon_file-image_colorful1', jar: 'icon-icon_file-jar_colorful', + none: 'icon-icon_file-text_colorful1', }; async function beforeUpload(file: File) { diff --git a/frontend/src/enums/uploadEnum.ts b/frontend/src/enums/uploadEnum.ts index 77071aab5a..fa2be3b3b5 100644 --- a/frontend/src/enums/uploadEnum.ts +++ b/frontend/src/enums/uploadEnum.ts @@ -10,6 +10,7 @@ export enum UploadAcceptEnum { xmind = '.xmind', image = '.jpg,.jpeg,.png,.svg', jar = '.jar', + none = 'none', } export default UploadAcceptEnum; diff --git a/frontend/src/locale/en-US/index.ts b/frontend/src/locale/en-US/index.ts index af7a9adf6c..aa7c1b5bf1 100644 --- a/frontend/src/locale/en-US/index.ts +++ b/frontend/src/locale/en-US/index.ts @@ -32,6 +32,7 @@ export default { 'menu.settings.organization.member': 'Member', 'menu.settings.organization.serviceIntegration': 'Service Integration', 'menu.settings.system.usergroup': 'User Group', + 'menu.settings.system.authorizedManagement': 'Authorized Management', 'menu.settings.system.pluginmanger': 'Plugin Manger', 'menu.settings.system.user': 'User', 'menu.settings.system.organizationAndProject': 'Org & Project', diff --git a/frontend/src/locale/zh-CN/index.ts b/frontend/src/locale/zh-CN/index.ts index 35bfff0f5e..07459f8008 100644 --- a/frontend/src/locale/zh-CN/index.ts +++ b/frontend/src/locale/zh-CN/index.ts @@ -32,6 +32,7 @@ export default { 'menu.settings.organization.serviceIntegration': '服务集成', 'menu.settings.system.user': '用户', 'menu.settings.system.usergroup': '用户组', + 'menu.settings.system.authorizedManagement': '授权管理', 'menu.settings.system.pluginmanger': '插件管理', 'menu.settings.system.organizationAndProject': '组织与项目', 'menu.settings.system.resourcePool': '资源池', diff --git a/frontend/src/models/setting/authorizedManagement.ts b/frontend/src/models/setting/authorizedManagement.ts new file mode 100644 index 0000000000..8dea24eefa --- /dev/null +++ b/frontend/src/models/setting/authorizedManagement.ts @@ -0,0 +1,13 @@ +export interface License { + corporation: string; // 客户名称 + expired: string; // 授权时间 + product: string; // 产品名称 + edition: string; // 版本 + licenseVersion: string; // 授权版本 + count: number; // 授权数量 +} + +export interface LicenseInfo { + status?: string; + license?: License; +} diff --git a/frontend/src/models/setting/serviceIntegration.ts b/frontend/src/models/setting/serviceIntegration.ts new file mode 100644 index 0000000000..ca7b9acf3b --- /dev/null +++ b/frontend/src/models/setting/serviceIntegration.ts @@ -0,0 +1,23 @@ +export interface ServiceItem { + id?: string; + pluginId: string; // 插件id + title: string; + description: string; + enable: boolean; + config: boolean; + logo: string; + organizationId: string; // 组织id + configuration?: null; // 配置项 +} + +export type ServiceList = ServiceItem[]; + +// 创建和更新服务 + +export interface AddOrUpdateServiceModel { + id?: string; + pluginId: string; + enable: boolean; + organizationId: string; + configuration: any; +} diff --git a/frontend/src/router/routes/modules/setting.ts b/frontend/src/router/routes/modules/setting.ts index a1086ee6c5..44ab08a6f2 100644 --- a/frontend/src/router/routes/modules/setting.ts +++ b/frontend/src/router/routes/modules/setting.ts @@ -89,6 +89,16 @@ const Setting: AppRouteRecordRaw = { ], }, }, + { + path: 'authorizedmanagement', + name: 'settingSystemAuthorizedManagement', + component: () => import('@/views/setting/system/authorizedManagement/index.vue'), + meta: { + locale: 'menu.settings.system.authorizedManagement', + roles: ['*'], + isTopMenu: true, + }, + }, { path: 'pluginmanger', name: 'settingSystemPluginManger', diff --git a/frontend/src/views/setting/system/authorizedManagement/index.vue b/frontend/src/views/setting/system/authorizedManagement/index.vue new file mode 100644 index 0000000000..4a748ef3f0 --- /dev/null +++ b/frontend/src/views/setting/system/authorizedManagement/index.vue @@ -0,0 +1,234 @@ + + + + + diff --git a/frontend/src/views/setting/system/authorizedManagement/locale/en-US.ts b/frontend/src/views/setting/system/authorizedManagement/locale/en-US.ts new file mode 100644 index 0000000000..e68f3c8889 --- /dev/null +++ b/frontend/src/views/setting/system/authorizedManagement/locale/en-US.ts @@ -0,0 +1,17 @@ +export default { + 'system.authorized.customerName': 'Customer Name', + 'system.authorized.authorizationTime': 'Authorization time', + 'system.authorized.productName': 'Product Name', + 'system.authorized.productionVersion': 'Production Version', + 'system.authorized.authorizedVersion': 'The authorized version', + 'system.authorized.authorizationsCount': 'Number of authorizations', + 'system.authorized.authorizationStatus': 'Authorization status', + 'system.authorized.authorityChecking': 'Authority Checking', + 'system.authorized.valid': 'valid', + 'system.authorized.invalid': 'invalid', + 'system.authorized.failure': 'failure', + 'system.authorized.authorization': 'Accredit', + 'system.authorized.license': 'License', + 'system.authorized.licenseCode': 'License Code', + 'system.authorized.licenseSuccessTip': 'Authorized Successfully!', +}; diff --git a/frontend/src/views/setting/system/authorizedManagement/locale/zh-CN.ts b/frontend/src/views/setting/system/authorizedManagement/locale/zh-CN.ts new file mode 100644 index 0000000000..55d4975d43 --- /dev/null +++ b/frontend/src/views/setting/system/authorizedManagement/locale/zh-CN.ts @@ -0,0 +1,17 @@ +export default { + 'system.authorized.customerName': '客户名称', + 'system.authorized.authorizationTime': '授权时间', + 'system.authorized.productName': '产品名称', + 'system.authorized.productionVersion': '产品版本', + 'system.authorized.authorizedVersion': '授权版本', + 'system.authorized.authorizationsCount': '授权数量', + 'system.authorized.authorizationStatus': '授权状态', + 'system.authorized.authorityChecking': '授权验证', + 'system.authorized.valid': '有效', + 'system.authorized.invalid': '无效', + 'system.authorized.failure': '失败', + 'system.authorized.authorization': '授权', + 'system.authorized.license': 'License', + 'system.authorized.licenseCode': 'License Code', + 'system.authorized.licenseSuccessTip': '授权成功', +}; diff --git a/frontend/src/views/setting/system/pluginManager/locale/zh-CN.ts b/frontend/src/views/setting/system/pluginManager/locale/zh-CN.ts index 26a2cedbff..be8c5ed426 100644 --- a/frontend/src/views/setting/system/pluginManager/locale/zh-CN.ts +++ b/frontend/src/views/setting/system/pluginManager/locale/zh-CN.ts @@ -60,7 +60,7 @@ export default { 'system.plugin.disablePluginSuccess': '禁用成功', 'system.plugin.disablePluginContent': '项目无法与该平台集成且该平台默认模版不可用,谨慎操作!', 'system.plugin.alertDescribe': - 'MeterSphereV2.10LTS版本支持DevOps、API导入、请求、项目管理、协议类型的插件,具体支持插件请', + 'MeterSphereV2.10LTS 版本支持 DevOps、API 导入、请求、项目管理、协议类型的插件,具体支持插件请', 'system.plugin.viewTable': '查看表格', 'system.plugin.downAddress': '更多开源插件,请在此下载', 'system.plugin.goDownload': '去下载',