-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: David Dal Busco <[email protected]>
- Loading branch information
1 parent
45a10ff
commit 7f2efcf
Showing
3 changed files
with
40 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 2 additions & 47 deletions
49
src/frontend/src/lib/components/mission-control/MissionControlStatuses.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,8 @@ | ||
<script lang="ts"> | ||
import { fade } from 'svelte/transition'; | ||
import Value from '$lib/components/ui/Value.svelte'; | ||
import { i18n } from '$lib/stores/i18n.store'; | ||
import type { ChartsData } from '$lib/types/chart'; | ||
import Chart from '$lib/components/charts/Chart.svelte'; | ||
import CanisterJunoStatuses from '$lib/components/canister/CanisterJunoStatuses.svelte'; | ||
import type {Principal} from "@dfinity/principal"; | ||
import type { Principal } from '@dfinity/principal'; | ||
export let missionControlId: Principal; | ||
let chartsData: ChartsData[] = []; | ||
const onStatuses = ({ detail }: CustomEvent<ChartsData[]>) => { | ||
chartsData = detail; | ||
}; | ||
</script> | ||
|
||
<CanisterJunoStatuses | ||
segment="mission_control" | ||
canisterId={missionControlId} | ||
on:junoStatuses={onStatuses} | ||
> | ||
{#if chartsData.length > 0} | ||
<div class="container" in:fade> | ||
<Value> | ||
<svelte:fragment slot="label" | ||
>{$i18n.observatory.title} <small>(T Cycles)</small></svelte:fragment | ||
> | ||
|
||
<div class="chart-container"> | ||
<Chart {chartsData} /> | ||
</div> | ||
</Value> | ||
</div> | ||
{/if} | ||
</CanisterJunoStatuses> | ||
|
||
<style lang="scss"> | ||
@use '../../styles/mixins/shadow'; | ||
.container { | ||
grid-column: 2 / 4; | ||
} | ||
.chart-container { | ||
width: 100%; | ||
height: 258px; | ||
fill: var(--value-color); | ||
margin: 0 0 var(--padding-4x); | ||
} | ||
</style> | ||
<CanisterJunoStatuses segment="mission_control" canisterId={missionControlId} /> |
47 changes: 1 addition & 46 deletions
47
src/frontend/src/lib/components/satellites/SatelliteStatuses.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,8 @@ | ||
<script lang="ts"> | ||
import type { Satellite } from '$declarations/mission_control/mission_control.did'; | ||
import { fade } from 'svelte/transition'; | ||
import Value from '$lib/components/ui/Value.svelte'; | ||
import { i18n } from '$lib/stores/i18n.store'; | ||
import type { ChartsData } from '$lib/types/chart'; | ||
import Chart from '$lib/components/charts/Chart.svelte'; | ||
import CanisterJunoStatuses from '$lib/components/canister/CanisterJunoStatuses.svelte'; | ||
export let satellite: Satellite; | ||
let chartsData: ChartsData[] = []; | ||
const onStatuses = ({ detail }: CustomEvent<ChartsData[]>) => { | ||
chartsData = detail; | ||
}; | ||
</script> | ||
|
||
<CanisterJunoStatuses | ||
segment="satellite" | ||
canisterId={satellite.satellite_id} | ||
on:junoStatuses={onStatuses} | ||
> | ||
{#if chartsData.length > 0} | ||
<div class="container" in:fade> | ||
<Value> | ||
<svelte:fragment slot="label" | ||
>{$i18n.observatory.title} <small>(T Cycles)</small></svelte:fragment | ||
> | ||
|
||
<div class="chart-container"> | ||
<Chart {chartsData} /> | ||
</div> | ||
</Value> | ||
</div> | ||
{/if} | ||
</CanisterJunoStatuses> | ||
|
||
<style lang="scss"> | ||
@use '../../styles/mixins/shadow'; | ||
.container { | ||
grid-column: 2 / 4; | ||
} | ||
.chart-container { | ||
width: 100%; | ||
height: 258px; | ||
fill: var(--value-color); | ||
margin: 0 0 var(--padding-4x); | ||
} | ||
</style> | ||
<CanisterJunoStatuses segment="satellite" canisterId={satellite.satellite_id} /> |