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

@ -1,170 +1,123 @@
<script> <script>
import { page } from '$app/stores'; import { page } from '$app/stores';
import { client } from 'twirpscript'; import { client } from 'twirpscript';
import { GetPkg } from '$lib/lure.pb'; import { GetPkg } from '$lib/lure.pb';
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 = ``; function fullVer(pkg) {
onMount(() => (currentURL = window.location.href)); let ver = `${pkg.version}-${pkg.release}`;
if (pkg.epoch != 0) {
ver = `${pkg.epoch}:${ver}`
}
return ver
}
function fullVer(pkg) { function objToMap(o) {
let ver = `${pkg.version}-${pkg.release}`; return new Map(Object.entries(o))
if (pkg.epoch != 0) { }
ver = `${pkg.epoch}:${ver}`;
}
return ver;
}
function objToMap(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' : ''}"> <p class="title">{pkg.name}</p>
<div class="modal-background"/> <p class="subtitle mb-3">{fullVer(pkg)}</p>
<div class="modal-card"> <a href="/pkg/{pkg.repository}/{pkg.name}/lure.sh" class="button is-primary mb-5">View lure.sh</a>
<header class="modal-card-head"> <div class="box">
<p class="modal-card-title">Badge</p> <table class="table is-hoverable is-fullwidth">
<button class="delete" aria-label="close" on:click={hideModal}/> <tbody>
</header> {#if pkg.description != ""}
<section class="modal-card-body"> <tr>
<img <th>Description:</th>
src="{LURE_WEB_API_URL}/badge/{$page.params.repo}/{$page.params.name}" <td>{pkg.description}</td>
alt="badge for {$page.params.name} package" </tr>
/> {/if}
{#if pkg.homepage != ""}
<p>Markdown</p> <tr>
<input <th>Homepage:</th>
class="input" <td><a href="{pkg.homepage}">{pkg.homepage}</a></td>
value="[![LURE badge for {$page.params.name} package]({LURE_WEB_API_URL}/badge/{$page.params.repo}/{$page.params.name})]({currentURL})" </tr>
readonly {/if}
/> {#if pkg.maintainer != ""}
<p>HTML</p> <tr>
<input <th>Maintainer:</th>
class="input" <td>{pkg.maintainer}</td>
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>' </tr>
readonly {/if}
/> {#if pkg.licenses.length != 0}
</section> <tr>
<footer class="modal-card-foot"> <th>Licenses:</th>
<button class="button is-primary" on:click={hideModal}>Close</button> <td>
</footer> {#each pkg.licenses as license, index}
</div> {#if license.startsWith('custom')}
</div> {license}{#if index+1 < pkg.licenses.length},&nbsp{/if}
<p class="title">{pkg.name}</p> {:else}
<p class="subtitle mb-3">{fullVer(pkg)}</p> <a href="https://spdx.org/licenses/{license}.html">{license}</a>{#if index+1 < pkg.licenses.length},&nbsp;{/if}
<a href="/pkg/{pkg.repository}/{pkg.name}/lure.sh" class="button is-primary mb-5">View lure.sh</a> {/if}
<button href="/pkg/{pkg.repository}/{pkg.name}/lure.sh" class="button is-success mb-5 ml-1" on:click={showModal}>View badge</button> {/each}
<div class="box"> </td>
<table class="table is-hoverable is-fullwidth"> </tr>
<tbody> {/if}
{#if pkg.description != ''} {#if pkg.architectures.length != 0}
<tr> <tr>
<th>Description:</th> <th>Architectures:</th>
<td>{pkg.description}</td> <td>{pkg.architectures.join(', ')}</td>
</tr> </tr>
{/if} {/if}
{#if pkg.homepage != ''} {#if pkg.conflicts.length != 0}
<tr> <tr>
<th>Homepage:</th> <th>Conflicts:</th>
<td><a href={pkg.homepage}>{pkg.homepage}</a></td> <td>{pkg.conflicts.join(', ')}</td>
</tr> </tr>
{/if} {/if}
{#if pkg.maintainer != ''} {#if pkg.provides.length != 0}
<tr> <tr>
<th>Maintainer:</th> <th>Provides:</th>
<td>{pkg.maintainer}</td> <td>{pkg.provides.join(', ')}</td>
</tr> </tr>
{/if} {/if}
{#if pkg.licenses.length != 0} {#each [...objToMap(pkg.depends)] as [override, pkgList]}
<tr> <tr>
<th>Licenses:</th> <th>Depends ({override == "" ? "default" : override}):</th>
<td> <td>{pkgList.entries.join(', ')}</td>
{#each pkg.licenses as license, index} </tr>
{#if license.startsWith('custom')} {/each}
{license}{#if index + 1 < pkg.licenses.length},&nbsp{/if} {#each [...objToMap(pkg.buildDepends)] as [override, pkgList]}
{:else} <tr>
<a href="https://spdx.org/licenses/{license}.html">{license}</a <th>Build Depends ({override != "" ? override : "default"}):</th>
>{#if index + 1 < pkg.licenses.length},&nbsp;{/if} <td>{pkgList.entries.join(', ')}</td>
{/if} </tr>
{/each} {/each}
</td> <tr>
</tr> <th>Repository:</th>
{/if} <td>{pkg.repository}</td>
{#if pkg.architectures.length != 0} </tr>
<tr> </tbody>
<th>Architectures:</th> </table>
<td>{pkg.architectures.join(', ')}</td> </div>
</tr> {:catch err}
{/if} <div class="notification is-danger my-3">
{#if pkg.conflicts.length != 0} Error: {err.msg}
<tr> </div>
<th>Conflicts:</th> {/await}
<td>{pkg.conflicts.join(', ')}</td>
</tr>
{/if}
{#if pkg.provides.length != 0}
<tr>
<th>Provides:</th>
<td>{pkg.provides.join(', ')}</td>
</tr>
{/if}
{#each [...objToMap(pkg.depends)] as [override, pkgList]}
<tr>
<th>Depends ({override == '' ? 'default' : override}):</th>
<td>{pkgList.entries.join(', ')}</td>
</tr>
{/each}
{#each [...objToMap(pkg.buildDepends)] as [override, pkgList]}
<tr>
<th>Build Depends ({override != '' ? override : 'default'}):</th>
<td>{pkgList.entries.join(', ')}</td>
</tr>
{/each}
<tr>
<th>Repository:</th>
<td>{pkg.repository}</td>
</tr>
</tbody>
</table>
</div>
{:catch err}
<div class="notification is-danger my-3">
Error: {err.msg}
</div>
{/await}
</section> </section>
<Footer /> <Footer/>

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"]
} }