Dashboard Redesign (#48)

* feat: add user_template setting

* style: header

* style: page padding

* style: header

* feat: header now time

* style: login page

* feat: nav indicator

* style: button inset shadow

* style: footer text size

* feat: header show login_ip

* fix: error toast

* fix: frontend_templates setting

* fix: lint

* feat: pr auto format

* chore: auto-fix linting and formatting issues

---------

Co-authored-by: hamster1963 <hamster1963@users.noreply.github.com>
This commit is contained in:
仓鼠
2024-12-13 23:51:33 +08:00
committed by GitHub
parent b04ef1bb72
commit 8c8d3e3057
132 changed files with 13242 additions and 12878 deletions

View File

@@ -1,6 +1,6 @@
import i18next from "i18next";
import i18next from "i18next"
export const triggerModes: Record<number, string> = {
0: i18next.t("Always"),
1: i18next.t("Once"),
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
import { ModelProfile } from "@/types";
import { ModelProfile } from "@/types"
export interface AuthContextProps {
profile: ModelProfile | undefined;
login: (username: string, password: string) => void;
logout: () => void;
}
profile: ModelProfile | undefined
login: (username: string, password: string) => void
logout: () => void
}

View File

@@ -1,4 +1,5 @@
import i18next from "i18next";
import i18next from "i18next"
export const cronTypes: Record<number, string> = {
0: i18next.t("Scheduled"),
1: i18next.t("Trigger"),
@@ -9,4 +10,3 @@ export const cronCoverageTypes: Record<number, string> = {
1: i18next.t("Coverages.Excludes"),
2: i18next.t("Coverages.Alarmed"),
}

View File

@@ -1,6 +1,6 @@
export interface FMEntry {
type: number,
name: string,
type: number
name: string
}
export enum FMOpcode {
@@ -10,16 +10,16 @@ export enum FMOpcode {
}
export const FMIdentifier = {
file: new Uint8Array([0x4E, 0x5A, 0x54, 0x44]), // NZTD
fileName: new Uint8Array([0x4E, 0x5A, 0x46, 0x4E]), // NZFN
error: new Uint8Array([0x4E, 0x45, 0x52, 0x52]), // NERR
complete: new Uint8Array([0x4E, 0x5A, 0x55, 0x50]), // NZUP
file: new Uint8Array([0x4e, 0x5a, 0x54, 0x44]), // NZTD
fileName: new Uint8Array([0x4e, 0x5a, 0x46, 0x4e]), // NZFN
error: new Uint8Array([0x4e, 0x45, 0x52, 0x52]), // NERR
complete: new Uint8Array([0x4e, 0x5a, 0x55, 0x50]), // NZUP
}
export interface FMWorkerPost {
operation: number;
arrayBuffer: ArrayBuffer;
fileName: string;
operation: number
arrayBuffer: ArrayBuffer
fileName: string
}
export enum FMWorkerOpcode {
@@ -29,9 +29,9 @@ export enum FMWorkerOpcode {
}
export interface FMWorkerData {
type: FMWorkerOpcode,
error: string,
blob?: Blob,
progress?: string,
fileName?: string,
type: FMWorkerOpcode
error: string
blob?: Blob
progress?: string
fileName?: string
}

View File

@@ -1,14 +1,14 @@
export * from './mainStore';
export * from './authContext';
export * from './api';
export * from './service';
export * from './ddns';
export * from './serverStore';
export * from './serverContext';
export * from './cron';
export * from './notification';
export * from './alert-rule';
export * from './notificationStore';
export * from './notificationContext';
export * from './fm';
export * from './settings';
export * from "./mainStore"
export * from "./authContext"
export * from "./api"
export * from "./service"
export * from "./ddns"
export * from "./serverStore"
export * from "./serverContext"
export * from "./cron"
export * from "./notification"
export * from "./alert-rule"
export * from "./notificationStore"
export * from "./notificationContext"
export * from "./fm"
export * from "./settings"

View File

@@ -1,6 +1,6 @@
import { ModelProfile } from "@/types";
import { ModelProfile } from "@/types"
export interface MainStore {
profile: ModelProfile | undefined;
setProfile: (profile: ModelProfile | undefined) => void;
profile: ModelProfile | undefined
setProfile: (profile: ModelProfile | undefined) => void
}

View File

@@ -1,6 +1,6 @@
import { NotificationIdentifierType, ModelNotificationGroupResponseItem } from "@/types";
import { ModelNotificationGroupResponseItem, NotificationIdentifierType } from "@/types"
export interface NotificationContextProps {
notifiers?: NotificationIdentifierType[];
notifierGroup?: ModelNotificationGroupResponseItem[];
notifiers?: NotificationIdentifierType[]
notifierGroup?: ModelNotificationGroupResponseItem[]
}

View File

@@ -1,13 +1,13 @@
import { ModelNotificationGroupResponseItem } from "@/types";
import { ModelNotificationGroupResponseItem } from "@/types"
export interface NotificationIdentifierType {
id: number;
name: string;
id: number
name: string
}
export interface NotificationStore {
notifiers?: NotificationIdentifierType[];
notifierGroup?: ModelNotificationGroupResponseItem[];
setNotifier: (notifiers?: NotificationIdentifierType[]) => void;
setNotifierGroup: (notifierGroup?: ModelNotificationGroupResponseItem[]) => void;
notifiers?: NotificationIdentifierType[]
notifierGroup?: ModelNotificationGroupResponseItem[]
setNotifier: (notifiers?: NotificationIdentifierType[]) => void
setNotifierGroup: (notifierGroup?: ModelNotificationGroupResponseItem[]) => void
}

View File

@@ -1,6 +1,6 @@
import { ModelServerGroupResponseItem, ServerIdentifierType } from "@/types";
import { ModelServerGroupResponseItem, ServerIdentifierType } from "@/types"
export interface ServerContextProps {
servers?: ServerIdentifierType[];
serverGroups?: ModelServerGroupResponseItem[];
servers?: ServerIdentifierType[]
serverGroups?: ModelServerGroupResponseItem[]
}

View File

@@ -1,13 +1,13 @@
import { ModelServerGroupResponseItem } from "@/types";
import { ModelServerGroupResponseItem } from "@/types"
export interface ServerIdentifierType {
id: number;
name: string;
id: number
name: string
}
export interface ServerStore {
server?: ServerIdentifierType[];
serverGroup?: ModelServerGroupResponseItem[];
setServer: (server?: ServerIdentifierType[]) => void;
setServerGroup: (serverGroup?: ModelServerGroupResponseItem[]) => void;
server?: ServerIdentifierType[]
serverGroup?: ModelServerGroupResponseItem[]
setServer: (server?: ServerIdentifierType[]) => void
setServerGroup: (serverGroup?: ModelServerGroupResponseItem[]) => void
}

View File

@@ -1,4 +1,5 @@
import i18next from "i18next";
import i18next from "i18next"
export const serviceTypes: Record<number, string> = {
1: "HTTP GET",
2: "ICMP Ping",

View File

@@ -1,4 +1,5 @@
import i18next from "i18next";
import i18next from "i18next"
export const settingCoverageTypes: Record<number, string> = {
1: i18next.t("Coverages.Excludes"),
2: i18next.t("Coverages.Only"),