Add GitHub plugin release imports and update discovery
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import { artifactVersionLabel } from '$lib/artifact-version.js';
|
||||
import PluginGithubImport from './PluginGithubImport.svelte';
|
||||
import type { PluginSource } from '$lib/plugin-github.js';
|
||||
import { goto } from '$app/navigation';
|
||||
import Card from './primitives/Card.svelte';
|
||||
import Badge from './primitives/Badge.svelte';
|
||||
@@ -30,6 +32,7 @@
|
||||
interface Version {
|
||||
id: number; version: number; sha256: string; size: number;
|
||||
release_version: string | null;
|
||||
source: PluginSource | null;
|
||||
notes: string | null; state: 'untested' | 'tested' | 'test-failed';
|
||||
uploaded_at: string;
|
||||
}
|
||||
@@ -340,7 +343,9 @@
|
||||
<span class="v-num">{artifactVersionLabel(v)}</span>
|
||||
<span class="v-sha">{v.sha256.slice(0, 12)}</span>
|
||||
<span class="v-size">{v.size} B</span>
|
||||
<span class="v-notes">{v.notes ?? ''}</span>
|
||||
<span class="v-notes">{v.notes ?? ''}
|
||||
{#if v.source}<a href={v.source.release_url} target="_blank" rel="noreferrer">GitHub · {v.source.asset_name} ↗</a>{/if}
|
||||
</span>
|
||||
<span class="v-when">{v.uploaded_at}</span>
|
||||
{#if a.current_version_id === v.id}
|
||||
<Badge variant="online" size="sm">Promoted</Badge>
|
||||
@@ -353,6 +358,10 @@
|
||||
{/if}
|
||||
</Card>
|
||||
|
||||
{#if family === 'plugin'}
|
||||
<div id="github-releases"><PluginGithubImport pluginId={id} targetPath={a.target_rel_path} disabled={runningBetaId !== null} onimport={() => load()} /></div>
|
||||
{/if}
|
||||
|
||||
<Card padding="lg">
|
||||
<div class="panel-head"><h2>Danger zone</h2></div>
|
||||
<Button variant="danger" onclick={deleteArtifact}>Delete {family}</Button>
|
||||
@@ -500,6 +509,8 @@
|
||||
.v-num { color: var(--text-primary); font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
|
||||
.v-sha, .v-size, .v-when { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
|
||||
.v-notes { color: var(--text-secondary); font-family: var(--font-body); font-size: var(--text-sm); }
|
||||
.v-notes { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow-y: auto; }
|
||||
.v-notes a { display: block; color: var(--accent-primary-hover); margin-top: var(--space-2); }
|
||||
|
||||
.alert {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
|
||||
Reference in New Issue
Block a user