mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Bring Contacts, Space Missions and Radio back into Context
The Context panel's main tab shows the mode row again, with Contacts (nearby sites search, the TR-3B toggle and the Awareness list) and Space Missions (the roster and launch replay); only the Properties tab hides them. Radio shows while its layer is on, and turning Radio or Launches on opens Context. When Contacts follows the aircraft the card shows, its list sits inside the card in a compact form and the card leaves out the flights and vessels Contacts already lists. The card's Enter Cockpit replaces the Contacts button, and leaving the cockpit returns focus to it. Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
1 parent
6e03871d5a
commit
1ce7e51c22
10 files changed
+109
-43
No files matched your search
@@ -8,6 +8,7 @@ import AwarenessNames from './AwarenessNames.vue';
|
||||
// The Contacts panel inside Context. The Contacts layer publishes its view
|
||||
// (standby, results or empty); until it does, the panel shows its initial
|
||||
// markup. Buttons call the layer's navigation as the person's own.
|
||||
const props = defineProps({ compact: Boolean });
|
||||
const { awareness: view, awarenessLayer: layer } = storeToRefs(useContextStore());
|
||||
const user = { origin: 'user' };
|
||||
const root = ref(null);
|
||||
@@ -58,8 +59,8 @@ onUpdated(() => {
|
||||
<span>{{ view.text }}</span>
|
||||
</div>
|
||||
<template v-else-if="view.kind === 'results'">
|
||||
<div class="military-awareness-subject">{{ view.subject }}</div>
|
||||
<a v-if="view.photo && view.photo.src !== failedPhoto" class="military-awareness-photo" :href="view.photo.link" target="_blank" rel="noopener">
|
||||
<div v-if="!props.compact" class="military-awareness-subject">{{ view.subject }}</div>
|
||||
<a v-if="!props.compact && view.photo && view.photo.src !== failedPhoto" class="military-awareness-photo" :href="view.photo.link" target="_blank" rel="noopener">
|
||||
<img :src="view.photo.src" :width="view.photo.width ?? undefined" :height="view.photo.height ?? undefined" alt="" @error="fail" />
|
||||
<small v-if="view.photo.credit">{{ view.photo.credit }}</small>
|
||||
</a>
|
||||
|
||||
@@ -14,6 +14,10 @@ import { countryName, nearestCity } from '../../../data/wikidataCities.js';
|
||||
// The Context panel's card for one thing on the map: what it is, its facts,
|
||||
// links, actions, and what else is near it. It reads from the entity card
|
||||
// store, which the globe click, the omnibar and the nearby list all fill.
|
||||
const props = defineProps({
|
||||
/** Contacts follows this same aircraft, and its list sits inside the card. */
|
||||
withContacts: Boolean,
|
||||
});
|
||||
const store = useEntityCardStore();
|
||||
const { card, lost, tick } = storeToRefs(store);
|
||||
// Cameras carry only an id; the CCTV panel's store knows the picked one's name.
|
||||
@@ -221,9 +225,9 @@ watch(
|
||||
<div class="entity-hero" :data-hero="heroKind">
|
||||
<CctvPreview v-if="heroKind === 'camera'" :camera-id="card.identity?.id || ''" />
|
||||
<!-- No imagery for it yet: its icon, with its headline figures beside it. -->
|
||||
<div v-else class="entity-hero__placeholder" :class="{ 'entity-hero__placeholder--bare': !tiles.length }">
|
||||
<div v-else class="entity-hero__placeholder" :class="{ 'entity-hero__placeholder--bare': props.withContacts || !tiles.length }">
|
||||
<span class="material-symbols-outlined entity-hero__glyph" aria-hidden="true">{{ card.icon }}</span>
|
||||
<div v-if="tiles.length" class="entity-hero__figures">
|
||||
<div v-if="!props.withContacts && tiles.length" class="entity-hero__figures">
|
||||
<div v-for="fact in tiles" :key="fact.field" class="entity-hero__figure">
|
||||
<strong>{{ factFigure(fact).number }}<small v-if="factFigure(fact).unit">{{ factFigure(fact).unit }}</small></strong>
|
||||
<span>{{ factLabel(fact) }}</span>
|
||||
@@ -270,7 +274,7 @@ watch(
|
||||
<span>{{ routePlaces.from }}</span>
|
||||
<span>{{ routePlaces.to }}</span>
|
||||
</p>
|
||||
<AltitudeGraph v-if="altitudeGraphed" :key="`altitude:${card.key}`" :altitude-m="lost ? null : card.altitudeM" :tick="tick" />
|
||||
<AltitudeGraph v-if="altitudeGraphed" v-show="!props.withContacts" :key="`altitude:${card.key}`" :altitude-m="lost ? null : card.altitudeM" :tick="tick" />
|
||||
<p
|
||||
v-if="card.route && !card.route.verified"
|
||||
class="entity-card__route-note"
|
||||
@@ -279,7 +283,7 @@ watch(
|
||||
<span class="material-symbols-outlined" aria-hidden="true">warning</span>{{ t('Scheduled · unverified: does not match where the plane is') }}
|
||||
</p>
|
||||
|
||||
<div v-if="tiles.length && heroKind !== 'none' && !contextNeedle" class="entity-card__tiles" :style="{ gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))` }">
|
||||
<div v-if="!props.withContacts && tiles.length && heroKind !== 'none' && !contextNeedle" class="entity-card__tiles" :style="{ gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))` }">
|
||||
<div v-for="fact in tiles" :key="fact.field" class="entity-card__tile">
|
||||
<span>{{ factLabel(fact) }}</span>
|
||||
<strong>{{ factFigure(fact).number }}<small v-if="factFigure(fact).unit">{{ factFigure(fact).unit }}</small></strong>
|
||||
@@ -303,7 +307,7 @@ watch(
|
||||
|
||||
<div class="entity-card__actions">
|
||||
<!-- On an aircraft or a satellite, Cockpit leads: it is the action people come for. -->
|
||||
<button v-if="store.canCockpit()" type="button" class="entity-card__action entity-card__action--primary" @click="store.cockpit()">
|
||||
<button v-if="store.canCockpit()" type="button" class="entity-card__action entity-card__action--primary" data-entity-cockpit-entry @click="store.cockpit()">
|
||||
<span class="material-symbols-outlined" aria-hidden="true">{{ card.layerId === 'satellites' ? 'satellite_alt' : 'flight' }}</span>{{ card.layerId === 'satellites' ? t('Enter orbital view') : t('Enter Cockpit') }}
|
||||
</button>
|
||||
<div class="entity-card__action-row">
|
||||
@@ -319,9 +323,8 @@ watch(
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- The same blocks for every item, in one order: weather and local
|
||||
time, then flights, vessels and hazards within the Context radius. -->
|
||||
<SpotConditions v-if="Number.isFinite(card.lat) && Number.isFinite(card.lon)" :key="card.key" entity :lat="card.lat" :lon="card.lon" :exclude-key="card.key" :settle-km="settleKm" />
|
||||
<slot />
|
||||
<SpotConditions v-if="Number.isFinite(card.lat) && Number.isFinite(card.lon)" :key="card.key" entity :lat="card.lat" :lon="card.lon" :exclude-key="card.key" :settle-km="settleKm" :with-contacts="props.withContacts" />
|
||||
|
||||
<p v-if="source" class="entity-card__source">
|
||||
<span>{{ t('Source') }}</span> {{ source }}<template v-if="ageText"> · {{ ageText }}</template>
|
||||
|
||||
@@ -24,6 +24,7 @@ const props = defineProps({
|
||||
lon: { type: Number, required: true },
|
||||
/** Show the standard blocks for a selected item. */
|
||||
entity: { type: Boolean, default: false },
|
||||
withContacts: Boolean,
|
||||
/** The selected item's own key, left out of the nearby lists. */
|
||||
excludeKey: { type: String, default: '' },
|
||||
/** How far the spot moves before the weather and hazards are read again. */
|
||||
@@ -111,7 +112,8 @@ const shownHazards = computed(() =>
|
||||
hazards.value.filter((hazard) => matchesContextSearch(hazard.title, hazard.detail, hazardLayers.value[hazard.kind]?.name)).slice(0, searching.value ? 12 : 5),
|
||||
);
|
||||
|
||||
// The standard nearby lists for a selected item, from the layers that are on.
|
||||
// The merged card gets these cohorts and their coverage from Awareness.
|
||||
const CONTACT_LAYERS = ['flights', 'military', 'ais-live-vessels', 'military-installations'];
|
||||
const groups = computed(() => {
|
||||
void tick.value;
|
||||
if (!props.entity) return null;
|
||||
@@ -119,17 +121,21 @@ const groups = computed(() => {
|
||||
radiusKm: radiusKm.value,
|
||||
limit: searching.value ? 12 : 4,
|
||||
excludeKey: props.excludeKey,
|
||||
excludeLayers: props.withContacts ? CONTACT_LAYERS : undefined,
|
||||
query: contextNeedle.value,
|
||||
});
|
||||
});
|
||||
const trafficBlocks = computed(() =>
|
||||
groups.value
|
||||
? [
|
||||
{ id: 'flights', icon: 'flight', title: t('Flights within {radius}', { radius: radiusText.value }), none: t('No flights within {radius} from the layers that are on.', { radius: radiusText.value }), ...groups.value.flights },
|
||||
{ id: 'vessels', icon: 'directions_boat', title: t('Vessels within {radius}', { radius: radiusText.value }), none: t('No vessels within {radius} from the layers that are on.', { radius: radiusText.value }), ...groups.value.vessels },
|
||||
]
|
||||
: [],
|
||||
);
|
||||
const trafficBlocks = computed(() => {
|
||||
if (!groups.value) return [];
|
||||
if (props.withContacts)
|
||||
return groups.value.flights.count
|
||||
? [{ id: 'local-adsb', icon: 'flight', title: t('Local ADS-B'), ...groups.value.flights }]
|
||||
: [];
|
||||
return [
|
||||
{ id: 'flights', icon: 'flight', title: t('Flights within {radius}', { radius: radiusText.value }), none: t('No flights within {radius} from the layers that are on.', { radius: radiusText.value }), ...groups.value.flights },
|
||||
{ id: 'vessels', icon: 'directions_boat', title: t('Vessels within {radius}', { radius: radiusText.value }), none: t('No vessels within {radius} from the layers that are on.', { radius: radiusText.value }), ...groups.value.vessels },
|
||||
];
|
||||
});
|
||||
|
||||
// Local solar time at the spot, from its longitude: no time zone lookup.
|
||||
const localTime = computed(() => {
|
||||
|
||||
Reference in new issue
Block a user