mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-24 07:17:55 +01:00
feat(dashboard): ✨ Aggiunta dashboard base
This commit is contained in:
parent
09c0375415
commit
ca39e18b07
14
resources/js/Views/Dashboard.jsx
Normal file
14
resources/js/Views/Dashboard.jsx
Normal file
@ -0,0 +1,14 @@
|
||||
import Page from '../Components/Page.jsx';
|
||||
|
||||
export default class Dashboard extends Page {
|
||||
view(vnode) {
|
||||
return (
|
||||
<div>
|
||||
<h2>{__('Dashboard')}</h2>
|
||||
<p>
|
||||
This is the dashboard page.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import '@maicol07/mwc-card';
|
||||
import '@maicol07/mwc-layout-grid';
|
||||
import '@material/mwc-checkbox';
|
||||
import '@material/mwc-formfield';
|
||||
import '@maicol07/mwc-layout-grid';
|
||||
import '../WebComponents/TextField';
|
||||
|
||||
import type {Cash} from 'cash-dom';
|
||||
@ -78,8 +78,9 @@ export default class LoginPage extends Page {
|
||||
} catch (error) {
|
||||
showSnackbar(Object.values(error.data.errors).join(' '), false);
|
||||
this.loading.hide();
|
||||
return;
|
||||
}
|
||||
|
||||
// Inertia.visit(window.route('dashboard'));
|
||||
window.location.href = window.route('dashboard');
|
||||
}
|
||||
}
|
||||
|
2
resources/js/Views/index.js
vendored
2
resources/js/Views/index.js
vendored
@ -1,4 +1,6 @@
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
|
||||
export { default as AdminSetupPage } from './AdminSetupPage.jsx';
|
||||
export { default as Dashboard } from './Dashboard.jsx';
|
||||
export { default as LoginPage } from './LoginPage.jsx';
|
||||
export { default as SetupPage } from './SetupPage.jsx';
|
||||
|
@ -22,10 +22,20 @@ Route::get('/', static function () {
|
||||
return redirect()->route('setup');
|
||||
}
|
||||
|
||||
if (auth()->hasUser()) {
|
||||
return redirect()->route('dashboard');
|
||||
}
|
||||
|
||||
return redirect()->route('auth.login');
|
||||
});
|
||||
|
||||
Route::name('auth.')->group(static function () {
|
||||
Route::inertia('dashboard', 'Dashboard')
|
||||
->middleware('auth')
|
||||
->name('dashboard');
|
||||
|
||||
Route::name('auth.')
|
||||
->middleware('guest')
|
||||
->group(static function () {
|
||||
Route::inertia('login', 'LoginPage')
|
||||
->name('login');
|
||||
/*Route::inertia('password-request', '')
|
||||
@ -60,8 +70,6 @@ Route::name('setup.')->group(static function () {
|
||||
->name('admin.save');
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::get('lang/{language}', static function ($language) {
|
||||
app()->setLocale($language);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user