mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
암호 키 내보내기 페이지 구현
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
<script lang="ts">
|
||||
import { goto } from "$app/navigation";
|
||||
import { Button, TextButton } from "$lib/components/buttons";
|
||||
import { TitleDiv, BottomDiv } from "$lib/components/divs";
|
||||
import { gotoStateful } from "$lib/hooks";
|
||||
import { keyPairStore } from "$lib/stores";
|
||||
import Order from "./Order.svelte";
|
||||
import { generateKeyPair } from "./service";
|
||||
|
||||
import IconKey from "~icons/material-symbols/key";
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
const orders = [
|
||||
{
|
||||
title: "암호 키는 공개 키와 개인 키로 구성돼요.",
|
||||
@@ -27,9 +31,21 @@
|
||||
];
|
||||
|
||||
const generate = async () => {
|
||||
// TODO
|
||||
await gotoStateful("/key/export", await generateKeyPair());
|
||||
// TODO: Loading indicator
|
||||
|
||||
const keyPair = await generateKeyPair();
|
||||
await gotoStateful("/key/export", {
|
||||
redirectPath: data.redirectPath,
|
||||
pubKeyBase64: keyPair.pubKeyBase64,
|
||||
privKeyBase64: keyPair.privKeyBase64,
|
||||
});
|
||||
};
|
||||
|
||||
$effect(() => {
|
||||
if ($keyPairStore) {
|
||||
goto(data.redirectPath);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<svetle:head>
|
||||
|
||||
Reference in New Issue
Block a user