1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-19 14:14:05 +00:00

Improvememts to export tool and logging

This commit is contained in:
2023-05-28 21:54:40 +02:00
parent a5eadbf456
commit 82d880dbff
9 changed files with 283 additions and 62 deletions

View File

@ -1,8 +1,8 @@
<script>
import Icon from '$components/icon.svelte';
import Modal from '$components/modal.svelte';
import { startProgress } from '$lib/progress';
import views from '$lib/stores/views';
import { PerformFindExport } from '$wails/go/app/App';
import { createEventDispatcher } from 'svelte';
export let info;
@ -11,16 +11,21 @@
const dispatch = createEventDispatcher();
let viewKey = collection.viewKey;
$: viewKey = collection.viewKey;
$: if (info) {
info.viewKey = viewKey;
}
async function performExport() {
const progress = startProgress('Performing export…');
info.view = $views[viewKey];
//...
progress.end();
const success = await PerformFindExport(collection.hostKey, collection.dbKey, collection.key, JSON.stringify(info));
if (success) {
info = undefined;
}
}
</script>
<Modal bind:show={info} title="Export results" width="400px">
<Modal bind:show={info} title="Export results" width="450px">
<form on:submit|preventDefault={performExport}>
<label class="field">
<span class="label">Export</span>
@ -30,14 +35,16 @@
<option value="querylimitskip">all records matching query, considering limit and skip</option>
</select>
</label>
<label class="field">
<span class="label">Format</span>
<select bind:value={info.format}>
<option value="jsonarray">JSON array</option>
<option value="jsonnewline">JSON: newline-separated objects</option>
<option value="ndjson">Newline delimited JSON</option>
<option value="csv">CSV</option>
</select>
</label>
<label class="field">
<span class="label">View to use</span>
<select bind:value={viewKey}>
@ -49,6 +56,11 @@
<Icon name="cog" />
</button>
</label>
<button class="btn" type="submit">
<Icon name="play" />
Start export
</button>
</form>
</Modal>

View File

@ -9,6 +9,7 @@ export namespace app {
homeDirectory: string;
dataDirectory: string;
logDirectory: string;
downloadDirectory: string;
static createFrom(source: any = {}) {
return new EnvironmentInfo(source);
@ -24,6 +25,7 @@ export namespace app {
this.homeDirectory = source["homeDirectory"];
this.dataDirectory = source["dataDirectory"];
this.logDirectory = source["logDirectory"];
this.downloadDirectory = source["downloadDirectory"];
}
}
export class QueryResult {

2
frontend/wailsjs/go/ui/UI.d.ts generated vendored
View File

@ -6,7 +6,7 @@ export function Beep():Promise<void>;
export function EnterText(arg1:string,arg2:string,arg3:string):Promise<string>;
export function OpenDirectory(arg1:string,arg2:string):Promise<string>;
export function OpenDirectory(arg1:string):Promise<string>;
export function Reveal(arg1:string):Promise<void>;

View File

@ -10,8 +10,8 @@ export function EnterText(arg1, arg2, arg3) {
return window['go']['ui']['UI']['EnterText'](arg1, arg2, arg3);
}
export function OpenDirectory(arg1, arg2) {
return window['go']['ui']['UI']['OpenDirectory'](arg1, arg2);
export function OpenDirectory(arg1) {
return window['go']['ui']['UI']['OpenDirectory'](arg1);
}
export function Reveal(arg1) {