@@ -136,19 +183,73 @@
@@ -172,18 +273,112 @@ export default class StationCard extends styleMixin {
&-content {
display: grid;
- grid-template-areas: "main main" "icons icons" "dispatcher hours" "users spawns";
+ grid-template-areas: "main main" "icons icons" "dispatcher hours" "users spawns" "history history";
grid-template-columns: repeat(2, minmax(0, 1fr));
min-width: 200px;
gap: 1.5em;
+ margin-bottom: 2.5rem;
+
+ &.offline {
+ .users,
+ .spawns,
+ .dispatcher {
+ filter: grayscale(1);
+ opacity: 0.5;
+ }
+ }
+
@include smallScreen() {
grid-template-areas: "main main" "icons icons" "dispatcher dispatcher" "hours hours" "users spawns";
}
}
}
+.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;
+ }
+
+ &-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/views/StationsView.vue b/src/views/StationsView.vue
index 3347884..11231b1 100644
--- a/src/views/StationsView.vue
+++ b/src/views/StationsView.vue
@@ -5,7 +5,12 @@
-
+
@@ -61,6 +66,24 @@ 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
@@ -68,7 +91,6 @@ export default class StationsView extends Vue {
}
async mounted() {
- // const { docs } = await db.collection("history").get();
// docs.forEach((doc) => {
// console.log(doc.data());
// });