initial
This commit is contained in:
50
dist_ts_web/services/admin-state.d.ts
vendored
Normal file
50
dist_ts_web/services/admin-state.d.ts
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { IServiceStatus, IIncidentDetails, IStatusPageConfig, IMonitorFormData, IIncidentFormData } from '../interfaces/index.js';
|
||||
type TStateChangeListener<T> = (data: T) => void;
|
||||
/**
|
||||
* Simple observable implementation for state changes
|
||||
*/
|
||||
declare class SimpleObservable<T> {
|
||||
private listeners;
|
||||
subscribe(listener: TStateChangeListener<T>): () => void;
|
||||
next(value: T): void;
|
||||
}
|
||||
/**
|
||||
* Centralized state management for the admin dashboard.
|
||||
* Handles cross-view data passing and state synchronization.
|
||||
*/
|
||||
export declare class AdminState {
|
||||
monitors$: SimpleObservable<IServiceStatus[]>;
|
||||
incidents$: SimpleObservable<IIncidentDetails[]>;
|
||||
config$: SimpleObservable<IStatusPageConfig>;
|
||||
private _monitors;
|
||||
private _incidents;
|
||||
private _config;
|
||||
private _selectedMonitor;
|
||||
private _selectedIncident;
|
||||
get monitors(): IServiceStatus[];
|
||||
set monitors(value: IServiceStatus[]);
|
||||
get incidents(): IIncidentDetails[];
|
||||
set incidents(value: IIncidentDetails[]);
|
||||
get config(): IStatusPageConfig | null;
|
||||
set config(value: IStatusPageConfig | null);
|
||||
setSelectedMonitor(monitor: IServiceStatus | null): void;
|
||||
getSelectedMonitor(): IServiceStatus | null;
|
||||
clearSelectedMonitor(): void;
|
||||
setSelectedIncident(incident: IIncidentDetails | null): void;
|
||||
getSelectedIncident(): IIncidentDetails | null;
|
||||
clearSelectedIncident(): void;
|
||||
getCategories(): string[];
|
||||
getAvailableServices(): IServiceStatus[];
|
||||
getMonitorById(id: string): IServiceStatus | undefined;
|
||||
getIncidentById(id: string): IIncidentDetails | undefined;
|
||||
getActiveIncidents(): IIncidentDetails[];
|
||||
getPastIncidents(): IIncidentDetails[];
|
||||
addMonitor(monitor: IServiceStatus): void;
|
||||
updateMonitor(id: string, data: Partial<IMonitorFormData>): void;
|
||||
deleteMonitor(id: string): void;
|
||||
addIncident(incident: IIncidentDetails): void;
|
||||
updateIncident(id: string, data: Partial<IIncidentFormData>): void;
|
||||
deleteIncident(id: string): void;
|
||||
}
|
||||
export declare const adminState: AdminState;
|
||||
export {};
|
||||
125
dist_ts_web/services/admin-state.js
Normal file
125
dist_ts_web/services/admin-state.js
Normal file
File diff suppressed because one or more lines are too long
1
dist_ts_web/services/index.d.ts
vendored
Normal file
1
dist_ts_web/services/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './admin-state.js';
|
||||
2
dist_ts_web/services/index.js
Normal file
2
dist_ts_web/services/index.js
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './admin-state.js';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90c193ZWIvc2VydmljZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxrQkFBa0IsQ0FBQyJ9
|
||||
Reference in New Issue
Block a user