mirror of https://github.com/certd/certd
perf: 支持根据id更新证书(证书Id不变接口),不过该接口为白名单功能,普通腾讯云账户无法使用
parent
6cbb0739f8
commit
fe9c4f3391
|
@ -66,7 +66,7 @@ const getOptions = async () => {
|
|||
const input = (pluginType === "plugin" ? form?.input : form) || {};
|
||||
|
||||
for (let key in define.input) {
|
||||
const inWatches = props.watches.includes(key);
|
||||
const inWatches = props.watches?.includes(key);
|
||||
const inputDefine = define.input[key];
|
||||
if (inWatches && inputDefine.required) {
|
||||
const value = input[key];
|
||||
|
|
|
@ -105,7 +105,7 @@ const getOptions = async () => {
|
|||
const input = (pluginType === "plugin" ? form?.input : form) || {};
|
||||
|
||||
for (let key in define.input) {
|
||||
const inWatches = props.watches.includes(key);
|
||||
const inWatches = props.watches?.includes(key);
|
||||
const inputDefine = define.input[key];
|
||||
if (inWatches && inputDefine.required) {
|
||||
const value = input[key];
|
||||
|
|
|
@ -0,0 +1,192 @@
|
|||
<template>
|
||||
<div class="remote-select">
|
||||
<div class="flex flex-row">
|
||||
<a-tree-select class="remote-tree-select-input" :tree-data="optionsRef" :value="value" tree-checkable allow-clear v-bind="attrs" @click="onClick" @update:value="emit('update:value', $event)"> </a-tree-select>
|
||||
<div class="ml-5">
|
||||
<fs-button :loading="loading" title="刷新选项" icon="ion:refresh-outline" @click="refreshOptions"></fs-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="helper" :class="{ error: hasError }">
|
||||
{{ message }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ComponentPropsType, doRequest } from "/@/components/plugins/lib";
|
||||
import { defineComponent, inject, ref, useAttrs, watch, Ref } from "vue";
|
||||
import { PluginDefine } from "@certd/pipeline";
|
||||
|
||||
defineOptions({
|
||||
name: "RemoteTreeSelect",
|
||||
});
|
||||
|
||||
const props = defineProps<
|
||||
{
|
||||
watches: string[];
|
||||
search?: boolean;
|
||||
pager?: boolean;
|
||||
} & ComponentPropsType
|
||||
>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
"update:value": any;
|
||||
}>();
|
||||
|
||||
const attrs = useAttrs();
|
||||
|
||||
const getCurrentPluginDefine: any = inject("getCurrentPluginDefine", () => {
|
||||
return {};
|
||||
});
|
||||
const getScope: any = inject("get:scope", () => {
|
||||
return {};
|
||||
});
|
||||
const getPluginType: any = inject("get:plugin:type", () => {
|
||||
return "plugin";
|
||||
});
|
||||
|
||||
const searchKeyRef = ref("");
|
||||
const optionsRef = ref([]);
|
||||
const message = ref("");
|
||||
const hasError = ref(false);
|
||||
const loading = ref(false);
|
||||
const pagerRef: Ref = ref({
|
||||
current: 1,
|
||||
});
|
||||
const getOptions = async () => {
|
||||
debugger;
|
||||
if (loading.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!getCurrentPluginDefine) {
|
||||
return;
|
||||
}
|
||||
|
||||
const define: PluginDefine = getCurrentPluginDefine()?.value;
|
||||
if (!define) {
|
||||
return;
|
||||
}
|
||||
const pluginType = getPluginType();
|
||||
const { form } = getScope();
|
||||
const input = (pluginType === "plugin" ? form?.input : form) || {};
|
||||
|
||||
for (let key in define.input) {
|
||||
const inWatches = props.watches?.includes(key);
|
||||
const inputDefine = define.input[key];
|
||||
if (inWatches && inputDefine.required) {
|
||||
const value = input[key];
|
||||
if (value == null || value === "") {
|
||||
console.log("remote-select required", key);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
message.value = "";
|
||||
hasError.value = false;
|
||||
loading.value = true;
|
||||
const pageNo = pagerRef.value.pageNo;
|
||||
const pageSize = pagerRef.value.pageSize;
|
||||
try {
|
||||
const res = await doRequest(
|
||||
{
|
||||
type: pluginType,
|
||||
typeName: form.type,
|
||||
action: props.action,
|
||||
input,
|
||||
data: {
|
||||
searchKey: props.search ? searchKeyRef.value : "",
|
||||
pageNo,
|
||||
pageSize,
|
||||
},
|
||||
},
|
||||
{
|
||||
onError(err: any) {
|
||||
hasError.value = true;
|
||||
message.value = `获取选项出错:${err.message}`;
|
||||
},
|
||||
showErrorNotify: false,
|
||||
}
|
||||
);
|
||||
const list = res?.list || res || [];
|
||||
if (list.length > 0) {
|
||||
message.value = "获取数据成功,请从下拉框中选择";
|
||||
} else {
|
||||
message.value = "获取数据成功,没有数据";
|
||||
}
|
||||
optionsRef.value = list;
|
||||
pagerRef.value.total = list.length;
|
||||
if (props.pager) {
|
||||
if (res.pageNo != null) {
|
||||
pagerRef.value.pageNo = res.pageNo ?? 1;
|
||||
}
|
||||
if (res.pageSize != null) {
|
||||
pagerRef.value.pageSize = res.pageSize ?? 100;
|
||||
}
|
||||
if (res.total != null) {
|
||||
pagerRef.value.total = res.total ?? list.length;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
async function onClick() {
|
||||
if (optionsRef.value?.length === 0) {
|
||||
await refreshOptions();
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshOptions() {
|
||||
await getOptions();
|
||||
}
|
||||
|
||||
async function doSearch() {
|
||||
pagerRef.value.pageNo = 1;
|
||||
await refreshOptions();
|
||||
}
|
||||
|
||||
watch(
|
||||
() => {
|
||||
const pluginType = getPluginType();
|
||||
const { form, key } = getScope();
|
||||
const input = (pluginType === "plugin" ? form?.input : form) || {};
|
||||
const watches = {};
|
||||
for (const key of props.watches) {
|
||||
//@ts-ignore
|
||||
watches[key] = input[key];
|
||||
}
|
||||
return {
|
||||
form: watches,
|
||||
key,
|
||||
};
|
||||
},
|
||||
async (value, oldValue) => {
|
||||
const { form } = value;
|
||||
const oldForm: any = oldValue?.form;
|
||||
let changed = oldForm == null || optionsRef.value.length == 0;
|
||||
for (const key of props.watches) {
|
||||
//@ts-ignore
|
||||
if (oldForm && form[key] != oldForm[key]) {
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
await getOptions();
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
async function onPageChange(current: any) {
|
||||
await refreshOptions();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less"></style>
|
|
@ -2,6 +2,7 @@ import SynologyIdDeviceGetter from "./synology/device-id-getter.vue";
|
|||
import RemoteAutoComplete from "./common/remote-auto-complete.vue";
|
||||
import RemoteSelect from "./common/remote-select.vue";
|
||||
import RemoteInput from "./common/remote-input.vue";
|
||||
import RemoteTreeSelect from "./common/remote-tree-select.vue";
|
||||
import CertDomainsGetter from "./common/cert-domains-getter.vue";
|
||||
import OutputSelector from "/@/components/plugins/common/output-selector/index.vue";
|
||||
import DnsProviderSelector from "/@/components/plugins/cert/dns-provider-selector/index.vue";
|
||||
|
@ -24,6 +25,7 @@ export default {
|
|||
app.component("SynologyDeviceIdGetter", SynologyIdDeviceGetter);
|
||||
app.component("RemoteAutoComplete", RemoteAutoComplete);
|
||||
app.component("RemoteSelect", RemoteSelect);
|
||||
app.component("RemoteTreeSelect", RemoteTreeSelect);
|
||||
app.component("RemoteInput", RemoteInput);
|
||||
app.component("CertDomainsGetter", CertDomainsGetter);
|
||||
app.component("InputPassword", InputPassword);
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
"socks-proxy-agent": "^8.0.4",
|
||||
"strip-ansi": "^7.1.0",
|
||||
"svg-captcha": "^1.4.0",
|
||||
"tencentcloud-sdk-nodejs": "^4.0.983",
|
||||
"tencentcloud-sdk-nodejs": "^4.1.112",
|
||||
"typeorm": "^0.3.20",
|
||||
"uuid": "^10.0.0"
|
||||
},
|
||||
|
|
|
@ -9,3 +9,4 @@ export * from './delete-expiring-cert/index.js';
|
|||
export * from './deploy-to-tke-ingress/index.js';
|
||||
export * from './deploy-to-live/index.js';
|
||||
export * from './start-instances/index.js';
|
||||
export * from './refresh-cert/index.js';
|
||||
|
|
104
pnpm-lock.yaml
104
pnpm-lock.yaml
|
@ -49,7 +49,7 @@ importers:
|
|||
packages/core/acme-client:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../basic
|
||||
'@peculiar/x509':
|
||||
specifier: ^1.11.0
|
||||
|
@ -210,10 +210,10 @@ importers:
|
|||
packages/core/pipeline:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../basic
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../pro/plus-core
|
||||
dayjs:
|
||||
specifier: ^1.11.7
|
||||
|
@ -418,7 +418,7 @@ importers:
|
|||
packages/libs/lib-k8s:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/basic
|
||||
'@kubernetes/client-node':
|
||||
specifier: 0.21.0
|
||||
|
@ -458,16 +458,16 @@ importers:
|
|||
packages/libs/lib-server:
|
||||
dependencies:
|
||||
'@certd/acme-client':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/acme-client
|
||||
'@certd/basic':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/basic
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../pro/plus-core
|
||||
'@midwayjs/cache':
|
||||
specifier: ~3.14.0
|
||||
|
@ -610,16 +610,16 @@ importers:
|
|||
packages/plugins/plugin-cert:
|
||||
dependencies:
|
||||
'@certd/acme-client':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/acme-client
|
||||
'@certd/basic':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/basic
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-lib':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../plugin-lib
|
||||
'@google-cloud/publicca':
|
||||
specifier: ^1.3.0
|
||||
|
@ -701,10 +701,10 @@ importers:
|
|||
specifier: ^3.787.0
|
||||
version: 3.810.0(aws-crt@1.26.2)
|
||||
'@certd/basic':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/basic
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/pipeline
|
||||
'@kubernetes/client-node':
|
||||
specifier: 0.21.0
|
||||
|
@ -792,19 +792,19 @@ importers:
|
|||
packages/pro/commercial-core:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/basic
|
||||
'@certd/lib-server':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../libs/lib-server
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-plus':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../plugin-plus
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../plus-core
|
||||
'@midwayjs/core':
|
||||
specifier: ~3.20.3
|
||||
|
@ -889,22 +889,22 @@ importers:
|
|||
specifier: ^1.0.2
|
||||
version: 1.0.3
|
||||
'@certd/basic':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/basic
|
||||
'@certd/lib-k8s':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../libs/lib-k8s
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-cert':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../plugins/plugin-cert
|
||||
'@certd/plugin-lib':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../plugins/plugin-lib
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../plus-core
|
||||
ali-oss:
|
||||
specifier: ^6.21.0
|
||||
|
@ -1007,7 +1007,7 @@ importers:
|
|||
packages/pro/plus-core:
|
||||
dependencies:
|
||||
'@certd/basic':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/basic
|
||||
dayjs:
|
||||
specifier: ^1.11.7
|
||||
|
@ -1297,10 +1297,10 @@ importers:
|
|||
version: 0.1.3(zod@3.24.4)
|
||||
devDependencies:
|
||||
'@certd/lib-iframe':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../libs/lib-iframe
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/pipeline
|
||||
'@rollup/plugin-commonjs':
|
||||
specifier: ^25.0.7
|
||||
|
@ -1483,46 +1483,46 @@ importers:
|
|||
specifier: ^3.705.0
|
||||
version: 3.810.0(aws-crt@1.26.2)
|
||||
'@certd/acme-client':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/acme-client
|
||||
'@certd/basic':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/basic
|
||||
'@certd/commercial-core':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../pro/commercial-core
|
||||
'@certd/cv4pve-api-javascript':
|
||||
specifier: ^8.4.2
|
||||
version: 8.4.2
|
||||
'@certd/jdcloud':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../libs/lib-jdcloud
|
||||
'@certd/lib-huawei':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../libs/lib-huawei
|
||||
'@certd/lib-k8s':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../libs/lib-k8s
|
||||
'@certd/lib-server':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../libs/lib-server
|
||||
'@certd/midway-flyway-js':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../libs/midway-flyway-js
|
||||
'@certd/pipeline':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../core/pipeline
|
||||
'@certd/plugin-cert':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../plugins/plugin-cert
|
||||
'@certd/plugin-lib':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../plugins/plugin-lib
|
||||
'@certd/plugin-plus':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../pro/plugin-plus
|
||||
'@certd/plus-core':
|
||||
specifier: ^1.36.17
|
||||
specifier: ^1.36.18
|
||||
version: link:../../pro/plus-core
|
||||
'@huaweicloud/huaweicloud-sdk-cdn':
|
||||
specifier: ^3.1.120
|
||||
|
@ -1708,8 +1708,8 @@ importers:
|
|||
specifier: ^1.4.0
|
||||
version: 1.4.0
|
||||
tencentcloud-sdk-nodejs:
|
||||
specifier: ^4.0.983
|
||||
version: 4.1.37(encoding@0.1.13)
|
||||
specifier: ^4.1.112
|
||||
version: 4.1.112(encoding@0.1.13)
|
||||
typeorm:
|
||||
specifier: ^0.3.20
|
||||
version: 0.3.24(better-sqlite3@11.10.0)(mysql2@3.14.1)(pg@8.16.0)(reflect-metadata@0.2.2)(ts-node@10.9.2(@types/node@18.19.100)(typescript@5.8.3))
|
||||
|
@ -12242,6 +12242,10 @@ packages:
|
|||
temp-path@1.0.0:
|
||||
resolution: {integrity: sha512-TvmyH7kC6ZVTYkqCODjJIbgvu0FKiwQpZ4D1aknE7xpcDf/qEOB8KZEK5ef2pfbVoiBhNWs3yx4y+ESMtNYmlg==}
|
||||
|
||||
tencentcloud-sdk-nodejs@4.1.112:
|
||||
resolution: {integrity: sha512-30Ju53bTd3OjMRwfieDvEYvjHhHVg2Eqc0EM7H8gKEWq0y3xMEdrxgYRrjhIkRo5Doc5YEOl6uUJUCfeT7dmFA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
tencentcloud-sdk-nodejs@4.1.37:
|
||||
resolution: {integrity: sha512-rQV/jaUHGsB71JarqFdDJTl5tC2kIavgSUqlh8JoOUNpfJoAD4qHm1GLdDTUTEPKhv3qF9Is3qo6lj4cG9kKuw==}
|
||||
engines: {node: '>=10'}
|
||||
|
@ -27035,6 +27039,20 @@ snapshots:
|
|||
|
||||
temp-path@1.0.0: {}
|
||||
|
||||
tencentcloud-sdk-nodejs@4.1.112(encoding@0.1.13):
|
||||
dependencies:
|
||||
form-data: 3.0.3
|
||||
get-stream: 6.0.1
|
||||
https-proxy-agent: 5.0.1
|
||||
is-stream: 2.0.1
|
||||
json-bigint: 1.0.0
|
||||
node-fetch: 2.7.0(encoding@0.1.13)
|
||||
tslib: 1.13.0
|
||||
uuid: 9.0.1
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
- supports-color
|
||||
|
||||
tencentcloud-sdk-nodejs@4.1.37(encoding@0.1.13):
|
||||
dependencies:
|
||||
form-data: 3.0.3
|
||||
|
|
Loading…
Reference in New Issue