1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-20 06:28:04 +00:00

Lint code

This commit is contained in:
2023-08-07 18:21:45 +02:00
parent 59d7895f62
commit a3afad6d6b
51 changed files with 380 additions and 178 deletions

View File

@ -1,9 +1,9 @@
<script>
import Icon from '$components/icon.svelte';
import Modal from '$components/modal.svelte';
import input from '$lib/actions/input';
import hostTree from '$lib/stores/hosttree';
import { createEventDispatcher, onMount } from 'svelte';
import input from '$lib/actions/input.js';
import hostTree from '$lib/stores/hosttree.js';
import { createEventDispatcher } from 'svelte';
export let host = {};
export let dbKey = '';

View File

@ -1,7 +1,7 @@
<script>
import Icon from '$components/icon.svelte';
import Modal from '$components/modal.svelte';
import views from '$lib/stores/views';
import views from '$lib/stores/views.js';
import { createEventDispatcher } from 'svelte';
export let collection;

View File

@ -1,7 +1,7 @@
<script>
import Icon from '$components/icon.svelte';
import Modal from '$components/modal.svelte';
import input from '$lib/actions/input';
import input from '$lib/actions/input.js';
import { createEventDispatcher } from 'svelte';
export let collection;
@ -27,7 +27,12 @@
<form on:submit|preventDefault={create}>
<label class="field name">
<span class="label">Name</span>
<input type="text" placeholder="Optional" bind:value={index.name} use:input={{ autofocus: true }} />
<input
type="text"
placeholder="Optional"
bind:value={index.name}
use:input={{ autofocus: true }}
/>
</label>
<div class="toggles">
@ -62,8 +67,9 @@
<div class="row">
<label class="field">
<span class="label">Key</span>
<input type="text" placeholder="_id" bind:value={rule.key}>
<input type="text" placeholder="_id" bind:value={rule.key} />
</label>
<label class="field">
<select bind:value={rule.sort}>
<option value={1}>Ascending</option>
@ -71,6 +77,7 @@
<option value="hashed" disabled={index.model.length > 1}>Hashed</option>
</select>
</label>
<button type="button" class="button danger" on:click={() => removeRule(ruleIndex)} disabled={index.model.length < 2}>
<Icon name="-" />
</button>
@ -85,6 +92,7 @@
<button class="button" on:click={addRule} disabled={index.model.some(r => r.sort === 'hashed')}>
<Icon name="+" /> Add rule
</button>
<button class="button" on:click={create} disabled={!index.model.length || index.model.some(r => !r.key)}>
<Icon name="+" /> Create index
</button>

View File

@ -3,9 +3,9 @@
import Hint from '$components/hint.svelte';
import Icon from '$components/icon.svelte';
import Modal from '$components/modal.svelte';
import input from '$lib/actions/input';
import hostTree from '$lib/stores/hosttree';
import queries from '$lib/stores/queries';
import input from '$lib/actions/input.js';
import hostTree from '$lib/stores/hosttree.js';
import queries from '$lib/stores/queries.js';
import { createEventDispatcher } from 'svelte';
export let queryToSave = undefined;
@ -71,7 +71,7 @@
<input type="text" bind:value={queryToSave.name} use:input={{ autofocus: true }} />
</label>
<label class="field">
<textarea bind:value={queryToSave.remarks} placeholder="Remarks…" use:input></textarea>
<textarea bind:value={queryToSave.remarks} placeholder="Remarks…" use:input />
</label>
{/if}

View File

@ -2,9 +2,9 @@
import Icon from '$components/icon.svelte';
import Modal from '$components/modal.svelte';
import TabBar from '$components/tabbar.svelte';
import input from '$lib/actions/input';
import { randomString } from '$lib/math';
import views from '$lib/stores/views';
import input from '$lib/actions/input.js';
import { randomString } from '$lib/math.js';
import views from '$lib/stores/views.js';
export let collection;
export let firstItem = {};
@ -114,7 +114,12 @@
{#key collection.viewKey}
<label class="field">
<span class="label">View name</span>
<input type="text" use:input={{ autofocus: true }} bind:value={$views[collection.viewKey].name} disabled={collection.viewKey === 'list'} />
<input
type="text"
use:input={{ autofocus: true }}
bind:value={$views[collection.viewKey].name}
disabled={collection.viewKey === 'list'}
/>
</label>
{/key}
<label class="field">
@ -128,7 +133,11 @@
{#if $views[collection.viewKey].type === 'list'}
<div class="flex">
<input type="checkbox" id="hideObjectIndicators" bind:checked={$views[collection.viewKey].hideObjectIndicators} />
<input
type="checkbox"
id="hideObjectIndicators"
bind:checked={$views[collection.viewKey].hideObjectIndicators}
/>
<label for="hideObjectIndicators">
Hide object indicators ({'{...}'} and [...]) in list view and show nothing instead
</label>
@ -185,16 +194,41 @@
</span>
</label>
<button class="button" type="button" on:click={() => addColumn(columnIndex)} title="Add column before this one">
<button
class="button"
type="button"
on:click={() => addColumn(columnIndex)}
title="Add column before this one"
>
<Icon name="+" />
</button>
<button class="button" type="button" on:click={() => moveColumn(columnIndex, -1)} disabled={columnIndex === 0} title="Move column one position up">
<button
class="button"
type="button"
on:click={() => moveColumn(columnIndex, -1)}
disabled={columnIndex === 0}
title="Move column one position up"
>
<Icon name="chev-u" />
</button>
<button class="button" type="button" on:click={() => moveColumn(columnIndex, 1)} disabled={columnIndex === $views[collection.viewKey].columns.length - 1} title="Move column one position down">
<button
class="button"
type="button"
on:click={() => moveColumn(columnIndex, 1)}
disabled={columnIndex === $views[collection.viewKey].columns.length - 1}
title="Move column one position down"
>
<Icon name="chev-d" />
</button>
<button class="button danger" type="button" on:click={() => removeColumn(columnIndex)} title="Remove this column">
<button
class="button danger"
type="button"
on:click={() => removeColumn(columnIndex)}
title="Remove this column"
>
<Icon name="x" />
</button>
</div>
@ -202,10 +236,16 @@
<p>No columns yet</p>
{/each}
</div>
<button class="button" on:click={addColumn}>
<Icon name="+" /> Add column
</button>
<button class="button" on:click={addSuggestedColumns} disabled={!Object.keys(firstItem || {}).length}>
<button
class="button"
on:click={addSuggestedColumns}
disabled={!Object.keys(firstItem || {}).length}
>
<Icon name="zap" /> Add suggested columns
</button>
{/if}