mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-10 22:38:44 +02:00
ci: remove stronghold plugin from e2e tests (#3638)
* ci: remove stronghold plugin from e2e tests * revert unrelated change
This commit is contained in:
15 files changed
+3
-392
No files matched your search
@@ -37,7 +37,6 @@
|
||||
import DeepLink from './views/DeepLink.svelte'
|
||||
import Positioner from './views/Positioner.svelte'
|
||||
import Sql from './views/Sql.svelte'
|
||||
import Stronghold from './views/Stronghold.svelte'
|
||||
import WebSocket from './views/WebSocket.svelte'
|
||||
|
||||
import TitleBar from './lib/TitleBar.svelte'
|
||||
@@ -147,11 +146,6 @@
|
||||
component: Sql,
|
||||
icon: 'i-ph-database'
|
||||
},
|
||||
{
|
||||
label: 'Stronghold',
|
||||
component: Stronghold,
|
||||
icon: 'i-ph-lock-key'
|
||||
},
|
||||
{
|
||||
label: 'Deep link',
|
||||
component: DeepLink,
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
<script>
|
||||
import { Stronghold } from '@tauri-apps/plugin-stronghold'
|
||||
import { appLocalDataDir, join } from '@tauri-apps/api/path'
|
||||
|
||||
export let onMessage
|
||||
|
||||
const clientName = 'api-example'
|
||||
const storeKey = 'secret'
|
||||
|
||||
let password = 'password'
|
||||
let stronghold
|
||||
let store
|
||||
let record = ''
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
const path = await join(await appLocalDataDir(), 'api.stronghold')
|
||||
stronghold = await Stronghold.load(path, password)
|
||||
let client
|
||||
try {
|
||||
client = await stronghold.loadClient(clientName)
|
||||
} catch {
|
||||
client = await stronghold.createClient(clientName)
|
||||
}
|
||||
store = client.getStore()
|
||||
const value = await store.get(storeKey)
|
||||
record = value ? new TextDecoder().decode(value) : ''
|
||||
onMessage('Stronghold loaded')
|
||||
} catch (error) {
|
||||
stronghold = null
|
||||
onMessage(error)
|
||||
}
|
||||
}
|
||||
|
||||
async function save() {
|
||||
try {
|
||||
await store.insert(storeKey, Array.from(new TextEncoder().encode(record)))
|
||||
await stronghold.save()
|
||||
onMessage('Record saved')
|
||||
} catch (error) {
|
||||
onMessage(error)
|
||||
}
|
||||
}
|
||||
|
||||
async function unload() {
|
||||
await stronghold.unload().catch(onMessage)
|
||||
stronghold = null
|
||||
store = null
|
||||
record = ''
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
{#if stronghold}
|
||||
<div class="flex flex-row gap-2">
|
||||
<input class="input grow" placeholder="Secret" bind:value={record} />
|
||||
<button class="btn" on:click={save}>Save</button>
|
||||
<button class="btn" on:click={unload}>Lock</button>
|
||||
</div>
|
||||
{:else}
|
||||
<form class="flex flex-row gap-2" on:submit|preventDefault={load}>
|
||||
<input
|
||||
class="input grow"
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
bind:value={password}
|
||||
/>
|
||||
<button class="btn" type="submit">Unlock</button>
|
||||
</form>
|
||||
{/if}
|
||||
</div>
|
||||
Reference in new issue
Block a user