-
-
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
6 changed files
with
95 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
package bunker | ||
|
||
import ( | ||
"os" | ||
"strings" | ||
) | ||
|
||
type DataDir string | ||
|
||
func (d DataDir) String() string { | ||
return string(d) | ||
} | ||
|
||
var _debug map[string]bool | ||
|
||
func init() { | ||
_debug = make(map[string]bool) | ||
for _, v := range strings.Split(os.Getenv("DEBUG"), ",") { | ||
_debug[strings.TrimSpace(v)] = true | ||
} | ||
} | ||
|
||
func Debug(name string) bool { | ||
return _debug[name] | ||
} |
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,6 @@ | ||
export default defineAppConfig({ | ||
ui: { | ||
primary: "cyan", | ||
gray: "slate", | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
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 +1,62 @@ | ||
<template></template> | ||
<script setup lang="ts"> | ||
import type { FormError, FormSubmitEvent } from "#ui/types"; | ||
const state = reactive({ | ||
username: undefined, | ||
password: undefined, | ||
}); | ||
const validate = (state: any): FormError[] => { | ||
const errors = []; | ||
if (!state.username) errors.push({ path: "username", message: "Required" }); | ||
if (!state.password) errors.push({ path: "password", message: "Required" }); | ||
return errors; | ||
}; | ||
async function onSubmit(event: FormSubmitEvent<any>) { | ||
// Do something with data | ||
console.log(event.data); | ||
} | ||
</script> | ||
|
||
<template> | ||
<div | ||
class="absolute top-0 left-0 w-full h-full flex flex-col justify-center items-center" | ||
> | ||
<div class="mb-12"> | ||
<div class="font-semibold font-mono text-4xl mb-4">Bunker System</div> | ||
<div class="flex flex-row items-center"> | ||
<span class="me-2">by</span> | ||
<UButton | ||
size="sm" | ||
icon="i-simple-icons-github" | ||
variant="link" | ||
to="https://github.com/yankeguo/bunker" | ||
target="_blank" | ||
label="yankeguo" | ||
></UButton> | ||
</div> | ||
</div> | ||
|
||
<UCard class="w-80"> | ||
<UForm | ||
:validate="validate" | ||
:state="state" | ||
class="space-y-4" | ||
@submit="onSubmit" | ||
> | ||
<UFormGroup label="Username" name="username"> | ||
<UInput v-model="state.username" /> | ||
</UFormGroup> | ||
|
||
<UFormGroup label="Password" name="password"> | ||
<UInput v-model="state.password" type="password" /> | ||
</UFormGroup> | ||
|
||
<UButton type="submit">Sign In</UButton> | ||
</UForm> | ||
</UCard> | ||
|
||
<div class="h-64"></div> | ||
</div> | ||
</template> |
File renamed without changes.