feat(ui): optimize table UI

This commit is contained in:
Fu Diwei
2024-12-08 21:10:22 +08:00
parent 5c6be439e8
commit 7db933199a
14 changed files with 199 additions and 144 deletions

View File

@@ -1,7 +1,7 @@
import { type RecordListOptions } from "pocketbase";
import moment from "moment";
import { type Certificate } from "@/domain/certificate";
import { getTimeAfter } from "@/lib/time";
import { getPocketBase } from "./pocketbase";
export type CertificateListReq = {
@@ -23,7 +23,7 @@ export const list = async (req: CertificateListReq) => {
if (req.state === "expireSoon") {
options.filter = pb.filter("expireAt<{:expiredAt}", {
expiredAt: getTimeAfter(15),
expiredAt: moment().add(15, "d").toDate(),
});
} else if (req.state === "expired") {
options.filter = pb.filter("expireAt<={:expiredAt}", {