Clean-up kodu

This commit is contained in:
2021-06-11 00:34:00 +02:00
parent 5f028fe9c8
commit e90911dd98
4 changed files with 44 additions and 2294 deletions
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;
+1 -1
View File
@@ -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[];
}
+10 -8
View File
@@ -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`
)