1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 13:07:58 +00:00

Hide object types in object grid

This commit is contained in:
Romein van Buren 2023-07-01 19:26:04 +02:00
parent 037d5432a4
commit 21afb01ea1
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
5 changed files with 11 additions and 6 deletions

View File

@ -11,15 +11,16 @@
export let errorTitle = ''; export let errorTitle = '';
export let errorDescription = ''; export let errorDescription = '';
export let busy = false; export let busy = false;
export let showTypes = true;
const columns = [
{ key: 'key', label: 'Key' },
{ key: 'value', label: 'Value' },
{ key: 'type', label: 'Type' },
];
let items = []; let items = [];
$: columns = [
{ key: 'key', label: 'Key' },
{ key: 'value', label: 'Value' },
showTypes ? { key: 'type', label: 'Type' } : undefined,
].filter(c => !!c);
$: if (data) { $: if (data) {
// items = dissectObject(data).map(item => ({ ...item, menu: getRootMenu(item.key, item) })); // items = dissectObject(data).map(item => ({ ...item, menu: getRootMenu(item.key, item) }));
items = []; items = [];

View File

@ -20,6 +20,7 @@
<div class="grid"> <div class="grid">
<ObjectGrid <ObjectGrid
data={collection.stats} data={collection.stats}
showTypes={false}
errorTitle={collection.statsError ? 'Error fetching collection stats' : ''} errorTitle={collection.statsError ? 'Error fetching collection stats' : ''}
errorDescription={collection.statsError} errorDescription={collection.statsError}
busy={!collection.stats && !collection.statsError && `Fetching stats for ${collection.key}`} busy={!collection.stats && !collection.statsError && `Fetching stats for ${collection.key}`}

View File

@ -20,6 +20,7 @@
<div class="grid"> <div class="grid">
<ObjectGrid <ObjectGrid
data={database.stats} data={database.stats}
showTypes={false}
errorTitle={database.statsError ? 'Error fetching database stats' : ''} errorTitle={database.statsError ? 'Error fetching database stats' : ''}
errorDescription={database.statsError} errorDescription={database.statsError}
busy={!database.stats && !database.statsError && `Fetching stats for ${database.key}`} busy={!database.stats && !database.statsError && `Fetching stats for ${database.key}`}

View File

@ -20,6 +20,7 @@
<div class="grid"> <div class="grid">
<ObjectGrid <ObjectGrid
data={host.status || {}} data={host.status || {}}
showTypes={false}
errorTitle={host.statusError ? 'Error fetching server status' : ''} errorTitle={host.statusError ? 'Error fetching server status' : ''}
errorDescription={host.statusError} errorDescription={host.statusError}
busy={!host.status && !host.statusError && 'Fetching server status…'} busy={!host.status && !host.statusError && 'Fetching server status…'}

View File

@ -20,6 +20,7 @@
<div class="grid"> <div class="grid">
<ObjectGrid <ObjectGrid
data={host.systemInfo} data={host.systemInfo}
showTypes={false}
errorTitle={host.systemInfoError ? 'Error fetching system info' : ''} errorTitle={host.systemInfoError ? 'Error fetching system info' : ''}
errorDescription={host.systemInfoError} errorDescription={host.systemInfoError}
busy={!host.systemInfo && !host.systemInfoError && 'Fetching system info…'} busy={!host.systemInfo && !host.systemInfoError && 'Fetching system info…'}