fix: 修复远程数据选择无法过滤的bug

v2
xiaojunnuo 2025-09-05 22:19:03 +08:00
parent 79ebabfcfb
commit 6cbb0739f8
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import { CoreV1Api, KubeConfig, NetworkingV1Api, V1Ingress, V1Secret } from "@kubernetes/client-node";
import dns from "dns";
import { ILogger } from "@certd/basic";
import _ from "lodash-es";
import { merge } from "lodash-es";
export type K8sClientOpts = {
kubeConfigStr: string;
@ -133,7 +133,7 @@ export class K8sClient {
throw e;
}
const newSecret = _.merge(oldSecret.body, opts.body);
const newSecret = merge(oldSecret.body, opts.body);
const res = await this.client.replaceNamespacedSecret(secretName, namespace, newSecret);
this.logger.info(`secret ${secretName} 已更新`);
return res.body;
@ -167,7 +167,7 @@ export class K8sClient {
this.logger.info("patch ingress:", ingressName, namespace);
const client = this.kubeconfig.makeApiClient(NetworkingV1Api);
const oldIngress = await client.readNamespacedIngress(ingressName, namespace);
const newIngress = _.merge(oldIngress.body, opts.body);
const newIngress = merge(oldIngress.body, opts.body);
const res = await client.replaceNamespacedIngress(ingressName, namespace, newIngress);
this.logger.info("ingress patched", opts.body);
return res;

View File

@ -169,7 +169,7 @@ const getOptions = async () => {
};
const filterOption = (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 || String(option.value).toLowerCase().indexOf(input.toLowerCase());
return option.label.toLowerCase().includes(input.toLowerCase()) || String(option.value).toLowerCase().includes(input.toLowerCase());
};
async function onClick() {