Skip to content

Commit ee9a347

Browse files
committed
Add navigation to vue, improve responsiveness of the design
1 parent be5a910 commit ee9a347

File tree

9 files changed

+104
-67
lines changed

9 files changed

+104
-67
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<template>
2+
<div class="nav">
3+
<div class="logo">
4+
<router-link :to="{ name: 'dashboard' }">
5+
Pterodactyl
6+
</router-link>
7+
</div>
8+
<div class="menu">
9+
<ul>
10+
<li>
11+
<router-link :to="{ name: 'dashboard' }">
12+
<server-icon aria-label="Server dashboard"/>
13+
</router-link>
14+
</li>
15+
<li>
16+
<router-link :to="{ name: 'account' }">
17+
<user-icon aria-label="Profile management"/>
18+
</router-link>
19+
</li>
20+
<li>
21+
<a :href="this.route('admin.index')">
22+
<settings-icon aria-label="Administrative controls"/>
23+
</a>
24+
</li>
25+
<li>
26+
<a :href="this.route('auth.logout')">
27+
<log-out-icon aria-label="Sign out"/>
28+
</a>
29+
</li>
30+
</ul>
31+
</div>
32+
</div>
33+
</template>
34+
35+
<script>
36+
import { LogOutIcon, ServerIcon, SettingsIcon, UserIcon } from 'vue-feather-icons'
37+
38+
export default {
39+
name: 'navigation',
40+
components: { LogOutIcon, ServerIcon, SettingsIcon, UserIcon }
41+
};
42+
</script>

resources/assets/scripts/components/dashboard/Dashboard.vue

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
<template>
22
<div>
3-
<flash container="mt-4"/>
4-
<div class="server-search animate fadein">
5-
<input type="text"
6-
:placeholder="$t('dashboard.index.search')"
7-
@input="onChange"
8-
v-model="search"
9-
ref="search"
10-
/>
11-
</div>
12-
<div v-if="this.loading" class="my-4 animate fadein">
13-
<div class="text-center h-16">
14-
<span class="spinner spinner-xl"></span>
3+
<navigation/>
4+
<div class="container">
5+
<flash container="mt-4"/>
6+
<div class="server-search animate fadein">
7+
<input type="text"
8+
:placeholder="$t('dashboard.index.search')"
9+
@input="onChange"
10+
v-model="search"
11+
ref="search"
12+
/>
13+
</div>
14+
<div v-if="this.loading" class="my-4 animate fadein">
15+
<div class="text-center h-16">
16+
<span class="spinner spinner-xl"></span>
17+
</div>
1518
</div>
19+
<transition-group class="w-full m-auto mt-4 animate fadein sm:flex flex-wrap content-start" v-else>
20+
<server-box
21+
v-for="(server, index) in servers.models"
22+
v-bind:key="index"
23+
v-bind:server="server"
24+
/>
25+
</transition-group>
1626
</div>
17-
<transition-group class="w-full m-auto mt-4 animate fadein sm:flex flex-wrap content-start" v-else>
18-
<server-box
19-
v-for="(server, index) in servers.models"
20-
v-bind:key="index"
21-
v-bind:server="server"
22-
/>
23-
</transition-group>
2427
</div>
2528
</template>
2629

@@ -30,10 +33,11 @@
3033
import _ from 'lodash';
3134
import Flash from '../Flash';
3235
import ServerBox from './ServerBox';
36+
import Navigation from '../core/Navigation';
3337
3438
export default {
3539
name: 'dashboard',
36-
components: { ServerBox, Flash },
40+
components: { Navigation, ServerBox, Flash },
3741
data: function () {
3842
return {
3943
backgroundedAt: DateTime.local(),

resources/assets/scripts/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const routes = [
1717
}
1818
},
1919

20-
{ name : 'index', path: '/', component: Dashboard },
20+
{ name : 'dashboard', path: '/', component: Dashboard },
2121
{ name : 'account', path: '/account', component: Account },
2222
{ name : 'account.api', path: '/account/api', component: Account },
2323
{ name : 'account.security', path: '/account/security', component: Account },

resources/assets/styles/components/miscellaneous.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ code {
4949
@apply .pb-4;
5050

5151
@screen smx {
52-
@apply .w-1/2 .pr-4;
53-
54-
&:nth-of-type(2n) {
55-
padding-right: 0;
56-
}
52+
@apply .w-full;
5753
}
5854

5955
@screen md {

resources/assets/styles/components/navigation.css

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@
44

55
& > .logo {
66
@apply .mx-8 .font-sans .font-thin .text-2xl .text-white .inline-block .pt-2;
7+
8+
& a {
9+
color: inherit;
10+
text-decoration: none;
11+
}
12+
13+
@screen xsx {
14+
@apply .hidden
15+
}
716
}
817

918
& > .menu {
10-
@apply .float-right .mx-8 .inline-block;
11-
1219
& > ul {
1320
@apply .list-reset;
1421
& > li {
@@ -19,10 +26,21 @@
1926

2027
&:hover {
2128
@apply .bg-blue-dark;
29+
}
2230

31+
& .feather {
32+
@apply .h-4;
2333
}
2434
}
2535
}
2636
}
37+
38+
@screen xsx {
39+
@apply .w-full .text-center;
40+
}
41+
42+
@screen sm {
43+
@apply .float-right .mx-8 .inline-block;
44+
}
2745
}
2846
}

resources/assets/styles/main.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,11 @@
2525
* Assorted Other CSS
2626
*/
2727
body {
28-
@apply .font-sans;
28+
@apply .font-sans;
29+
}
30+
31+
.container {
32+
@screen xsx {
33+
@apply .px-2;
34+
}
2935
}

resources/themes/pterodactyl/templates/base/core.blade.php

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,8 @@
11
@extends('templates/wrapper')
22

3-
@section('above-container')
4-
<div class="nav">
5-
<div class="logo">
6-
Pterodactyl
7-
</div>
8-
<div class="menu">
9-
<ul>
10-
<li>
11-
<a href="#">
12-
<span>Your Servers</span>
13-
</a>
14-
</li>
15-
<li>
16-
<a href="#">
17-
<span>Admin</span>
18-
</a>
19-
</li>
20-
<li>
21-
<a href="#">
22-
<span>dane</span>
23-
</a>
24-
</li>
25-
<li>
26-
<a href="{{ route('auth.logout') }}">
27-
<span>Logout</span>
28-
</a>
29-
</li>
30-
</ul>
31-
</div>
32-
</div>
33-
@endsection
34-
353
@section('container')
364
<router-view></router-view>
37-
<div class="w-full m-auto mt-0">
5+
<div class="w-full m-auto mt-0 container">
386
<p class="text-right text-grey-dark text-xs">
397
{!! trans('strings.copyright', ['year' => date('Y')]) !!}
408
</p>

resources/themes/pterodactyl/templates/wrapper.blade.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
@include('layouts.scripts')
1717
</head>
1818
<body class="{{ $css['body'] ?? 'bg-grey-lighter' }}">
19-
@yield('above-container')
20-
<div class="container" id="pterodactyl">
21-
@yield('container')
22-
</div>
23-
@yield('below-container')
19+
@section('content')
20+
@yield('above-container')
21+
<div id="pterodactyl">
22+
@yield('container')
23+
</div>
24+
@yield('below-container')
25+
@show
2426
@section('scripts')
2527
{!! $asset->js('assets/scripts/bundle.js') !!}
2628
@show

tailwind.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ module.exports = {
172172
'lg': '992px',
173173
'xl': '1200px',
174174

175+
'xsx': {'max': '575px'},
175176
'smx': {'max': '767px'},
176177
'mdx': {'max': '991px'},
177178
'lgx': {'max': '1999px'},

0 commit comments

Comments
 (0)