mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Show transit vehicle facts, motion and a fleet breakdown in Context
A transit vehicle picked on the map now finds its record in Context (the click carries the feed and vehicle key), so the card shows its operator, place, route, report age and the operator's last reported state in plain words. The layer card breaks transit in view down by motion (moving, stopped, waiting for an update, no recent fix), mode, operator, last reported state and crowding where the feed has it; vehicle-position feeds carry no timetable, so early or late is not shown. Rows in the in-view list carry a motion icon.
This commit is contained in:
1 parent
5c580cbd4a
commit
0fe6fd2bb8
6 files changed
+159
-5
No files matched your search
@@ -464,6 +464,23 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* A moving item's state on its row: green moving, amber stopped, grey
|
||||
while its feed has nothing new. */
|
||||
.view-context__row-motion {
|
||||
flex: none;
|
||||
margin-right: 6px;
|
||||
color: rgba(199, 214, 222, 0.5);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.view-context__row-motion[data-motion='moving'] {
|
||||
color: #5dff9f;
|
||||
}
|
||||
|
||||
.view-context__row-motion[data-motion='stopped'] {
|
||||
color: #ffb86b;
|
||||
}
|
||||
|
||||
.view-context__row-meta {
|
||||
flex: none;
|
||||
color: rgba(199, 214, 222, 0.55);
|
||||
@@ -1144,7 +1161,8 @@
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.cctv-preview__frame img {
|
||||
.cctv-preview__frame img,
|
||||
.cctv-preview__live {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
|
||||
@@ -19,6 +19,16 @@ import AltitudeGraph from './AltitudeGraph.vue';
|
||||
// that item's card. It reads again when the camera settles, and every few
|
||||
// seconds so moving things stay current.
|
||||
const store = useEntityCardStore();
|
||||
|
||||
// What a moving item is doing, as the layer's own display shows it (transit
|
||||
// vehicles report it): an icon on its row, its words on hover.
|
||||
const MOTION_STATES = {
|
||||
moving: { icon: 'play_arrow', label: () => t('Moving') },
|
||||
stopped: { icon: 'pause', label: () => t('Stopped', { context: 'vehicle motion' }) },
|
||||
waiting: { icon: 'schedule', label: () => t('Waiting for update') },
|
||||
'no-fix': { icon: 'location_off', label: () => t('No recent fix') },
|
||||
};
|
||||
const motionOf = (item) => MOTION_STATES[item.identity?.record?.motion] || null;
|
||||
const { view } = storeToRefs(store);
|
||||
const tick = ref(0);
|
||||
let timer = null;
|
||||
@@ -348,6 +358,14 @@ const distance = (km) =>
|
||||
<ul>
|
||||
<li v-for="item in group.items" :key="item.key">
|
||||
<button type="button" @click="store.select(item.identity, { fly: true })">
|
||||
<span
|
||||
v-if="motionOf(item)"
|
||||
class="material-symbols-outlined view-context__row-motion"
|
||||
:data-motion="item.identity.record.motion"
|
||||
:title="motionOf(item).label()"
|
||||
role="img"
|
||||
:aria-label="motionOf(item).label()"
|
||||
>{{ motionOf(item).icon }}</span>
|
||||
<span class="view-context__row-title">{{ item.title }}</span>
|
||||
<span class="view-context__row-meta">{{ distance(item.distanceKm) }}</span>
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user