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

Add option to save shell output

This commit is contained in:
2023-12-22 15:56:00 +01:00
parent 82b8f1e300
commit 773bcf65fd
4 changed files with 42 additions and 1 deletions

View File

@ -3,7 +3,7 @@
import CodeEditor from '$components/editors/codeeditor.svelte';
import Icon from '$components/icon.svelte';
import environment from '$lib/stores/environment.js';
import { OpenShellScript, SaveShellScript } from '$wails/go/app/App.js';
import { OpenShellScript, SaveShellScript, SaveShellOuput } from '$wails/go/app/App.js';
import { BrowserOpenURL } from '$wails/runtime/runtime.js';
import { javascript } from '@codemirror/lang-javascript';
import { onDestroy, onMount } from 'svelte';
@ -73,6 +73,10 @@
);
}
async function saveOutput() {
await SaveShellOuput(result.output + '\n' + result.stderr);
}
async function copyErrorDescription() {
await navigator.clipboard.writeText(result.errorDescription);
copySucceeded = true;
@ -155,6 +159,10 @@
</button>
</div>
<button class="button secondary" disabled={!result.output} on:click={saveOutput}>
<Icon name="upload" /> Save output as…
</button>
<button class="button viewtoggle" title="Toggle horizontal/vertical view" on:click={toggleView}>
<Icon name="columns" rotation={horizontal ? 90 : 0} />
</button>