From b9bddbfabb5664365f1232e9432532187c98006c Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sun, 1 Sep 2024 04:49:26 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=94=AF=E6=8C=81ftp=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/ftp/docker-compose.yaml | 14 +++ .../src/components/vip-button/index.vue | 86 ++++++++++++------- .../src/layout/layout-framework.vue | 2 +- .../src/views/certd/access/common.tsx | 16 +++- .../pipeline/component/step-form/index.vue | 10 ++- packages/ui/certd-server/package.json | 7 +- .../pipeline/service/access-service.ts | 3 +- .../system/service/sys-settings-service.ts | 15 ++-- 8 files changed, 105 insertions(+), 48 deletions(-) create mode 100644 docker/ftp/docker-compose.yaml diff --git a/docker/ftp/docker-compose.yaml b/docker/ftp/docker-compose.yaml new file mode 100644 index 00000000..da017d36 --- /dev/null +++ b/docker/ftp/docker-compose.yaml @@ -0,0 +1,14 @@ +version: '3.3' +services: + ftp: + # 镜像 # ↓↓↓↓↓ --- 1、 镜像版本号,建议改成固定版本号【可选】 + image: gists/pure-ftpd + container_name: ftp # 容器名 + restart: unless-stopped # 自动重启 + volumes: + - /data/ftp2/:/home/ftpuser + ports: # 端口映射 + - "21:21" + - "30000-30009:30000-30009" + environment: # 环境变量 + - TZ=Asia/Shanghai diff --git a/packages/ui/certd-client/src/components/vip-button/index.vue b/packages/ui/certd-client/src/components/vip-button/index.vue index 46dd4da6..f8b7a6b9 100644 --- a/packages/ui/certd-client/src/components/vip-button/index.vue +++ b/packages/ui/certd-client/src/components/vip-button/index.vue @@ -1,20 +1,13 @@ @@ -26,24 +19,53 @@ import { message, Modal } from "ant-design-vue"; import * as api from "./api"; import { useSettingStore } from "/@/store/modules/settings"; -const props = defineProps<{ - mode?: "button" | "nav"; -}>(); -type Texts = { - plus: string; - free: string; +const props = withDefaults( + defineProps<{ + mode?: "button" | "nav" | "icon"; + }>(), + { + mode: "button" + } +); +type Text = { + name: string; + title?: string; }; -const texts = computed(() => { - if (props.mode === "button") { - return { - plus: "专业版已开通", - free: "此为专业版功能" - }; +const text = computed(() => { + const map = { + isPlus: { + button: { + name: "专业版已开通", + title: "到期时间:" + expireTime.value + }, + icon: { + name: "", + title: "专业版已开通" + }, + nav: { + name: "专业版", + title: "到期时间:" + expireTime.value + } + }, + free: { + button: { + name: "此为专业版功能", + title: "升级专业版,享受更多VIP特权" + }, + icon: { + name: "", + title: "此为专业版功能" + }, + nav: { + name: "免费版", + title: "升级专业版,享受更多VIP特权" + } + } + }; + if (userStore.isPlus) { + return map.isPlus[props.mode]; } else { - return { - plus: "专业版", - free: "免费版" - }; + return map.free[props.mode]; } }); @@ -86,6 +108,7 @@ async function doActive() { const settingStore = useSettingStore(); const computedSiteId = computed(() => settingStore.installInfo?.siteId); const [modal, contextHolder] = Modal.useModal(); + function openUpgrade() { const placeholder = "请输入激活码"; modal.confirm({ @@ -137,6 +160,7 @@ function openUpgrade() { justify-content: center; height: 100%; cursor: pointer; + &.isPlus { color: #c5913f; } diff --git a/packages/ui/certd-client/src/layout/layout-framework.vue b/packages/ui/certd-client/src/layout/layout-framework.vue index 0a84e037..9dbfc3a1 100644 --- a/packages/ui/certd-client/src/layout/layout-framework.vue +++ b/packages/ui/certd-client/src/layout/layout-framework.vue @@ -18,7 +18,7 @@ - +
diff --git a/packages/ui/certd-client/src/views/certd/access/common.tsx b/packages/ui/certd-client/src/views/certd/access/common.tsx index 2d3209eb..a1c8c90f 100644 --- a/packages/ui/certd-client/src/views/certd/access/common.tsx +++ b/packages/ui/certd-client/src/views/certd/access/common.tsx @@ -16,7 +16,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any) { } }; - function buildDefineFields(define: any) { + function buildDefineFields(define: any, form: any) { const formWrapperRef = crudExpose.getFormWrapperRef(); const columnsRef = toRef(formWrapperRef.formOptions, "columns"); @@ -32,7 +32,12 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any) { ...value, key }; - columnsRef.value[key] = _.merge({ title: key }, defaultPluginConfig, field); + const column = _.merge({ title: key }, defaultPluginConfig, field); + if (column.value != null && _.get(form, key) == null) { + //设置默认值 + _.set(form, key, column.value); + } + columnsRef.value[key] = column; console.log("form", columnsRef.value); }); } @@ -55,13 +60,16 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any) { rules: [{ required: true, message: "请选择类型" }], valueChange: { immediate: true, - async handle({ value, mode, form }) { + async handle({ value, mode, form, immediate }) { if (value == null) { return; } const define = await api.GetProviderDefine(value); console.log("define", define); - buildDefineFields(define); + if (!immediate) { + form.access = {}; + } + buildDefineFields(define, form); } } }, diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue index 8d0b45e7..a207636c 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue @@ -25,6 +25,7 @@