mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Clean-up kodu
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,33 +1,33 @@
|
||||
interface ISceneryInfoData {
|
||||
stationName: string;
|
||||
stationURL: string;
|
||||
stationLines: string;
|
||||
stationProject: string;
|
||||
|
||||
reqLevel: string;
|
||||
supportersOnly: string;
|
||||
signalType: string;
|
||||
controlType: string;
|
||||
SBL: string;
|
||||
twoWayBlock: string;
|
||||
|
||||
routesOneWayCatenary: number;
|
||||
routesOneWayOther: number;
|
||||
routesTwoWayCatenary: number;
|
||||
routesToWayOther: number;
|
||||
|
||||
default: boolean;
|
||||
nonPublic: boolean;
|
||||
unavailable: boolean;
|
||||
hasData: boolean;
|
||||
|
||||
stops: string[];
|
||||
checkpoints: string[];
|
||||
|
||||
currentDispatcher: string;
|
||||
currentDispatcherId: number;
|
||||
currentDispatcherFrom: number;
|
||||
dispatcherHistory: { dispatcherName: string; dispatcherId: number; dispatcherFrom: number; dispatcherTo: number }[];
|
||||
}
|
||||
|
||||
export default ISceneryInfoData;
|
||||
interface Scenery {
|
||||
stationName: string;
|
||||
stationURL: string;
|
||||
stationLines: string;
|
||||
stationProject: string;
|
||||
|
||||
reqLevel: string;
|
||||
supportersOnly: string;
|
||||
signalType: string;
|
||||
controlType: string;
|
||||
SBL: string;
|
||||
twoWayBlock: string;
|
||||
|
||||
routesOneWayCatenary: number;
|
||||
routesOneWayOther: number;
|
||||
routesTwoWayCatenary: number;
|
||||
routesToWayOther: number;
|
||||
|
||||
default: boolean;
|
||||
nonPublic: boolean;
|
||||
unavailable: boolean;
|
||||
hasData: boolean;
|
||||
|
||||
stops: string[];
|
||||
checkpoints: string[];
|
||||
|
||||
currentDispatcher: string;
|
||||
currentDispatcherId: number;
|
||||
currentDispatcherFrom: number;
|
||||
dispatcherHistory: { dispatcherName: string; dispatcherId: number; dispatcherFrom: number; dispatcherTo: number }[];
|
||||
}
|
||||
|
||||
export default Scenery;
|
||||
@@ -47,7 +47,6 @@ export default interface Station {
|
||||
stops: string[] | null;
|
||||
|
||||
online: boolean;
|
||||
// occupiedTo: string;
|
||||
statusTimestamp: number;
|
||||
statusTimeString: string;
|
||||
statusID: string;
|
||||
@@ -56,5 +55,6 @@ export default interface Station {
|
||||
driverName: number;
|
||||
trainNo: number;
|
||||
}[];
|
||||
|
||||
scheduledTrains: ScheduledTrain[];
|
||||
}
|
||||
|
||||
@@ -86,15 +86,16 @@ import { Component, Vue, Watch } from "vue-property-decorator";
|
||||
import { Getter } from "vuex-class";
|
||||
|
||||
import Station from "@/scripts/interfaces/Station";
|
||||
import ISceneryInfoData from "@/scripts/interfaces/ISceneryInfoData";
|
||||
import Scenery from "@/scripts/interfaces/Scenery";
|
||||
|
||||
import SelectBox from "@/components/Global/SelectBox.vue";
|
||||
|
||||
@Component({ components: { SelectBox } })
|
||||
export default class HistoryView extends Vue {
|
||||
@Getter("getStationList") stationList!: Station[];
|
||||
|
||||
sceneryHistoryList: ISceneryInfoData[] = [];
|
||||
currentSceneryHistory: ISceneryInfoData["dispatcherHistory"] = [];
|
||||
sceneryHistoryList: Scenery[] = [];
|
||||
currentSceneryHistory: Scenery["dispatcherHistory"] = [];
|
||||
|
||||
currentDispatcher: string = "";
|
||||
currentDispatcherId: number = 0;
|
||||
@@ -107,7 +108,7 @@ export default class HistoryView extends Vue {
|
||||
|
||||
async mounted() {
|
||||
try {
|
||||
const responseData: ISceneryInfoData[] = await (
|
||||
const responseData: Scenery[] = await (
|
||||
await axios.get(
|
||||
"https://stacjownik.herokuapp.com/api/getSceneryInfo?items=-1"
|
||||
)
|
||||
@@ -138,9 +139,10 @@ export default class HistoryView extends Vue {
|
||||
dispatcherFromDate: new Date(dispatcherFrom).toLocaleDateString(
|
||||
"pl-PL"
|
||||
),
|
||||
dispatcherFromTime: new Date(
|
||||
dispatcherFrom
|
||||
).toLocaleTimeString("pl-PL", { hour: "2-digit", minute: "2-digit" }),
|
||||
dispatcherFromTime: new Date(dispatcherFrom).toLocaleTimeString(
|
||||
"pl-PL",
|
||||
{ hour: "2-digit", minute: "2-digit" }
|
||||
),
|
||||
dispatcherToDate: new Date(dispatcherTo).toLocaleDateString("pl-PL"),
|
||||
dispatcherToTime: new Date(dispatcherTo).toLocaleTimeString("pl-PL", {
|
||||
hour: "2-digit",
|
||||
@@ -155,7 +157,7 @@ export default class HistoryView extends Vue {
|
||||
try {
|
||||
this.historyLoading = true;
|
||||
|
||||
const selectedScenery: ISceneryInfoData = await (
|
||||
const selectedScenery: Scenery = await (
|
||||
await axios.get(
|
||||
`https://stacjownik.herokuapp.com/api/getSceneryInfo?name=${itemName}&items=10`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user