Add registration flow and improve admin post management

This commit is contained in:
爱喝水的木子
2026-03-19 20:17:56 +08:00
parent 50a1e476c8
commit 17f5f6adcb
28 changed files with 799 additions and 192 deletions

23
lib/opc.ts Normal file
View File

@@ -0,0 +1,23 @@
export const OPC_SIGNAL_VALUES = ["solo-feed"] as const;
export type OpcSignalValue = (typeof OPC_SIGNAL_VALUES)[number];
export const OPC_SIGNAL_LABELS: Record<OpcSignalValue, string> = {
"solo-feed": "solo-feed"
};
export const DEFAULT_OPC_SIGNAL: OpcSignalValue = "solo-feed";
const OPC_SIGNAL_SET = new Set<string>(OPC_SIGNAL_VALUES);
export function isOpcSignal(value?: string | null): value is OpcSignalValue {
if (!value) return false;
return OPC_SIGNAL_SET.has(value);
}
export function getOpcSignalLabel(value?: string | null): string {
if (value && OPC_SIGNAL_SET.has(value)) {
return OPC_SIGNAL_LABELS[value as OpcSignalValue];
}
return OPC_SIGNAL_LABELS[DEFAULT_OPC_SIGNAL];
}