refactor(ui): useZustandShallowSelector
This commit is contained in:
@@ -23,5 +23,11 @@ export const save = async (record: MaybeModelRecord<AccessModel>) => {
|
||||
|
||||
export const remove = async (record: MaybeModelRecordWithId<AccessModel>) => {
|
||||
record = { ...record, deleted: dayjs.utc().format("YYYY-MM-DD HH:mm:ss") };
|
||||
|
||||
// TODO: 仅为兼容旧版本,后续迭代时删除
|
||||
if ("configType" in record && record.configType === "httpreq") record.configType = "acmehttpreq";
|
||||
if ("configType" in record && record.configType === "tencent") record.configType = "tencentcloud";
|
||||
if ("configType" in record && record.configType === "pdns") record.configType = "powerdns";
|
||||
|
||||
await getPocketBase().collection(COLLECTION_NAME).update<AccessModel>(record.id!, record);
|
||||
};
|
||||
|
||||
@@ -36,3 +36,9 @@ export const list = async (request: ListCertificateRequest) => {
|
||||
|
||||
return pb.collection(COLLECTION_NAME).getList<CertificateModel>(page, perPage, options);
|
||||
};
|
||||
|
||||
export const remove = async (record: MaybeModelRecordWithId<CertificateModel>) => {
|
||||
record = { ...record, deleted: dayjs.utc().format("YYYY-MM-DD HH:mm:ss") };
|
||||
|
||||
await getPocketBase().collection(COLLECTION_NAME).update<CertificateModel>(record.id!, record);
|
||||
};
|
||||
|
||||
@@ -17,7 +17,11 @@ export const list = async (request: ListWorkflowRequest) => {
|
||||
const page = request.page || 1;
|
||||
const perPage = request.perPage || 10;
|
||||
|
||||
const options: RecordListOptions = { requestKey: null, sort: "-created" };
|
||||
const options: RecordListOptions = {
|
||||
sort: "-created",
|
||||
requestKey: null,
|
||||
};
|
||||
|
||||
if (request.enabled != null) {
|
||||
options.filter = pb.filter("enabled={:enabled}", { enabled: request.enabled });
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { type WorkflowRunLog } from "@/domain/workflow";
|
||||
import { getPocketBase } from "./pocketbase";
|
||||
|
||||
const COLLECTION_NAME = "workflow_run_log";
|
||||
|
||||
export type ListWorkflowLogsRequest = {
|
||||
id: string;
|
||||
page?: number;
|
||||
@@ -12,7 +14,7 @@ export const list = async (request: ListWorkflowLogsRequest) => {
|
||||
const perPage = request.perPage || 10;
|
||||
|
||||
return await getPocketBase()
|
||||
.collection("workflow_run_log")
|
||||
.collection(COLLECTION_NAME)
|
||||
.getList<WorkflowRunLog>(page, perPage, {
|
||||
filter: getPocketBase().filter("workflow={:workflowId}", { workflowId: request.id }),
|
||||
sort: "-created",
|
||||
|
||||
Reference in New Issue
Block a user