mirror of
https://github.com/Spythere/station-manager-2.0.git
synced 2026-05-03 13:38:13 +00:00
update: auth & update modal
This commit is contained in:
+103
-85
@@ -1,85 +1,103 @@
|
||||
export type Availability = 'default' | 'unavailable' | 'nonPublic' | 'abandoned' | 'nonDefault';
|
||||
export type ChangeProp =
|
||||
| 'name'
|
||||
| 'url'
|
||||
| 'lines'
|
||||
| 'project'
|
||||
| 'reqLevel'
|
||||
| 'signalType'
|
||||
| 'controlType'
|
||||
| 'SUP'
|
||||
| 'routes'
|
||||
| 'checkpoints'
|
||||
| 'authors'
|
||||
| 'availability';
|
||||
|
||||
export enum HeaderTypes {
|
||||
name = 'Nazwa',
|
||||
url = 'URL',
|
||||
lines = 'Linie',
|
||||
project = 'Projekt',
|
||||
reqLevel = 'Wym. poziom',
|
||||
signalType = 'Sygnalizacja',
|
||||
controlType = 'Sterowanie',
|
||||
SUP = 'SUP',
|
||||
authors = 'Autorzy',
|
||||
routes = 'Szlaki',
|
||||
checkpoints = 'Posterunki',
|
||||
availability = 'Dostępność',
|
||||
toRemove = 'Usuń',
|
||||
}
|
||||
|
||||
export enum AvailabilityTypes {
|
||||
'default' = 'w paczce',
|
||||
'nonDefault' = 'poza paczką',
|
||||
'nonPublic' = 'niepubliczna',
|
||||
'abandoned' = 'wycofana',
|
||||
'unavailable' = 'niedostępna',
|
||||
}
|
||||
|
||||
export interface SceneryRowItem {
|
||||
id: string;
|
||||
name: string;
|
||||
url: string;
|
||||
lines: string;
|
||||
project: string | null;
|
||||
reqLevel: number;
|
||||
signalType: string;
|
||||
controlType: string;
|
||||
SUP: boolean;
|
||||
routes: string;
|
||||
checkpoints: string;
|
||||
authors: string;
|
||||
availability: Availability;
|
||||
}
|
||||
|
||||
export type ChangeItem = {
|
||||
[key in ChangeProp]?: string | number | boolean | null;
|
||||
} & {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
toRemove?: boolean;
|
||||
};
|
||||
|
||||
export interface IStore {
|
||||
dataState: string;
|
||||
unsavedChanges: boolean;
|
||||
stationList: SceneryRowItem[];
|
||||
backupList: SceneryRowItem[];
|
||||
stationsToRemove: string[];
|
||||
searchedSceneryName: string;
|
||||
changeList: ChangeItem[];
|
||||
newStationsCount: number;
|
||||
routesModalVisible: boolean;
|
||||
currentStation: SceneryRowItem | null;
|
||||
selectedStationName: string;
|
||||
token: string | null;
|
||||
user: { name: string; id: string } | null;
|
||||
isAuthorized: boolean;
|
||||
notifyDiscord: boolean;
|
||||
alertMessage: string;
|
||||
confirmMessage: string;
|
||||
|
||||
changesResponse: string[];
|
||||
}
|
||||
export type Availability = 'default' | 'unavailable' | 'nonPublic' | 'abandoned' | 'nonDefault';
|
||||
export type ChangeProp =
|
||||
| 'name'
|
||||
| 'url'
|
||||
| 'lines'
|
||||
| 'project'
|
||||
| 'reqLevel'
|
||||
| 'signalType'
|
||||
| 'controlType'
|
||||
| 'SUP'
|
||||
| 'routes'
|
||||
| 'checkpoints'
|
||||
| 'authors'
|
||||
| 'availability';
|
||||
|
||||
export enum HeaderTypes {
|
||||
name = 'Nazwa',
|
||||
url = 'URL',
|
||||
lines = 'Linie',
|
||||
project = 'Projekt',
|
||||
reqLevel = 'Wym. poziom',
|
||||
signalType = 'Sygnalizacja',
|
||||
controlType = 'Sterowanie',
|
||||
SUP = 'SUP',
|
||||
authors = 'Autorzy',
|
||||
routes = 'Szlaki',
|
||||
checkpoints = 'Posterunki',
|
||||
availability = 'Dostępność',
|
||||
toRemove = 'Usuń',
|
||||
}
|
||||
|
||||
export enum AvailabilityTypes {
|
||||
'default' = 'w paczce',
|
||||
'nonDefault' = 'poza paczką',
|
||||
'nonPublic' = 'niepubliczna',
|
||||
'abandoned' = 'wycofana',
|
||||
'unavailable' = 'niedostępna',
|
||||
}
|
||||
|
||||
export interface SceneryRowItem {
|
||||
id: string;
|
||||
name: string;
|
||||
url: string;
|
||||
lines: string;
|
||||
project: string | null;
|
||||
reqLevel: number;
|
||||
signalType: string;
|
||||
controlType: string;
|
||||
SUP: boolean;
|
||||
routes: string;
|
||||
checkpoints: string;
|
||||
authors: string;
|
||||
availability: Availability;
|
||||
}
|
||||
|
||||
export type ChangeItem = {
|
||||
[key in ChangeProp]?: string | number | boolean | null;
|
||||
} & {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
toRemove?: boolean;
|
||||
};
|
||||
|
||||
export enum AuthState {
|
||||
'LOADING' = 0,
|
||||
'AUTHORIZED' = 1,
|
||||
'UNAUTHORIZED' = 2,
|
||||
}
|
||||
|
||||
export interface IStore {
|
||||
dataState: string;
|
||||
authState: AuthState;
|
||||
|
||||
unsavedChanges: boolean;
|
||||
stationList: SceneryRowItem[];
|
||||
backupList: SceneryRowItem[];
|
||||
stationsToRemove: string[];
|
||||
searchedSceneryName: string;
|
||||
changeList: ChangeItem[];
|
||||
newStationsCount: number;
|
||||
routesModalVisible: boolean;
|
||||
currentStation: SceneryRowItem | null;
|
||||
selectedStationName: string;
|
||||
token: string | null;
|
||||
user: { name: string; id: string } | null;
|
||||
isAuthorized: boolean;
|
||||
notifyDiscord: boolean;
|
||||
alertMessage: string;
|
||||
confirmMessage: string;
|
||||
|
||||
changesResponse: string[];
|
||||
}
|
||||
|
||||
export interface ILoginResponse {
|
||||
token: string;
|
||||
user: IUser;
|
||||
}
|
||||
|
||||
export interface IUser {
|
||||
name: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user