-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
817 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
<template> | ||
<NuxtLoadingIndicator color="#0369a1" /> | ||
<UContainer> | ||
<UContainer class="pb-32"> | ||
<NuxtLayout> | ||
<NuxtPage></NuxtPage> | ||
</NuxtLayout> | ||
</UContainer> | ||
<UNotifications /> | ||
<Footer></Footer> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<script setup lang="ts"> | ||
const year = new Date().getFullYear(); | ||
const colorMode = useColorMode(); | ||
const isDark = computed({ | ||
get() { | ||
return colorMode.value === "dark"; | ||
}, | ||
set() { | ||
colorMode.preference = colorMode.value === "dark" ? "light" : "dark"; | ||
}, | ||
}); | ||
function setLanguage(lang: string) { | ||
document.cookie = `lang=${lang};path=/;max-age=31536000`; | ||
location.reload(); | ||
} | ||
</script> | ||
|
||
<template> | ||
<UContainer | ||
class="fixed py-2 bottom-0 left-0 right-0 flex flex-row justify-between items-center bg-slate-100 dark:bg-slate-800"> | ||
<UButton to="https://github.com/yankeguo/bunker" target="_blank" variant="link" size="sm" color="black" | ||
icon="i-simple-icons-github" label="yankeguo/bunker"></UButton> | ||
|
||
<div class="flex flex-row items-center"> | ||
<ClientOnly> | ||
<!-- i18n --> | ||
<template v-for="(item, idx) in $langs"> | ||
<a @click.prevent="setLanguage(item)" :class="{ | ||
'text-sm': true, | ||
underline: $lang === item, | ||
'me-2': true, | ||
}" href="#"> | ||
<span>{{ $langNames[item] }}</span> | ||
</a> | ||
<i class="i-bi-dot text-slate-400" /> | ||
</template> | ||
|
||
<UButton :icon="isDark ? 'i-heroicons-moon-20-solid' : 'i-heroicons-sun-20-solid' | ||
" size="2xs" color="black" variant="ghost" aria-label="Theme" :padded="false" @click="isDark = !isDark" /> | ||
|
||
<template #fallback> | ||
<div class="w-8 h-8"></div> | ||
</template> | ||
</ClientOnly> | ||
</div> | ||
|
||
</UContainer> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export const useGrantedItems = () => { | ||
return useAsyncData<{ granted_items: BGrantedItem[] }>( | ||
"granted-items", | ||
() => $fetch("/backend/granted_items"), | ||
{ | ||
default() { | ||
return { granted_items: [] }; | ||
}, | ||
} | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,49 @@ | ||
<script setup lang="ts"> | ||
import type { FormError, FormSubmitEvent } from "#ui/types"; | ||
import { guardWorking } from "~/composables/error"; | ||
const { $t } = useNuxtApp() | ||
definePageMeta({ | ||
middleware: ["auth"], | ||
}); | ||
const { data: items, refresh: refreshItems } = await useGrantedItems(); | ||
const columns = [ | ||
{ | ||
key: "server_user", | ||
label: $t('common.server_user'), | ||
}, | ||
{ | ||
key: "server_id", | ||
label: $t('common.server_id'), | ||
}, | ||
{ | ||
key: 'example', | ||
label: $t('dashboard.command_example') | ||
} | ||
]; | ||
function expandServerUser(s: string): string { | ||
if (s === '*') { | ||
return 'root' | ||
} | ||
return s | ||
} | ||
</script> | ||
<template> | ||
<SkeletonDashboard | ||
title-name="Dashboard" | ||
title-icon="i-mdi-view-dashboard" | ||
></SkeletonDashboard> | ||
<SkeletonDashboard :title-name="$t('dashboard.title')" title-icon="i-mdi-view-dashboard"> | ||
<template #left> | ||
<UCard :ui="uiCard"> | ||
<p></p> | ||
</UCard> | ||
</template> | ||
<UTable :rows="items.granted_items" :columns="columns"> | ||
<template #example-data="{ row }"> | ||
<code class="font-mono">ssh {{ expandServerUser(row.server_user) }}@{{ row.server_id }}@BUNKER_ADDRESS</code> | ||
</template> | ||
</UTable> | ||
</SkeletonDashboard> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.