{{ server.node_name }}
+{{ server.allocation.ip }}:{{ server.allocation.port }}
+diff --git a/app/Http/Controllers/Base/DashboardController.php b/app/Http/Controllers/Base/DashboardController.php
new file mode 100644
index 000000000..8351b037a
--- /dev/null
+++ b/app/Http/Controllers/Base/DashboardController.php
@@ -0,0 +1,54 @@
+repository = $repository;
+ }
+
+ public function servers(Request $request)
+ {
+ $servers = $this->repository->setSearchTerm($request->input('query'))->filterUserAccessServers(
+ $request->user(), User::FILTER_LEVEL_ALL
+ );
+
+ $data = [];
+ foreach ($servers->items() as $server) {
+ $cleaned = collect($server)->only([
+ 'uuidShort',
+ 'uuid',
+ 'name',
+ 'cpu',
+ 'memory',
+ ]);
+
+ $data[] = array_merge($cleaned->toArray(), [
+ 'allocation' => [
+ 'ip' => $server->allocation->ip,
+ 'port' => $server->allocation->port,
+ ],
+ 'node_name' => $server->node->name,
+ ]);
+ }
+
+ return response()->json($data);
+ }
+}
diff --git a/resources/assets/scripts/app.js b/resources/assets/scripts/app.js
index 2581626f5..15fb4af18 100644
--- a/resources/assets/scripts/app.js
+++ b/resources/assets/scripts/app.js
@@ -10,7 +10,8 @@ import { flash } from './mixins/flash';
// Base Vuejs Templates
import Login from './components/auth/Login';
-import Base from './components/base/Base';
+import Dashboard from './components/dashboard/Dashboard';
+import Account from './components/dashboard/Account';
import ResetPassword from './components/auth/ResetPassword';
window.events = new Vue;
@@ -45,10 +46,10 @@ const router = new VueRouter({
return { token: route.params.token, email: route.query.email || '' };
}
},
- { name : 'index', path: '/', component: Base },
- { name : 'account', path: '/account', component: Base },
- { name : 'account-api', path: '/account/api', component: Base },
- { name : 'account-security', path: '/account/security', component: Base },
+ { name : 'index', path: '/', component: Dashboard },
+ { name : 'account', path: '/account', component: Account },
+ { name : 'account-api', path: '/account/api', component: Account },
+ { name : 'account-security', path: '/account/security', component: Account },
]
});
diff --git a/resources/assets/scripts/components/base/Base.vue b/resources/assets/scripts/components/base/Base.vue
deleted file mode 100644
index e69de29bb..000000000
diff --git a/resources/assets/scripts/components/dashboard/Account.vue b/resources/assets/scripts/components/dashboard/Account.vue
new file mode 100644
index 000000000..281ce77b9
--- /dev/null
+++ b/resources/assets/scripts/components/dashboard/Account.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/resources/assets/scripts/components/dashboard/Dashboard.vue b/resources/assets/scripts/components/dashboard/Dashboard.vue
new file mode 100644
index 000000000..1da8cf667
--- /dev/null
+++ b/resources/assets/scripts/components/dashboard/Dashboard.vue
@@ -0,0 +1,94 @@
+
+ {{ server.node_name }} {{ server.allocation.ip }}:{{ server.allocation.port }}
{{ $server->node->name }}
-{{ $server->allocation->ip }}:{{ $server->allocation->port }}
-{!! trans('strings.copyright', ['year' => date('Y')]) !!} diff --git a/routes/base.php b/routes/base.php index 88058345f..3c2a67829 100644 --- a/routes/base.php +++ b/routes/base.php @@ -7,6 +7,7 @@ * https://opensource.org/licenses/MIT */ Route::get('/', 'IndexController@index')->name('index'); +Route::get('/dashboard/servers', 'DashboardController@servers')->name('dashboard.servers'); Route::get('/status/{server}', 'IndexController@status')->name('index.status'); /*