mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-07-17 21:44:05 +00:00
Index creation
This commit is contained in:
@ -3,12 +3,14 @@
|
||||
import ObjectGrid from '../../../components/objectgrid.svelte';
|
||||
import { DropIndex, GetIndexes } from '../../../../wailsjs/go/app/App';
|
||||
import Icon from '../../../components/icon.svelte';
|
||||
import IndexDetail from './indexes-detail.svelte';
|
||||
|
||||
export let collection;
|
||||
|
||||
let indexes = [];
|
||||
let activePath = [];
|
||||
let objectViewerData = '';
|
||||
let creatingNewIndex = false;
|
||||
|
||||
$: collection && getIndexes();
|
||||
|
||||
@ -19,6 +21,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
function createIndex() {
|
||||
creatingNewIndex = true;
|
||||
}
|
||||
|
||||
async function drop(key) {
|
||||
if (typeof key !== 'string') {
|
||||
key = activePath[0];
|
||||
@ -41,7 +47,7 @@
|
||||
<button class="btn" on:click={getIndexes}>
|
||||
<Icon name="reload" /> Reload
|
||||
</button>
|
||||
<button class="btn">
|
||||
<button class="btn" on:click={createIndex}>
|
||||
<Icon name="+" /> Create index…
|
||||
</button>
|
||||
<button class="btn danger" on:click={drop} disabled={!indexes?.length || !activePath[0]}>
|
||||
@ -61,6 +67,7 @@
|
||||
</div>
|
||||
|
||||
<ObjectViewer bind:data={objectViewerData} />
|
||||
<IndexDetail bind:creatingNewIndex {collection} on:reload={getIndexes} />
|
||||
|
||||
<style>
|
||||
.indexes {
|
||||
|
Reference in New Issue
Block a user