add credentials entry view
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
async function approve() {
|
||||
let status = await invoke('get-session-status');
|
||||
let status = await invoke('get_session_status');
|
||||
if (status === 'unlocked') {
|
||||
dispatch('navigate', {target: 'ShowApproved'});
|
||||
}
|
||||
|
41
src/views/EnterCredentials.svelte
Normal file
41
src/views/EnterCredentials.svelte
Normal file
@ -0,0 +1,41 @@
|
||||
<script>
|
||||
import { onMount, createEventDispatcher } from 'svelte';
|
||||
import { invoke } from '@tauri-apps/api/tauri';
|
||||
|
||||
export let appState;
|
||||
|
||||
const dispatch = createEventDispatcher;
|
||||
let AccessKeyId, SecretAccessKey, passphrase
|
||||
|
||||
async function save() {
|
||||
try {
|
||||
console.log('Saving credentials.');
|
||||
let credentials = {AccessKeyId, SecretAccessKey};
|
||||
console.log(credentials);
|
||||
await invoke('save_credentials', {credentials, passphrase});
|
||||
if (appState.currentRequest) {
|
||||
dispatch('navigate', {target: 'Approve'})
|
||||
}
|
||||
else {
|
||||
dispatch('navigate', {target: Home})
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.log("Error saving credentials:", e);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<form action="#" on:submit|preventDefault="{save}">
|
||||
<div class="text-gray-200">AWS Access Key ID</div>
|
||||
<input class="text-gray-200 bg-zinc-800" type="text" bind:value="{AccessKeyId}" />
|
||||
|
||||
<div class="text-gray-200">AWS Secret Access Key</div>
|
||||
<input class="text-gray-200 bg-zinc-800" type="text" bind:value="{SecretAccessKey}" />
|
||||
|
||||
<div class="text-gray-200">Passphrase</div>
|
||||
<input class="text-gray-200 bg-zinc-800" type="text" bind:value="{passphrase}" />
|
||||
|
||||
<input class="text-gray-200" type="submit" />
|
||||
</form>
|
Reference in New Issue
Block a user