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