Compare commits

..

No commits in common. "dbe75ce5fd7646f7aa031840d1b5133e2bebdbd5" and "0e6a2fdf2fc1ecdbcedd18f9b5417b1f090431a5" have entirely different histories.

3 changed files with 110 additions and 157 deletions

View File

@ -13,7 +13,7 @@ pipeline:
event: push event: push
deploy: deploy:
image: loq9/drone-nomad image: elara6331/drone-nomad
secrets: [lure_api_github_secret] secrets: [lure_api_github_secret]
settings: settings:
addr: http://192.168.100.62:4646 addr: http://192.168.100.62:4646

View File

@ -5,104 +5,58 @@
import { LURE_WEB_API_URL } from '$env/static/public'; import { LURE_WEB_API_URL } from '$env/static/public';
import { DoubleBounce } from 'svelte-loading-spinners'; import { DoubleBounce } from 'svelte-loading-spinners';
import Header from '../../../header.svelte'; import Header from "../../../header.svelte";
import Footer from '../../../footer.svelte'; import Footer from "../../../footer.svelte";
import Icon from '@iconify/svelte'; import Icon from '@iconify/svelte';
import { onMount } from 'svelte';
client.baseURL = LURE_WEB_API_URL; client.baseURL = LURE_WEB_API_URL
client.prefix = ''; client.prefix = ""
let currentURL = ``;
onMount(() => (currentURL = window.location.href));
function fullVer(pkg) { function fullVer(pkg) {
let ver = `${pkg.version}-${pkg.release}`; let ver = `${pkg.version}-${pkg.release}`;
if (pkg.epoch != 0) { if (pkg.epoch != 0) {
ver = `${pkg.epoch}:${ver}`; ver = `${pkg.epoch}:${ver}`
} }
return ver; return ver
} }
function objToMap(o) { function objToMap(o) {
return new Map(Object.entries(o)); return new Map(Object.entries(o))
}
let modalActive = false;
function showModal() {
modalActive = true;
}
function hideModal() {
modalActive = false;
} }
</script> </script>
<svelte:head> <svelte:head>
<title>{$page.params.name} Package | LURE Web</title> <title>{$page.params.name} Package | LURE Web</title>
<meta name="description" content="Information about the {$page.params.name} LURE package." /> <meta name="description" content="Information about the {$page.params.name} LURE package.">
</svelte:head> </svelte:head>
<Header/> <Header/>
<section class="container"> <section class="container">
<a href="/pkgs"><Icon icon="material-symbols:arrow-back-rounded" inline="true" /> Back</a> <a href="/pkgs"><Icon icon="material-symbols:arrow-back-rounded" inline=true/> Back</a>
{#await GetPkg({name: $page.params.name, repository: $page.params.repo})} {#await GetPkg({name: $page.params.name, repository: $page.params.repo})}
<center><DoubleBounce color="#375a7f" /></center> <center><DoubleBounce color="#375a7f" /></center>
{:then pkg} {:then pkg}
<div class="modal {modalActive ? 'is-active' : ''}">
<div class="modal-background"/>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Badge</p>
<button class="delete" aria-label="close" on:click={hideModal}/>
</header>
<section class="modal-card-body">
<img
src="{LURE_WEB_API_URL}/badge/{$page.params.repo}/{$page.params.name}"
alt="badge for {$page.params.name} package"
/>
<p>Markdown</p>
<input
class="input"
value="[![LURE badge for {$page.params.name} package]({LURE_WEB_API_URL}/badge/{$page.params.repo}/{$page.params.name})]({currentURL})"
readonly
/>
<p>HTML</p>
<input
class="input"
value='<a href="{currentURL}"><img src="{LURE_WEB_API_URL}/badge/{$page.params.repo}/{$page.params.name}" alt="LURE badge for {$page.params.name} package"></a>'
readonly
/>
</section>
<footer class="modal-card-foot">
<button class="button is-primary" on:click={hideModal}>Close</button>
</footer>
</div>
</div>
<p class="title">{pkg.name}</p> <p class="title">{pkg.name}</p>
<p class="subtitle mb-3">{fullVer(pkg)}</p> <p class="subtitle mb-3">{fullVer(pkg)}</p>
<a href="/pkg/{pkg.repository}/{pkg.name}/lure.sh" class="button is-primary mb-5">View lure.sh</a> <a href="/pkg/{pkg.repository}/{pkg.name}/lure.sh" class="button is-primary mb-5">View lure.sh</a>
<button href="/pkg/{pkg.repository}/{pkg.name}/lure.sh" class="button is-success mb-5 ml-1" on:click={showModal}>View badge</button>
<div class="box"> <div class="box">
<table class="table is-hoverable is-fullwidth"> <table class="table is-hoverable is-fullwidth">
<tbody> <tbody>
{#if pkg.description != ''} {#if pkg.description != ""}
<tr> <tr>
<th>Description:</th> <th>Description:</th>
<td>{pkg.description}</td> <td>{pkg.description}</td>
</tr> </tr>
{/if} {/if}
{#if pkg.homepage != ''} {#if pkg.homepage != ""}
<tr> <tr>
<th>Homepage:</th> <th>Homepage:</th>
<td><a href={pkg.homepage}>{pkg.homepage}</a></td> <td><a href="{pkg.homepage}">{pkg.homepage}</a></td>
</tr> </tr>
{/if} {/if}
{#if pkg.maintainer != ''} {#if pkg.maintainer != ""}
<tr> <tr>
<th>Maintainer:</th> <th>Maintainer:</th>
<td>{pkg.maintainer}</td> <td>{pkg.maintainer}</td>
@ -116,8 +70,7 @@
{#if license.startsWith('custom')} {#if license.startsWith('custom')}
{license}{#if index+1 < pkg.licenses.length},&nbsp{/if} {license}{#if index+1 < pkg.licenses.length},&nbsp{/if}
{:else} {:else}
<a href="https://spdx.org/licenses/{license}.html">{license}</a <a href="https://spdx.org/licenses/{license}.html">{license}</a>{#if index+1 < pkg.licenses.length},&nbsp;{/if}
>{#if index + 1 < pkg.licenses.length},&nbsp;{/if}
{/if} {/if}
{/each} {/each}
</td> </td>
@ -143,13 +96,13 @@
{/if} {/if}
{#each [...objToMap(pkg.depends)] as [override, pkgList]} {#each [...objToMap(pkg.depends)] as [override, pkgList]}
<tr> <tr>
<th>Depends ({override == '' ? 'default' : override}):</th> <th>Depends ({override == "" ? "default" : override}):</th>
<td>{pkgList.entries.join(', ')}</td> <td>{pkgList.entries.join(', ')}</td>
</tr> </tr>
{/each} {/each}
{#each [...objToMap(pkg.buildDepends)] as [override, pkgList]} {#each [...objToMap(pkg.buildDepends)] as [override, pkgList]}
<tr> <tr>
<th>Build Depends ({override != '' ? override : 'default'}):</th> <th>Build Depends ({override != "" ? override : "default"}):</th>
<td>{pkgList.entries.join(', ')}</td> <td>{pkgList.entries.join(', ')}</td>
</tr> </tr>
{/each} {/each}

View File

@ -26,7 +26,7 @@ job "lure-web" {
} }
config { config {
image = "elara6331/lure-api-server:latest" image = "arsen6331/lure-api-server:latest"
ports = ["api"] ports = ["api"]
} }