mirror of
https://github.com/1f349/admin.1f349.com.git
synced 2025-02-21 13:04:56 +00:00
Add footer bar with git commit metadata
This commit is contained in:
parent
74b2969bac
commit
679080c0ef
@ -37,17 +37,6 @@
|
|||||||
<h1>🍉 Admin Panel</h1>
|
<h1>🍉 Admin Panel</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-gap" />
|
<div class="flex-gap" />
|
||||||
<div>
|
|
||||||
<label>
|
|
||||||
<span>Domain:</span>
|
|
||||||
<select bind:value={$domainOption}>
|
|
||||||
<option value="*">All</option>
|
|
||||||
{#each domainOptions as domain}
|
|
||||||
<option value={domain}>{domain}</option>
|
|
||||||
{/each}
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="nav-link">
|
<div class="nav-link">
|
||||||
<a href="https://status.1f349.com" target="_blank">Status</a>
|
<a href="https://status.1f349.com" target="_blank">Status</a>
|
||||||
</div>
|
</div>
|
||||||
@ -84,6 +73,26 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</main>
|
</main>
|
||||||
|
<footer>
|
||||||
|
<div class="meta-version">
|
||||||
|
Version: <code>{import.meta.env.VITE_APP_VERSION}</code>
|
||||||
|
, {import.meta.env.VITE_APP_LASTMOD}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="https://github.com/1f349/admin.1f349.com" target="_blank">Source</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label>
|
||||||
|
<span>Domain:</span>
|
||||||
|
<select bind:value={$domainOption}>
|
||||||
|
<option value="*">All</option>
|
||||||
|
{#each domainOptions as domain}
|
||||||
|
<option value={domain}>{domain}</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
header {
|
header {
|
||||||
@ -144,7 +153,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
height: calc(100% - 70px);
|
height: 0;
|
||||||
|
|
||||||
#sidebar {
|
#sidebar {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
@ -184,4 +193,13 @@
|
|||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
padding: 8px;
|
||||||
|
background-color: #2c2c2c;
|
||||||
|
box-shadow: 0 -4px 8px #0003, 0 -6px 20px #00000030;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
export let equality: (a: T | null, b: T | null) => boolean;
|
export let equality: (a: T | null, b: T | null) => boolean;
|
||||||
|
|
||||||
let tableKeys: string[] = [];
|
let tableKeys: string[] = [];
|
||||||
|
|
||||||
$: tableKeys = Object.entries($tableData)
|
$: tableKeys = Object.entries($tableData)
|
||||||
.filter(x => x[1].client != null || x[1].server != null)
|
.filter(x => x[1].client != null || x[1].server != null)
|
||||||
.map(x => x[0])
|
.map(x => x[0])
|
||||||
@ -27,7 +26,6 @@
|
|||||||
.sort((a, b) => a.localeCompare(b));
|
.sort((a, b) => a.localeCompare(b));
|
||||||
|
|
||||||
let rowStats: CountStats = {created: 0, modified: 0, removed: 0};
|
let rowStats: CountStats = {created: 0, modified: 0, removed: 0};
|
||||||
|
|
||||||
$: rowStats = tableCountStats($tableData, tableKeys, equality);
|
$: rowStats = tableCountStats($tableData, tableKeys, equality);
|
||||||
|
|
||||||
function domainFilter(src: string, domain: string) {
|
function domainFilter(src: string, domain: string) {
|
||||||
@ -177,7 +175,7 @@
|
|||||||
|
|
||||||
:global(th),
|
:global(th),
|
||||||
:global(td) {
|
:global(td) {
|
||||||
padding: 11px 8px 11px 8px;
|
padding: 6px 8px 6px 8px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"target": "ESNext",
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
|
@ -1,5 +1,19 @@
|
|||||||
import {defineConfig} from "vite";
|
import {defineConfig} from "vite";
|
||||||
import {svelte} from "@sveltejs/vite-plugin-svelte";
|
import {svelte} from "@sveltejs/vite-plugin-svelte";
|
||||||
|
import {exec} from "child_process";
|
||||||
|
import {promisify} from "util";
|
||||||
|
|
||||||
|
// Get current tag/commit and last commit date from git
|
||||||
|
const pexec = promisify(exec);
|
||||||
|
let [version, lastmod] = (
|
||||||
|
await Promise.allSettled([
|
||||||
|
pexec("git describe --tags || git rev-parse --short HEAD"),
|
||||||
|
pexec('git log -1 --format=%cd --date=format:"%Y-%m-%d %H:%M"'),
|
||||||
|
])
|
||||||
|
).map(v => (v as {value?: {stdout: string}}).value?.stdout.trim());
|
||||||
|
|
||||||
|
process.env.VITE_APP_VERSION = version;
|
||||||
|
process.env.VITE_APP_LASTMOD = lastmod;
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user