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

Grid icon

This commit is contained in:
Romein van Buren 2023-01-21 10:37:52 +01:00
parent 08cf6b162e
commit 951b24a32b
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
3 changed files with 18 additions and 1 deletions

View File

@ -115,6 +115,12 @@
{/if}
</td>
<td class="has-icon">
<div style:margin-left="{level * 10}px">
<Icon name={item.icon} />
</div>
</td>
{#each columns as column, columnIndex}
{@const value = column.key?.includes('.') ? resolveKeypath(item, column.key) : item[column.key]}
<td class:right={column.right} title={value}>
@ -157,7 +163,15 @@
cursor: pointer;
}
td.has-toggle {
width: calc(20px + 0.3rem);
width: 20px;
}
td.has-icon {
padding: 0;
width: 17px;
}
td.has-icon :global(svg) {
width: 13px;
height: 13px;
}
td .value {

View File

@ -29,6 +29,7 @@
<thead>
<tr>
<th class="has-toggle"></th>
<th class="has-icon"></th>
{#each columns as column}
<th scope="col">{column.title || ''}</th>
{/each}

View File

@ -82,9 +82,11 @@
columns={[ { key: 'id' }, { key: 'collCount', right: true } ]}
items={Object.keys(connection.databases).sort().map(dbKey => ({
id: dbKey,
icon: 'db',
collCount: Object.keys(connection.databases[dbKey].collections || {}).length || '',
children: Object.keys(connection.databases[dbKey].collections).sort().map(collKey => ({
id: collKey,
icon: 'list',
menu: [
{ label: `Drop ${collKey}`, fn: () => dropCollection(dbKey, collKey) },
{ label: `Drop ${dbKey}`, fn: () => dropDatabase(dbKey) },