File size: 2,804 Bytes
96dd062 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | import type { AdminConfigData } from "@/types/admin";
import type {
AdConfig,
AnnouncementConfig,
BackgroundWallpaperConfig,
CommentConfig,
CoverImageConfig,
FriendLink,
FriendsPageConfig,
FontConfig,
FooterConfig,
LicenseConfig,
Live2DModelConfig,
MusicPlayerConfig,
NavBarConfig,
ProfileConfig,
SakuraConfig,
SidebarLayoutConfig,
SiteConfig,
SponsorConfig,
SpineModelConfig,
} from "@/types/config";
export type AdminEditableConfig = AdminConfigData & {
sakura: SakuraConfig;
};
export type AdminConfigSection = keyof AdminEditableConfig;
export type AdminConfigBundle = {
siteConfig: SiteConfig;
profileConfig: ProfileConfig;
navBarConfig: NavBarConfig;
sidebarConfig: SidebarLayoutConfig;
backgroundWallpaper: BackgroundWallpaperConfig;
announcementConfig: AnnouncementConfig;
footerConfig: FooterConfig;
adConfig: {
adConfig1: AdConfig;
adConfig2: AdConfig;
};
commentConfig: CommentConfig;
musicConfig: MusicPlayerConfig;
pioConfig: {
spineModelConfig: SpineModelConfig;
live2dModelConfig: Live2DModelConfig;
};
sponsorConfig: SponsorConfig;
friendsConfig: {
friendsPageConfig: FriendsPageConfig;
friendsConfig: FriendLink[];
};
licenseConfig: LicenseConfig;
coverImageConfig: CoverImageConfig;
sakuraConfig: SakuraConfig;
fontConfig: FontConfig;
};
export type AdminPostRecord = {
slug: string;
filePath: string;
title: string;
published: string;
updated: string;
description: string;
image: string;
tags: string[];
category: string;
lang: string;
draft: boolean;
pinned: boolean;
comment: boolean;
author: string;
sourceLink: string;
licenseName: string;
licenseUrl: string;
body: string;
extension?: "md" | "mdx";
excerpt?: string;
modifiedAt?: string;
};
export type AdminSpecPageRecord = {
slug: string;
filePath: string;
body: string;
extension?: "md" | "mdx";
modifiedAt?: string;
};
export type AdminImageRecord = {
id: string;
name: string;
path: string;
url: string;
directory: string;
origin: "public" | "content";
size: number;
updatedAt: string;
sitePath?: string;
};
export type AdminSnapshot = {
generatedAt: string;
configs: AdminConfigBundle;
posts: AdminPostRecord[];
specPages: AdminSpecPageRecord[];
images: AdminImageRecord[];
};
export type AdminBuildState = "idle" | "queued" | "building" | "success" | "error";
export type AdminBuildStatus = {
state: AdminBuildState;
message?: string;
lastStartedAt?: string;
lastFinishedAt?: string;
lastDurationMs?: number;
queueLength?: number;
siteUpdatedAt?: string;
logLines?: string[];
};
export type AdminSessionResponse = {
authenticated: boolean;
configured?: boolean;
username?: string;
buildStatus?: AdminBuildStatus;
};
export type AdminPostSavePayload = {
originalSlug?: string;
post: AdminPostRecord;
};
|