mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-07-20 06:28:04 +00:00
Drop indexes
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import CodeViewer from '../../../components/codeviewer.svelte';
|
||||
import ObjectGrid from '../../../components/objectgrid.svelte';
|
||||
import { GetIndexes } from '../../../../wailsjs/go/app/App';
|
||||
import { DropIndex, GetIndexes } from '../../../../wailsjs/go/app/App';
|
||||
|
||||
export let collection;
|
||||
|
||||
@ -16,8 +16,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
function openJson(itemId) {
|
||||
const item = indexes?.filter(i => i.name == itemId);
|
||||
async function dropActive() {
|
||||
if (!activeKey) {
|
||||
return;
|
||||
}
|
||||
const success = await DropIndex(collection.hostKey, collection.dbKey, collection.key, activeKey);
|
||||
if (success) {
|
||||
await getIndexes();
|
||||
}
|
||||
}
|
||||
|
||||
function openJson(indexId) {
|
||||
const item = indexes?.filter(i => i.name == indexId);
|
||||
json = JSON.stringify(item, undefined, 2);
|
||||
}
|
||||
</script>
|
||||
@ -25,7 +35,9 @@
|
||||
<div class="indexes">
|
||||
<div class="actions">
|
||||
<button class="btn" on:click={getIndexes}>Get indexes</button>
|
||||
<button class="btn danger" disabled={!indexes?.length || !activeKey}>Drop selected</button>
|
||||
<button class="btn danger" on:click={dropActive} disabled={!indexes?.length || !activeKey}>
|
||||
Drop selected
|
||||
</button>
|
||||
<button class="btn">Create…</button>
|
||||
</div>
|
||||
|
||||
|
2
frontend/wailsjs/go/app/App.d.ts
vendored
2
frontend/wailsjs/go/app/App.d.ts
vendored
@ -8,6 +8,8 @@ export function DropCollection(arg1:string,arg2:string,arg3:string):Promise<bool
|
||||
|
||||
export function DropDatabase(arg1:string,arg2:string):Promise<boolean>;
|
||||
|
||||
export function DropIndex(arg1:string,arg2:string,arg3:string,arg4:string):Promise<boolean>;
|
||||
|
||||
export function FindItems(arg1:string,arg2:string,arg3:string,arg4:string):Promise<app.findResult>;
|
||||
|
||||
export function GetIndexes(arg1:string,arg2:string,arg3:string):Promise<Array<primitive.M>>;
|
||||
|
@ -10,6 +10,10 @@ export function DropDatabase(arg1, arg2) {
|
||||
return window['go']['app']['App']['DropDatabase'](arg1, arg2);
|
||||
}
|
||||
|
||||
export function DropIndex(arg1, arg2, arg3, arg4) {
|
||||
return window['go']['app']['App']['DropIndex'](arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
export function FindItems(arg1, arg2, arg3, arg4) {
|
||||
return window['go']['app']['App']['FindItems'](arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
Reference in New Issue
Block a user