mirror of
https://github.com/warp-tech/warpgate.git
synced 2025-09-05 22:24:51 +08:00
lint
This commit is contained in:
parent
7e217d5f89
commit
5606ab8e66
20 changed files with 50 additions and 35 deletions
|
@ -20,7 +20,6 @@ export default [
|
|||
'@stylistic': stylistic,
|
||||
},
|
||||
languageOptions: {
|
||||
parser: svelteParser,
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
<Fa class="me-2" fw icon={faRefresh} />
|
||||
Regenerate
|
||||
</Button>
|
||||
<CopyButton class="d-flex align-items-center" color="secondary" text={totpUri!} label={'Copy URI'} />
|
||||
<CopyButton class="d-flex align-items-center" color="secondary" text={totpUri!} label='Copy URI' />
|
||||
</div>
|
||||
<FormGroup floating label="Paste the generated OTP code" class="mt-3" spacing="0">
|
||||
<Input
|
||||
|
|
|
@ -127,7 +127,7 @@ onDestroy(() => {
|
|||
<div class="table-wrapper">
|
||||
<table class="w-100">
|
||||
<tbody>
|
||||
{#each visibleItems as item}
|
||||
{#each visibleItems as item (item.id)}
|
||||
<tr>
|
||||
<td class="timestamp pe-4">
|
||||
{stringifyDate(item.timestamp)}
|
||||
|
@ -151,7 +151,7 @@ onDestroy(() => {
|
|||
{item.text}
|
||||
</span>
|
||||
|
||||
{#each Object.entries(item.values ?? {}) as pair}
|
||||
{#each Object.entries(item.values ?? {}) as pair (pair[0])}
|
||||
<span class="key">{pair[0]}:</span>
|
||||
<span class="value">{pair[1]}</span>
|
||||
{/each}
|
||||
|
@ -194,7 +194,6 @@ onDestroy(() => {
|
|||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
@import "../theme/vars.light";
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
{#if recordings?.length }
|
||||
<h3 class="mt-4">Recordings</h3>
|
||||
<div class="list-group list-group-flush">
|
||||
{#each recordings as recording}
|
||||
{#each recordings as recording (recording.id)}
|
||||
<a
|
||||
class="list-group-item list-group-item-action"
|
||||
href="/recordings/{recording.id}"
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
type="select"
|
||||
>
|
||||
<option value={null} selected>Any</option>
|
||||
{#each providers as provider}
|
||||
{#each providers as provider (provider.name)}
|
||||
<option value={provider.name}>{provider.label ?? provider.name}</option>
|
||||
{/each}
|
||||
</Input>
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
<!-- svelte-ignore a11y_label_has_associated_control -->
|
||||
<label class="mb-2">Type</label>
|
||||
<ButtonGroup class="w-100 mb-3">
|
||||
{#each kinds as kind}
|
||||
{#each kinds as kind (kind.value)}
|
||||
<RadioButton
|
||||
label={kind.name}
|
||||
value={kind.value}
|
||||
|
|
|
@ -92,7 +92,7 @@ async function create () {
|
|||
{#if users}
|
||||
<FormGroup floating label="Authorize as user">
|
||||
<select bind:value={selectedUser} class="form-control">
|
||||
{#each users as user}
|
||||
{#each users as user (user.id)}
|
||||
<option value={user}>
|
||||
{user.username}
|
||||
</option>
|
||||
|
@ -104,7 +104,7 @@ async function create () {
|
|||
{#if targets}
|
||||
<FormGroup floating label="Target">
|
||||
<select bind:value={selectedTarget} class="form-control">
|
||||
{#each targets as target}
|
||||
{#each targets as target (target.id)}
|
||||
<option value={target}>
|
||||
{target.name}
|
||||
</option>
|
||||
|
|
|
@ -36,7 +36,7 @@ async function deleteHost (host: SSHKnownHost) {
|
|||
<h2>Warpgate's own SSH keys</h2>
|
||||
<Alert color="info">Add these keys to the targets' <code>authorized_keys</code> files</Alert>
|
||||
<div class="list-group list-group-flush">
|
||||
{#each ownKeys as key}
|
||||
{#each ownKeys as key (key)}
|
||||
<div class="list-group-item d-flex">
|
||||
<pre>{key.kind} {key.publicKeyBase64}</pre>
|
||||
<div class="ms-auto">
|
||||
|
|
|
@ -47,7 +47,8 @@
|
|||
|
||||
{#if tickets.length}
|
||||
<div class="list-group list-group-flush">
|
||||
{#each tickets as ticket}
|
||||
{#each tickets as ticket (ticket.id)}
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<div class="list-group-item">
|
||||
<div>
|
||||
<strong>
|
||||
|
@ -79,7 +80,9 @@
|
|||
<small class="text-muted me-4 ms-auto">
|
||||
<RelativeDate date={ticket.created} />
|
||||
</small>
|
||||
<a href={''} onclick={e => {
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_missing_attribute -->
|
||||
<a onclick={e => {
|
||||
deleteTicket(ticket)
|
||||
e.preventDefault()
|
||||
}}>Delete</a>
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
|
||||
<h4 class="mt-4">User roles</h4>
|
||||
<div class="list-group list-group-flush mb-3">
|
||||
{#each allRoles as role}
|
||||
{#each allRoles as role (role.id)}
|
||||
<label
|
||||
for="role-{role.id}"
|
||||
class="list-group-item list-group-item-action d-flex align-items-center"
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
{#if result.trustedKeys.length}
|
||||
<strong>Known trusted keys:</strong>
|
||||
<div class="mb-2">
|
||||
{#each result.trustedKeys as key}
|
||||
{#each result.trustedKeys as key (key)}
|
||||
<pre class="key-value">{key} <CopyButton link text={key.toString()} class="copy-button" /></pre>
|
||||
{/each}
|
||||
</div>
|
||||
|
|
|
@ -22,6 +22,7 @@ interface Props {
|
|||
children: () => any
|
||||
}
|
||||
|
||||
// eslint-disable-next-line svelte/no-unused-props
|
||||
let { children, click, color = 'secondary', disabled = false, outline = false, type = 'submit', 'class': cls = '' }: Props = $props()
|
||||
|
||||
let button: HTMLElement | undefined = $state()
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
children?: () => any
|
||||
}
|
||||
|
||||
// eslint-disable-next-line svelte/no-unused-props
|
||||
let {
|
||||
text,
|
||||
disabled = false,
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
</div>
|
||||
{#if _items}
|
||||
<div class="list-group list-group-flush mb-3">
|
||||
{#each _items as _item}
|
||||
{#each _items as _item (_item)}
|
||||
{@render item?.(_item)}
|
||||
{/each}
|
||||
</div>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<Fa icon={faAngleLeft} />
|
||||
</PaginationLink>
|
||||
</PaginationItem>
|
||||
{#each pages as i}
|
||||
{#each pages as i (i)}
|
||||
{#if i !== null}
|
||||
<PaginationItem active={page === i}>
|
||||
<PaginationLink on:click={() => page = i} href="#">{i + 1}</PaginationLink>
|
||||
|
|
|
@ -29,7 +29,10 @@
|
|||
|
||||
<div class="page-summary-bar mt-4">
|
||||
<h1>API tokens</h1>
|
||||
<a href={''} class="btn btn-primary ms-auto" onclick={e => {
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<!-- svelte-ignore a11y_missing_attribute -->
|
||||
<a class="btn btn-primary ms-auto" onclick={e => {
|
||||
creatingToken = true
|
||||
e.preventDefault()
|
||||
}}>Create token</a>
|
||||
|
@ -54,7 +57,9 @@
|
|||
{/if}
|
||||
|
||||
<div class="list-group list-group-flush mb-3">
|
||||
{#each tokens as token}
|
||||
{#each tokens as token (token.id)}
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<!-- svelte-ignore a11y_missing_attribute -->
|
||||
<div class="list-group-item d-flex align-items-center">
|
||||
<Fa fw icon={faKey} />
|
||||
<span class="label ms-3">{token.label}</span>
|
||||
|
@ -64,9 +69,9 @@
|
|||
<Badge color="success" class="ms-2">{token.expiry.toLocaleDateString()}</Badge>
|
||||
{/if}
|
||||
<span class="ms-auto"></span>
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<a
|
||||
color="link"
|
||||
href={''}
|
||||
class="ms-2"
|
||||
onclick={e => {
|
||||
deleteToken(token)
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
</div>
|
||||
|
||||
{#if !doNotShowAuthRequests}
|
||||
{#each webAuthRequests as authRequest}
|
||||
{#each webAuthRequests as authRequest (authRequest.id)}
|
||||
<Button
|
||||
color="success"
|
||||
class="mb-4 d-flex align-items-center w-100 text-start"
|
||||
|
|
|
@ -78,9 +78,11 @@
|
|||
{/if}
|
||||
|
||||
<span class="ms-auto"></span>
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<!-- svelte-ignore a11y_missing_attribute -->
|
||||
<a
|
||||
class="ms-2"
|
||||
href={''}
|
||||
onclick={e => {
|
||||
changingPassword = true
|
||||
e.preventDefault()
|
||||
|
@ -107,21 +109,26 @@
|
|||
<div class="d-flex align-items-center mt-4 mb-2">
|
||||
<h4 class="m-0">One-time passwords</h4>
|
||||
<span class="ms-auto"></span>
|
||||
<a href={''} color="link" onclick={e => {
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_missing_attribute -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<a color="link" onclick={e => {
|
||||
creatingOtpCredential = true
|
||||
e.preventDefault()
|
||||
}}>Add device</a>
|
||||
</div>
|
||||
|
||||
<div class="list-group list-group-flush mb-3">
|
||||
{#each creds.otp as credential}
|
||||
{#each creds.otp as credential (credential.id)}
|
||||
<div class="list-group-item credential">
|
||||
<Fa fw icon={faMobilePhone} />
|
||||
<span class="label ms-3">OTP device</span>
|
||||
<span class="ms-auto"></span>
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<!-- svelte-ignore a11y_missing_attribute -->
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<a
|
||||
class="ms-2"
|
||||
href={''}
|
||||
onclick={e => {
|
||||
deleteOtp(credential)
|
||||
e.preventDefault()
|
||||
|
@ -142,14 +149,17 @@
|
|||
<div class="d-flex align-items-center mt-4 mb-2">
|
||||
<h4 class="m-0">Public keys</h4>
|
||||
<span class="ms-auto"></span>
|
||||
<a href={''} color="link" onclick={e => {
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_missing_attribute -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<a color="link" onclick={e => {
|
||||
creatingPublicKeyCredential = true
|
||||
e.preventDefault()
|
||||
}}>Add key</a>
|
||||
</div>
|
||||
|
||||
<div class="list-group list-group-flush mb-3">
|
||||
{#each creds.publicKeys as credential}
|
||||
{#each creds.publicKeys as credential (credential.id)}
|
||||
<div class="list-group-item credential">
|
||||
<Fa fw icon={faKey} />
|
||||
<div class="main ms-3">
|
||||
|
@ -158,9 +168,11 @@
|
|||
</div>
|
||||
<span class="ms-auto"></span>
|
||||
<CredentialUsedStateBadge credential={credential} />
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<!-- svelte-ignore a11y_missing_attribute -->
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
<a
|
||||
class="ms-2"
|
||||
href={''}
|
||||
onclick={e => {
|
||||
deletePublicKey(credential)
|
||||
e.preventDefault()
|
||||
|
@ -184,7 +196,7 @@
|
|||
</div>
|
||||
|
||||
<div class="list-group list-group-flush mb-3">
|
||||
{#each creds.sso as credential}
|
||||
{#each creds.sso as credential (credential.id)}
|
||||
<div class="list-group-item credential">
|
||||
<Fa fw icon={faIdBadge} />
|
||||
<span class="label ms-3">
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
<div class="mb-5">
|
||||
<div class="mb-2">Ensure this security key matches your authentication prompt:</div>
|
||||
<div class="identification-string">
|
||||
{#each authState?.identificationString as char}
|
||||
{#each authState?.identificationString as char (char)}
|
||||
<div class="card bg-secondary text-light">
|
||||
<div class="card-body">{char}</div>
|
||||
</div>
|
||||
|
|
|
@ -2,13 +2,8 @@
|
|||
import { faFileContract, faFlaskVial, faInfoCircle } from '@fortawesome/free-solid-svg-icons'
|
||||
import Fa from 'svelte-fa'
|
||||
import ApiTokenManager from './ApiTokenManager.svelte'
|
||||
import Alert from 'common/sveltestrap-s5-ports/Alert.svelte'
|
||||
</script>
|
||||
|
||||
<!-- <div class="page-summary-bar">
|
||||
<h1>API tokens</h1>
|
||||
</div> -->
|
||||
|
||||
<ApiTokenManager />
|
||||
|
||||
<div class="row mt-5">
|
||||
|
|
Loading…
Add table
Reference in a new issue