@@ -190,8 +139,6 @@ import { Component, Prop, Watch } from "vue-property-decorator"; import styleMixin from "@/mixins/styleMixin"; -import db from "@/scripts/firebase/firebaseInit"; - @Component export default class StationCard extends styleMixin { @Prop() stationInfo; @@ -283,8 +230,6 @@ export default class StationCard extends styleMixin { gap: 1.5em; - margin-bottom: 2.5rem; - &.offline { .users, .spawns, @@ -300,91 +245,6 @@ export default class StationCard extends styleMixin { } } -.card-history { - position: absolute; - bottom: 0; - left: 50%; - transform: translateX(-50%); - - overflow: hidden; - - display: flex; - flex-direction: column; - justify-content: space-between; - - // height: 10%; - min-height: 0; - max-height: 90%; - min-width: 100%; - - padding: 0.4rem; - // border-radius: 1em 1em 0 0; - - z-index: 5; - - background: rgba($color: #000000, $alpha: 0.9); - - font-size: 1em; - - transition: min-height 150ms ease-in, min-width 150ms ease-in, - font-size 150ms ease-in; - - // &:hover { - // min-height: 90%; - - // & > .history-list { - // opacity: 1; - // max-height: 350px; - // } - - // & > .history-title { - // font-size: 2em; - // } - // } -} - -.history { - &-title { - transition: font-size 150ms ease-in; - - color: #999; - } - - &-info { - font-size: 1em; - color: #999; - - transition: all 150ms ease-in; - } - - &-list { - max-height: 0; - opacity: 0; - transition: opacity 150ms; - - font-size: 1em; - - transition: max-height 150ms ease-in-out; - - overflow: auto; - } - - &-log { - display: flex; - justify-content: space-between; - align-items: center; - - padding: 0.5em; - margin: 1em; - - background: #333; - - &:nth-child(odd) { - background: rgb(92, 92, 92); - } - } -} - .main { grid-area: main; text-align: center; diff --git a/src/scripts/firebase/firebaseInit.ts b/src/scripts/firebase/firebaseInit.ts index 28429e8..812e14a 100644 --- a/src/scripts/firebase/firebaseInit.ts +++ b/src/scripts/firebase/firebaseInit.ts @@ -1,5 +1,6 @@ import * as firebase from "firebase/app"; import "firebase/firestore"; +import "firebase/functions"; require("dotenv").config(); @@ -10,4 +11,7 @@ firebase.initializeApp({ projectId: "stacjownik-td2", }); -export default firebase.firestore(); +export default { + db: firebase.firestore(), + functions: firebase.functions(), +}; diff --git a/src/views/StationsView.vue b/src/views/StationsView.vue index 6e37feb..b235655 100644 --- a/src/views/StationsView.vue +++ b/src/views/StationsView.vue @@ -4,12 +4,7 @@ - + @@ -35,7 +30,6 @@ import StationTable from "@/components/StationsView/StationTable.vue"; import StationCard from "@/components/StationsView/StationCard.vue"; import Options from "@/components/StationsView/Options.vue"; -import db from "@/scripts/firebase/firebaseInit"; import inputData from "@/data/options.json"; enum ConnState { @@ -109,24 +103,6 @@ export default class StationsView extends Vue { else this.focusedStationName = name; } - get dispatcherHistory() { - return async () => { - let history: any[] = []; - - if (this.focusedStationName != "") { - const historyRef = await db - .collection("history") - .doc(this.focusedStationName) - .collection("dispatcherHistory") - .get(); - - history = historyRef.docs.map((doc) => doc.data()); - } - - return history; - }; - } - get focusedStationInfo() { return this.stations.find( (station) => station.stationName === this.focusedStationName