mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-04-16 15:51:03 +00:00
Squashed commit of the following: commit 93b2d67cef77d89df728ffbf831e5ce79904673e Author: Romein van Buren <romein@vburen.nl> Date: Sat Jul 1 20:07:33 2023 +0200 Add filter functionality commit 30b65a198fc8d494fe660babd409e42a85c85d14 Author: Romein van Buren <romein@vburen.nl> Date: Sat Jul 1 19:27:20 2023 +0200 Renamed `form-row` class to `formrow` commit 21afb01ea191c6d5b597884fae637ae1b8f49a7a Author: Romein van Buren <romein@vburen.nl> Date: Sat Jul 1 19:26:04 2023 +0200 Hide object types in object grid commit 037d5432a454720ad58f3c201bc60980759cc44f Author: Romein van Buren <romein@vburen.nl> Date: Sat Jul 1 19:21:54 2023 +0200 Make auto reload interval input smaller commit 49d50220272d87c34cd84678baf01557d4c24051 Author: Romein van Buren <romein@vburen.nl> Date: Sat Jul 1 15:08:00 2023 +0200 Implement logs autoreload commit 1f8984766bbd8a1f6ce232daa40b8c49bf079d9f Author: Romein van Buren <romein@vburen.nl> Date: Sat Jul 1 15:04:00 2023 +0200 Return on error commit 9c8525996494f023634ac3ea64370fc2778e717c Author: Romein van Buren <romein@vburen.nl> Date: Sat Jul 1 15:03:37 2023 +0200 Add log error handling commit 7a98a63866b6fbfe3be5897feddbacf3fafd7dbf Author: Romein van Buren <romein@vburen.nl> Date: Sat Jul 1 14:46:39 2023 +0200 Update log tab icon commit f30827ae2ec1c6254e0aab451de6763556c90ac5 Author: Romein van Buren <romein@vburen.nl> Date: Sat Jul 1 14:41:59 2023 +0200 Add host log panel
71 lines
1.5 KiB
Svelte
71 lines
1.5 KiB
Svelte
<script>
|
|
import BlankState from '$components/blankstate.svelte';
|
|
import TabBar from '$components/tabbar.svelte';
|
|
import { EventsOn } from '$wails/runtime/runtime';
|
|
|
|
import Logs from './logs.svelte';
|
|
import Status from './status.svelte';
|
|
import SystemInfo from './systeminfo.svelte';
|
|
|
|
export let host;
|
|
export let hostKey;
|
|
export let tab = 'status';
|
|
|
|
$: if (host) {
|
|
host.hostKey = hostKey;
|
|
}
|
|
|
|
$: if (hostKey) {
|
|
tab = 'status';
|
|
}
|
|
|
|
EventsOn('OpenStatusTab', name => (tab = name || tab));
|
|
</script>
|
|
|
|
<div class="view" class:empty={!host}>
|
|
{#if host}
|
|
{#key host}
|
|
<TabBar
|
|
tabs={[
|
|
{ key: 'status', icon: 'chart', title: 'Host status' },
|
|
{ key: 'logs', icon: 'doc', title: 'Logs' },
|
|
{ key: 'systemInfo', icon: 'server', title: 'System info' },
|
|
]}
|
|
bind:selectedKey={tab}
|
|
/>
|
|
|
|
<div class="container">
|
|
{#if tab === 'status'} <Status {host} />
|
|
{:else if tab === 'logs'} <Logs {host} />
|
|
{:else if tab === 'systemInfo'} <SystemInfo {host} />
|
|
{/if}
|
|
</div>
|
|
{/key}
|
|
{:else}
|
|
<BlankState label="Select a host to continue" />
|
|
{/if}
|
|
</div>
|
|
|
|
<style>
|
|
.view {
|
|
height: 100%;
|
|
display: grid;
|
|
grid-template: auto 1fr / 1fr;
|
|
}
|
|
.view.empty {
|
|
grid-template: 1fr / 1fr;
|
|
}
|
|
|
|
.container {
|
|
padding: 0.5rem;
|
|
display: flex;
|
|
align-items: stretch;
|
|
overflow: auto;
|
|
min-height: 0;
|
|
min-width: 0;
|
|
}
|
|
.container > :global(*) {
|
|
width: 100%;
|
|
}
|
|
</style>
|