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 activityUrl = import.meta.env.PUBLIC_ACTIVITY_URL ?? '';
|
||||||
const wikiUrl = import.meta.env.PUBLIC_WIKI_URL ?? '';
|
const wikiUrl = import.meta.env.PUBLIC_WIKI_URL ?? '';
|
||||||
const plannerUrl = import.meta.env.PUBLIC_PLANNER_URL ?? '';
|
const plannerUrl = import.meta.env.PUBLIC_PLANNER_URL ?? '';
|
||||||
|
const gitUrl = import.meta.env.PUBLIC_GIT_URL ?? '';
|
||||||
---
|
---
|
||||||
<Base title="Bincio">
|
<Base title="Bincio">
|
||||||
<div id="cards" class="grid grid-cols-1 sm:grid-cols-2 gap-4 mt-4">
|
<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>
|
</div>
|
||||||
</Base>
|
</Base>
|
||||||
|
|
||||||
<script define:vars={{ activityUrl, wikiUrl, plannerUrl }}>
|
<script define:vars={{ activityUrl, wikiUrl, plannerUrl, gitUrl }}>
|
||||||
fetch('/api/me', { credentials: 'include' })
|
fetch('/api/me', { credentials: 'include' })
|
||||||
.then(async r => {
|
.then(async r => {
|
||||||
if (!r.ok) { window.location.replace('/login/'); return; }
|
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',
|
desc: 'Route planning and elevation',
|
||||||
icon: '🗺️',
|
icon: '🗺️',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'git',
|
||||||
|
url: gitUrl,
|
||||||
|
show: gitUrl,
|
||||||
|
label: 'Git',
|
||||||
|
desc: 'Source code and repositories',
|
||||||
|
icon: '🐙',
|
||||||
|
},
|
||||||
].filter(s => s.show);
|
].filter(s => s.show);
|
||||||
|
|
||||||
const container = document.getElementById('cards');
|
const container = document.getElementById('cards');
|
||||||
|
|||||||
Reference in New Issue
Block a user