-
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
84ded2f
commit b263f02
Showing
2 changed files
with
20 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
src/frontend/src/lib/components/orbiter/OrbiterActions.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,11 +1,30 @@ | ||
<script lang="ts"> | ||
import TopUp from '$lib/components/canister/TopUp.svelte'; | ||
import Actions from '$lib/components/core/Actions.svelte'; | ||
import CanisterStopStart from '$lib/components/canister/CanisterStopStart.svelte'; | ||
import type { Orbiter } from '$declarations/mission_control/mission_control.did'; | ||
import type { Canister } from '$lib/types/canister'; | ||
export let orbiter: Orbiter; | ||
let canister: Canister | undefined = undefined; | ||
const onSyncCanister = (syncCanister: Canister) => { | ||
if (syncCanister.id !== orbiter.orbiter_id.toText()) { | ||
return; | ||
} | ||
canister = syncCanister; | ||
}; | ||
let visible: boolean | undefined; | ||
const close = () => (visible = false); | ||
</script> | ||
|
||
<svelte:window on:junoSyncCanister={({ detail: { canister } }) => onSyncCanister(canister)} /> | ||
|
||
<Actions bind:visible> | ||
<TopUp type="topup_orbiter" on:junoTopUp={close} /> | ||
|
||
<CanisterStopStart {canister} segment="orbiter" on:junoStop={close} on:junoStart={close} /> | ||
</Actions> |