feat: add Git card to login page dashboard
This commit is contained in:
@@ -3,6 +3,7 @@ import Base from '../layouts/Base.astro';
|
||||
const activityUrl = import.meta.env.PUBLIC_ACTIVITY_URL ?? '';
|
||||
const wikiUrl = import.meta.env.PUBLIC_WIKI_URL ?? '';
|
||||
const plannerUrl = import.meta.env.PUBLIC_PLANNER_URL ?? '';
|
||||
const gitUrl = import.meta.env.PUBLIC_GIT_URL ?? '';
|
||||
---
|
||||
<Base title="Bincio">
|
||||
<div id="cards" class="grid grid-cols-1 sm:grid-cols-2 gap-4 mt-4">
|
||||
@@ -11,7 +12,7 @@ const plannerUrl = import.meta.env.PUBLIC_PLANNER_URL ?? '';
|
||||
</div>
|
||||
</Base>
|
||||
|
||||
<script define:vars={{ activityUrl, wikiUrl, plannerUrl }}>
|
||||
<script define:vars={{ activityUrl, wikiUrl, plannerUrl, gitUrl }}>
|
||||
fetch('/api/me', { credentials: 'include' })
|
||||
.then(async r => {
|
||||
if (!r.ok) { window.location.replace('/login/'); return; }
|
||||
@@ -42,6 +43,14 @@ const plannerUrl = import.meta.env.PUBLIC_PLANNER_URL ?? '';
|
||||
desc: 'Route planning and elevation',
|
||||
icon: '🗺️',
|
||||
},
|
||||
{
|
||||
key: 'git',
|
||||
url: gitUrl,
|
||||
show: gitUrl,
|
||||
label: 'Git',
|
||||
desc: 'Source code and repositories',
|
||||
icon: '🐙',
|
||||
},
|
||||
].filter(s => s.show);
|
||||
|
||||
const container = document.getElementById('cards');
|
||||
|
||||
Reference in New Issue
Block a user