Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
let satelliteCanisterData = $state<CanisterData | undefined>(undefined);
let satelliteWarnings = $state<CanisterWarning | undefined>(undefined);

let ufoCanisterData = $state<CanisterData | undefined>(undefined);
let ufoWarnings = $state<CanisterWarning | undefined>(undefined);

let upgradeWarning = $state(false);
let canisterWarnings = $state(false);
let canisterNotifications = $state(false);
Expand Down Expand Up @@ -98,6 +101,8 @@
{orbiterWarnings}
{satelliteCanisterData}
{satelliteWarnings}
{ufoCanisterData}
{ufoWarnings}
bind:alerts={hasAlerts}
bind:upgradeWarning
bind:canisterWarnings
Expand All @@ -121,6 +126,8 @@
{outOfSyncWarnings}
{satelliteCanisterData}
{satelliteWarnings}
{ufoCanisterData}
{ufoWarnings}
{upgradeWarning}
/>
{:else if $store.tabId === $store.tabs[1].id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import IconAnalytics from '$lib/components/icons/IconAnalytics.svelte';
import IconMissionControl from '$lib/components/icons/IconMissionControl.svelte';
import IconSatellite from '$lib/components/icons/IconSatellite.svelte';
import IconUfo from '$lib/components/icons/IconUfo.svelte';
import { satellite } from '$lib/derived/satellite.derived';
import { ufo } from '$lib/derived/ufo.derived';
import { i18n } from '$lib/stores/app/i18n.store';
import type { CanisterData, CanisterWarning } from '$lib/types/canister';
import { overviewLink } from '$lib/utils/nav.utils';
import { overviewLink, ufoLink } from '$lib/utils/nav.utils';

interface Props {
missionControlCanisterData: CanisterData | undefined;
Expand All @@ -17,6 +19,8 @@
orbiterWarnings: CanisterWarning | undefined;
satelliteCanisterData: CanisterData | undefined;
satelliteWarnings: CanisterWarning | undefined;
ufoCanisterData: CanisterData | undefined;
ufoWarnings: CanisterWarning | undefined;
close: () => void;
alerts: boolean;
upgradeWarning: boolean;
Expand All @@ -31,6 +35,8 @@
orbiterWarnings,
satelliteCanisterData,
satelliteWarnings,
ufoCanisterData,
ufoWarnings,
close,
alerts,
upgradeWarning,
Expand Down Expand Up @@ -69,6 +75,15 @@
segment="satellite"
warnings={satelliteWarnings}
/>

<NotificationsCanisterAlert
{close}
cyclesIcon={IconUfo}
data={ufoCanisterData}
href={ufoLink($ufo?.ufo_id)}
segment="ufo"
warnings={ufoWarnings}
/>
{/if}

{#if outOfSyncWarnings}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
import NotificationsCanisterLoader from '$lib/components/app/notifications/NotificationsCanisterLoader.svelte';
import { missionControlId } from '$lib/derived/console/account.mission-control.derived';
import { orbiter } from '$lib/derived/orbiter.derived';
import { outOfSyncOrbiters, outOfSyncSatellites } from '$lib/derived/out-of-sync.derived';
import {
outOfSyncOrbiters,
outOfSyncUfos,
outOfSyncSatellites
} from '$lib/derived/out-of-sync.derived';
import { satellite } from '$lib/derived/satellite.derived';
import { ufo } from '$lib/derived/ufo.derived';
import { versionsLoaded, versionsUpgradeWarning } from '$lib/derived/version.derived';
import type { CanisterData, CanisterWarning } from '$lib/types/canister';

Expand All @@ -14,6 +19,8 @@
orbiterWarnings: CanisterWarning | undefined;
satelliteCanisterData: CanisterData | undefined;
satelliteWarnings: CanisterWarning | undefined;
ufoCanisterData: CanisterData | undefined;
ufoWarnings: CanisterWarning | undefined;
alerts: boolean;
upgradeWarning: boolean;
canisterWarnings: boolean;
Expand All @@ -27,6 +34,8 @@
orbiterWarnings = $bindable(undefined),
satelliteCanisterData = $bindable(undefined),
satelliteWarnings = $bindable(undefined),
ufoCanisterData = $bindable(undefined),
ufoWarnings = $bindable(undefined),
alerts = $bindable(false),
upgradeWarning = $bindable(false),
canisterWarnings = $bindable(false),
Expand All @@ -39,12 +48,15 @@
let hasCanisterWarnings = $derived(
hasWarnings(missionControlWarnings) ||
hasWarnings(orbiterWarnings) ||
hasWarnings(satelliteWarnings)
hasWarnings(satelliteWarnings) ||
hasWarnings(ufoWarnings)
);

let hasUpgradeWarning = $derived($versionsLoaded && $versionsUpgradeWarning);

let hasOutOfSyncWarning = $derived($outOfSyncSatellites === true || $outOfSyncOrbiters === true);
let hasOutOfSyncWarning = $derived(
$outOfSyncSatellites === true || $outOfSyncOrbiters === true || $outOfSyncUfos === true
);

let hasNotifications = $derived(hasCanisterWarnings || hasUpgradeWarning || hasOutOfSyncWarning);

Expand Down Expand Up @@ -73,3 +85,9 @@
bind:warnings={satelliteWarnings}
bind:data={satelliteCanisterData}
/>

<NotificationsCanisterLoader
canisterId={$ufo?.ufo_id}
bind:warnings={ufoWarnings}
bind:data={ufoCanisterData}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
data: CanisterData | undefined;
close: () => void;
href: string;
segment: 'satellite' | 'mission_control' | 'orbiter';
segment: 'satellite' | 'mission_control' | 'orbiter' | 'ufo';
}

let { warnings, close, data, href, cyclesIcon, segment }: Props = $props();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
const onsubmit = async ($event: SubmitEvent) => {
$event.preventDefault();

$event.preventDefault();

onProgress(undefined);

wizardBusy.start();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<script lang="ts">
import OutOfSyncSegments from '$lib/components/modules/out-of-sync/OutOfSyncSegments.svelte';
import GridEqualNot from '$lib/components/ui/GridEqualNot.svelte';
import { consoleOrbiter, consoleSortedSatellites } from '$lib/derived/console/segments.derived';
import {
consoleOrbiter,
consoleSortedSatellites,
consoleSortedUfos
} from '$lib/derived/console/segments.derived';
import { mctrlOrbiter } from '$lib/derived/mission-control/mission-control-orbiters.derived';
import { mctrlSortedSatellites } from '$lib/derived/mission-control/mission-control-satellites.derived';
import { mctrlSortedUfos } from '$lib/derived/mission-control/mission-control-ufos.derived';
import { i18n } from '$lib/stores/app/i18n.store';

interface Props {
Expand All @@ -19,15 +24,23 @@

<form {onsubmit}>
<div class="columns">
<OutOfSyncSegments orbiter={$consoleOrbiter} satellites={$consoleSortedSatellites}>
<OutOfSyncSegments
orbiter={$consoleOrbiter}
satellites={$consoleSortedSatellites}
ufos={$consoleSortedUfos}
>
{#snippet label()}
{$i18n.out_of_sync.console}
{/snippet}
</OutOfSyncSegments>

<GridEqualNot small />

<OutOfSyncSegments orbiter={$mctrlOrbiter} satellites={$mctrlSortedSatellites}>
<OutOfSyncSegments
orbiter={$mctrlOrbiter}
satellites={$mctrlSortedSatellites}
ufos={$mctrlSortedUfos}
>
{#snippet label()}
{$i18n.mission_control.title}
{/snippet}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,32 @@
import { i18n } from '$lib/stores/app/i18n.store';
import type { Orbiter } from '$lib/types/orbiter';
import type { Satellite } from '$lib/types/satellite';
import type { Ufo } from '$lib/types/ufo';
import { metadataUiName } from '$lib/utils/metadata-ui.utils';
import { orbiterName } from '$lib/utils/orbiter.utils';

interface Props {
label: Snippet;
satellites: Satellite[];
ufos: Ufo[];
orbiter: Nullish<Orbiter>;
}

let { label, satellites, orbiter }: Props = $props();
let { label, satellites, ufos, orbiter }: Props = $props();
</script>

{#snippet withSegments()}
<ul class="content">
{#if nonNullish(orbiter)}
{@const orbName = orbiterName(orbiter)}

<li>
<Segment id={orbiter.orbiter_id}>
{isEmptyString(orbName) ? $i18n.analytics.orbiter : orbName}
</Segment>
</li>
{/if}

{#each satellites as satellite (satellite.satellite_id.toText())}
<li>
<Segment id={satellite.satellite_id}>
Expand All @@ -28,15 +40,13 @@
</li>
{/each}

{#if nonNullish(orbiter)}
{@const orbName = orbiterName(orbiter)}

{#each ufos as ufo (ufo.ufo_id.toText())}
<li>
<Segment id={orbiter.orbiter_id}>
{isEmptyString(orbName) ? $i18n.analytics.orbiter : orbName}
<Segment id={ufo.ufo_id}>
{metadataUiName(ufo)}
</Segment>
</li>
{/if}
{/each}
</ul>
{/snippet}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { ufosUncertifiedStore } from '$lib/stores/mission-control/ufos.store';
import { sortUfos } from '$lib/utils/ufo.utils';
import { derived } from 'svelte/store';

export const mctrlUfos = derived(
[ufosUncertifiedStore],
([$ufosUncertifiedStore]) => $ufosUncertifiedStore?.data
);

export const mctrlSortedUfos = derived([mctrlUfos], ([$mctrlUfosStore]) =>
($mctrlUfosStore ?? []).sort(sortUfos)
);
35 changes: 34 additions & 1 deletion src/frontend/src/lib/derived/out-of-sync.derived.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { consoleOrbiters, consoleSatellites } from '$lib/derived/console/segments.derived';
import {
consoleOrbiters,
consoleSatellites,
consoleUfos
} from '$lib/derived/console/segments.derived';
import { mctrlOrbiters } from '$lib/derived/mission-control/mission-control-orbiters.derived';
import { mctrlSatellites } from '$lib/derived/mission-control/mission-control-satellites.derived';
import { mctrlUfos } from '$lib/derived/mission-control/mission-control-ufos.derived';
import { derived } from 'svelte/store';

export const outOfSyncSatellites = derived(
Expand Down Expand Up @@ -61,3 +66,31 @@ export const outOfSyncOrbiters = derived(
return !inSync;
}
);

export const outOfSyncUfos = derived(
[consoleUfos, mctrlUfos],
([$consoleUfos, $mctrlUfos]): boolean | undefined => {
// Not yet fully loaded
if ($consoleUfos === undefined || $mctrlUfos === undefined) {
return undefined;
}

// No mission control
if ($mctrlUfos === null) {
return false;
}

if ($consoleUfos?.length === 0 && $mctrlUfos.length === 0) {
return false;
}

const inSync =
$consoleUfos?.length === $mctrlUfos.length &&
($consoleUfos ?? []).every(
({ ufo_id: segment_id }) =>
$mctrlUfos.find(({ ufo_id }) => ufo_id.toText() === segment_id.toText()) !== undefined
);

return !inSync;
}
);
6 changes: 4 additions & 2 deletions src/frontend/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@
"upgrade_available": "New upgrades available. Visit the Upgrade Dock to check them out.",
"short_freezing_threshold": "Short freezing threshold detected. We recommend a longer grace period to give you more time if cycles run out.",
"learn_more": "Learn more",
"out_of_sync": "Your satellites and orbiters are out of sync. Reconcile them now."
"out_of_sync": "Your modules are out of sync. Reconcile them now."
},
"not_found": {
"title": "Oops! You got lost in space.",
Expand All @@ -1124,7 +1124,9 @@
"syncing_satellites_to_console": "Syncing Satellites to Console...",
"syncing_satellites_to_mctrl": "Syncing Satellites to Mission Control... ({0})",
"syncing_orbiters_to_console": "Syncing Orbiters to Console...",
"syncing_orbiters_to_mctrl": "Syncing Orbiters to Mission Control... ({0})"
"syncing_orbiters_to_mctrl": "Syncing Orbiters to Mission Control... ({0})",
"syncing_ufos_to_console": "Syncing UFOs to Console...",
"syncing_ufos_to_mctrl": "Syncing UFOs to Mission Control... ({0})"
},
"automation": {
"title": "Deployments",
Expand Down
6 changes: 4 additions & 2 deletions src/frontend/src/lib/i18n/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@
"upgrade_available": "有新版本可用,请前往升级中心查看。",
"short_freezing_threshold": "检测到冻结阈值过短,建议设置更长宽限期以便在cycles耗尽时为您争取更多时间。",
"learn_more": "了解更多",
"out_of_sync": "您的卫星和轨道器不同步。请立即协调它们。"
"out_of_sync": "您的模块已不同步。立即进行协调。"
},
"not_found": {
"title": "抱歉!您在太空中迷路了。",
Expand All @@ -1126,7 +1126,9 @@
"syncing_satellites_to_console": "正在将卫星同步到控制台...",
"syncing_satellites_to_mctrl": "正在将卫星同步到任务控制中心... ({0})",
"syncing_orbiters_to_console": "正在将轨道器同步到控制台...",
"syncing_orbiters_to_mctrl": "正在将轨道器同步到任务控制中心... ({0})"
"syncing_orbiters_to_mctrl": "正在将轨道器同步到任务控制中心... ({0})",
"syncing_ufos_to_console": "正在将 UFO 同步到控制台...",
"syncing_ufos_to_mctrl": "正在将 UFO 同步到任务控制... ({0})"
},
"automation": {
"title": "部署",
Expand Down
Loading
Loading