-
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
19 changed files
with
351 additions
and
556 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
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,64 @@ | ||
<script setup lang="ts"> | ||
import logo from '../../../../../images/logo-alt.png' | ||
defineEmits(['hamburgerTap']) | ||
</script> | ||
|
||
<template> | ||
<nav | ||
class="bg-white border-b border-gray-200 px-4 py-2.5 dark:bg-gray-800 dark:border-gray-700 fixed left-0 right-0 top-0 z-50"> | ||
<div class="flex flex-wrap justify-between items-center"> | ||
<div class="flex justify-start items-center"> | ||
<button | ||
data-drawer-target="drawer-navigation" | ||
data-drawer-toggle="drawer-navigation" | ||
aria-controls="drawer-navigation" | ||
class="p-2 mr-2 text-gray-600 rounded-lg cursor-pointer md:hidden hover:text-gray-900 hover:bg-gray-100 focus:bg-gray-100 dark:focus:bg-gray-700 focus:ring-2 focus:ring-gray-100 dark:focus:ring-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white" | ||
@click="$emit('hamburgerTap')" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
class="w-6 h-6" | ||
fill="currentColor" | ||
viewBox="0 0 20 20" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
fill-rule="evenodd" | ||
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" | ||
clip-rule="evenodd" | ||
></path> | ||
</svg> | ||
<svg | ||
aria-hidden="true" | ||
class="hidden w-6 h-6" | ||
fill="currentColor" | ||
viewBox="0 0 20 20" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
fill-rule="evenodd" | ||
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" | ||
clip-rule="evenodd" | ||
></path> | ||
</svg> | ||
<span class="sr-only">Toggle sidebar</span> | ||
</button> | ||
<a href="/" class="flex items-center justify-between mr-4"> | ||
<img :src="logo" alt="Project City Build" /> | ||
</a> | ||
</div> | ||
<div class="flex items-center lg:order-2"> | ||
<button | ||
type="button" | ||
class="flex mx-3 text-sm bg-gray-800 rounded-full md:mr-0 focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600" | ||
id="user-menu-button" | ||
aria-expanded="false" | ||
> | ||
<span class="sr-only">Open user menu</span> | ||
TODO | ||
</button> | ||
</div> | ||
</div> | ||
</nav> | ||
</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,143 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import { Link } from '@inertiajs/vue3' | ||
import SideBarMenuItem from './SideBarMenuItem.vue' | ||
const selected = ref<string|null>(null) | ||
</script> | ||
|
||
<template> | ||
<aside | ||
class=" | ||
fixed top-0 left-0 z-40 | ||
w-64 h-screen pt-14 | ||
transition-transform -translate-x-full md:translate-x-0 | ||
border-r border-gray-200 dark:border-gray-700 | ||
bg-white dark:bg-gray-800 | ||
" | ||
id="drawer-navigation" | ||
> | ||
<div class="overflow-y-auto py-5 px-3 h-full bg-white dark:bg-gray-800"> | ||
<ul class="space-y-2"> | ||
<li> | ||
<Link | ||
href="/manage" | ||
class="flex items-center p-2 text-base font-medium text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 group" | ||
> | ||
<svg | ||
class="w-6 h-6 text-gray-800 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" | ||
aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" | ||
viewBox="0 0 24 24"> | ||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | ||
d="m4 12 8-8 8 8M6 10.5V19a1 1 0 0 0 1 1h3v-3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3h3a1 1 0 0 0 1-1v-8.5"/> | ||
</svg> | ||
<span class="ml-3">Overview</span> | ||
</Link> | ||
</li> | ||
|
||
<SideBarMenuItem | ||
title="Users" | ||
v-model:selected="selected" | ||
:children="[ | ||
{title: 'Accounts', route: '/manage/accounts'}, | ||
{title: 'Groups', route: '/manage/groups'}, | ||
{title: 'Badges', route: '/manage/badges'}, | ||
]" | ||
> | ||
<template v-slot:icon> | ||
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" | ||
xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"> | ||
<path stroke="currentColor" stroke-linecap="round" stroke-width="2" | ||
d="M16 19h4a1 1 0 0 0 1-1v-1a3 3 0 0 0-3-3h-2m-2.236-4a3 3 0 1 0 0-4M3 18v-1a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1Zm8-10a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/> | ||
</svg> | ||
</template> | ||
</SideBarMenuItem> | ||
|
||
<SideBarMenuItem | ||
title="Moderation" | ||
v-model:selected="selected" | ||
:children="[ | ||
{title: 'Player Bans', route: '/manage/player-bans'}, | ||
{title: 'IP Bans', route: '/manage/ip-bans'}, | ||
{title: 'Warnings', route: '/manage/warnings'}, | ||
]" | ||
> | ||
<template v-slot:icon> | ||
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" | ||
xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"> | ||
<path stroke="currentColor" stroke-width="2" | ||
d="M21 12c0 1.2-4.03 6-9 6s-9-4.8-9-6c0-1.2 4.03-6 9-6s9 4.8 9 6Z"/> | ||
<path stroke="currentColor" stroke-width="2" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/> | ||
</svg> | ||
</template> | ||
</SideBarMenuItem> | ||
|
||
<SideBarMenuItem | ||
title="Minecraft" | ||
v-model:selected="selected" | ||
:children="[ | ||
{title: 'Players', route: '/manage/players'}, | ||
{title: 'Remote Config', route: '/manage/minecraft/config'}, | ||
{title: 'Warps', route: '/manage/minecraft/warps'}, | ||
]" | ||
> | ||
<template v-slot:icon> | ||
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" | ||
xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"> | ||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | ||
d="M9.143 4H4.857A.857.857 0 0 0 4 4.857v4.286c0 .473.384.857.857.857h4.286A.857.857 0 0 0 10 9.143V4.857A.857.857 0 0 0 9.143 4Zm10 0h-4.286a.857.857 0 0 0-.857.857v4.286c0 .473.384.857.857.857h4.286A.857.857 0 0 0 20 9.143V4.857A.857.857 0 0 0 19.143 4Zm-10 10H4.857a.857.857 0 0 0-.857.857v4.286c0 .473.384.857.857.857h4.286a.857.857 0 0 0 .857-.857v-4.286A.857.857 0 0 0 9.143 14Zm10 0h-4.286a.857.857 0 0 0-.857.857v4.286c0 .473.384.857.857.857h4.286a.857.857 0 0 0 .857-.857v-4.286a.857.857 0 0 0-.857-.857Z"/> | ||
</svg> | ||
</template> | ||
</SideBarMenuItem> | ||
|
||
<SideBarMenuItem | ||
title="Servers" | ||
v-model:selected="selected" | ||
:children="[ | ||
{title: 'Game Servers', route: '/manage/servers'}, | ||
{title: 'Tokens', route: '/manage/server-tokens'}, | ||
]" | ||
> | ||
<template v-slot:icon> | ||
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" | ||
xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"> | ||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | ||
d="M5 12a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1M5 12h14M5 12a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1m-2 3h.01M14 15h.01M17 9h.01M14 9h.01"/> | ||
</svg> | ||
</template> | ||
</SideBarMenuItem> | ||
|
||
<SideBarMenuItem | ||
title="Payments" | ||
v-model:selected="selected" | ||
:children="[ | ||
{title: 'Donations', route: '/manage/donations'}, | ||
]" | ||
> | ||
<template v-slot:icon> | ||
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" | ||
xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"> | ||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | ||
d="M5 18h14M5 18v3h14v-3M5 18l1-9h12l1 9M16 6v3m-4-3v3m-2-6h8v3h-8V3Zm-1 9h.01v.01H9V12Zm3 0h.01v.01H12V12Zm3 0h.01v.01H15V12Zm-6 3h.01v.01H9V15Zm3 0h.01v.01H12V15Zm3 0h.01v.01H15V15Z"/> | ||
</svg> | ||
</template> | ||
</SideBarMenuItem> | ||
</ul> | ||
<ul class="pt-5 mt-5 space-y-2 border-t border-gray-200 dark:border-gray-700"> | ||
<li> | ||
<Link | ||
href="/manage/activity" | ||
class="flex items-center p-2 text-base font-medium text-gray-900 rounded-lg transition duration-75 hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white group" | ||
> | ||
<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" | ||
xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"> | ||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | ||
d="M12 6.03v13m0-13c-2.819-.831-4.715-1.076-8.029-1.023A.99.99 0 0 0 3 6v11c0 .563.466 1.014 1.03 1.007 3.122-.043 5.018.212 7.97 1.023m0-13c2.819-.831 4.715-1.076 8.029-1.023A.99.99 0 0 1 21 6v11c0 .563-.466 1.014-1.03 1.007-3.122-.043-5.018.212-7.97 1.023"/> | ||
</svg> | ||
<span class="ml-3">Audit Logs</span> | ||
</Link> | ||
</li> | ||
</ul> | ||
</div> | ||
</aside> | ||
</template> |
83 changes: 83 additions & 0 deletions
83
resources/js/review/Layouts/Root/Partials/SideBarMenuItem.vue
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,83 @@ | ||
<script setup lang="ts"> | ||
import { Link, usePage } from '@inertiajs/vue3' | ||
import { onBeforeMount, ref, useId, watch, computed } from 'vue' | ||
import SvgIcon from '../../../Components/SvgIcon.vue' | ||
interface MenuItem { | ||
title: string, | ||
route: string, | ||
} | ||
interface Props { | ||
title: string, | ||
children: MenuItem[], | ||
} | ||
const id = useId() | ||
const page = usePage() | ||
const props = defineProps<Props>() | ||
const selectedParent = defineModel('selected') | ||
const selectedChild = ref<MenuItem|null>(getSelectedChild(page.url)) | ||
function select() { | ||
if (expanded.value) { | ||
selectedParent.value = null | ||
} else { | ||
selectedParent.value = id | ||
} | ||
} | ||
const expanded = computed(() => selectedParent == id) | ||
function getSelectedChild(url: string) { | ||
return props.children.find( | ||
(child) => url.startsWith(child.route) | ||
) | ||
} | ||
function checkSelection(url: string) { | ||
selectedChild.value = getSelectedChild(url) | ||
if (selectedChild.value) { | ||
selectedParent.value = id | ||
} | ||
} | ||
onBeforeMount(() => checkSelection(page.url)) | ||
watch(() => page.url, checkSelection) | ||
</script> | ||
|
||
<template> | ||
<li> | ||
<button | ||
type="button" | ||
:class=" | ||
(expanded ? 'font-bold ' : '') + | ||
'flex items-center p-2 w-full text-base text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700' | ||
" | ||
@click="select" | ||
> | ||
<slot name="icon"></slot> | ||
<span class="flex-1 ml-3 text-left whitespace-nowrap">{{ props.title }}</span> | ||
|
||
<SvgIcon v-if="selectedParent == id" icon="chevron-up" :thickness="2" class="size-6" /> | ||
<SvgIcon v-else icon="chevron-down" :thickness="2" class="size-6" /> | ||
</button> | ||
|
||
<ul class="py-2 space-y-2" v-if="selectedParent == id"> | ||
<li v-for="item in props.children"> | ||
<Link | ||
:href="item.route" | ||
:class=" | ||
(selectedChild?.route == item.route ? 'font-bold ' : '') + | ||
'flex items-center p-2 pl-11 w-full text-sm text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700' | ||
" | ||
> | ||
{{ item.title }} | ||
</Link> | ||
</li> | ||
</ul> | ||
</li> | ||
</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,16 @@ | ||
<script setup> | ||
import SideBar from './Partials/SideBar.vue' | ||
import NavBar from './Partials/NavBar.vue' | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<NavBar /> | ||
|
||
<SideBar /> | ||
|
||
<main class="mx-auto max-w-screen-xl p-4 md:p-8 md:ml-64 h-auto mt-16"> | ||
<slot /> | ||
</main> | ||
</div> | ||
</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,17 @@ | ||
import { createApp, h } from 'vue' | ||
import { createInertiaApp } from '@inertiajs/vue3' | ||
import RootLayout from './Layouts/Root/RootLayout.vue' | ||
|
||
createInertiaApp({ | ||
resolve: name => { | ||
const pages = import.meta.glob('./Pages/**/*.vue', {eager: true}) | ||
let page = pages[`./Pages/${name}.vue`] | ||
page.default.layout = page.default.layout || RootLayout | ||
return page | ||
}, | ||
setup({el, App, props, plugin}) { | ||
createApp({render: () => h(App, props)}) | ||
.use(plugin) | ||
.mount(el) | ||
}, | ||
}) |
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,5 @@ | ||
@charset "utf-8"; | ||
|
||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
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,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> | ||
@vite([ | ||
'resources/js/review/review.ts', | ||
'resources/sass/review/review.scss', | ||
]) | ||
@inertiaHead | ||
</head> | ||
<body class="bg-gray-50 dark:bg-gray-900"> | ||
@inertia | ||
</body> | ||
</html> |
Oops, something went wrong.