-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #176 from mytlogos/status-page
add status page
- Loading branch information
Showing
12 changed files
with
536 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,55 @@ | ||
import { HookConfig } from "enterprise-scraper/dist/externals/custom/types"; | ||
import env from "enterprise-core/dist/env"; | ||
import { memoryUsage } from "process"; | ||
|
||
export interface HookTest { | ||
config: HookConfig; | ||
key: keyof HookConfig; | ||
param: string; | ||
} | ||
|
||
export interface Status { | ||
server: ServerStatus; | ||
crawler: CrawlerStatus; | ||
database: DatabaseStatus; | ||
} | ||
|
||
export interface HookStatus { | ||
all: Array<{ name: string; domain: string; medium: number }>; | ||
toc: Array<{ name: string; pattern: string }>; | ||
download: Array<{ name: string; pattern: string }>; | ||
search: Array<{ name: string }>; | ||
tocSearch: Array<{ name: string; pattern: string }>; | ||
news: Array<{ name: string; link: string }>; | ||
} | ||
|
||
export type CrawlerStatus = | ||
| ({ | ||
status: "available"; | ||
hooks: HookStatus; | ||
} & ServerStatus) | ||
| { status: "timout" | "unavailable" | "invalid" }; | ||
|
||
export type DatabaseStatus = | ||
| { | ||
status: "available"; | ||
type: string; | ||
version: string; | ||
host: string; | ||
} | ||
| { | ||
status: "timout" | "unavailable"; | ||
type: string; | ||
host: string; | ||
}; | ||
|
||
export interface ServerStatus { | ||
cpu_average: [number, number, number] | number[]; | ||
memory: ReturnType<typeof memoryUsage>; | ||
uptime: number; | ||
freemem: number; | ||
totalmem: number; | ||
project_version: string; | ||
node_version: string; | ||
config: Omit<typeof env, "dbPassword">; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.