Amorçage du projet
This commit is contained in:
32
client/src/components/app-loader.riot
Normal file
32
client/src/components/app-loader.riot
Normal file
@ -0,0 +1,32 @@
|
||||
<ga-app>
|
||||
<!-- DOM -->
|
||||
<riot-router>
|
||||
<riot-route path="/">
|
||||
<ga-app />
|
||||
</riot-route>
|
||||
<riot-route path="/logout">
|
||||
<ga-logout />
|
||||
</riot-route>
|
||||
<riot-route path="(.*)">
|
||||
<ga-redirect path="/" />
|
||||
</riot-route>
|
||||
</riot-router>
|
||||
|
||||
<!-- Script -->
|
||||
<script>
|
||||
import { Router, Route, router } from '@riotjs/route';
|
||||
import Redirect from './redirect.riot';
|
||||
import Logout from './logout.riot';
|
||||
import Ticketing from './apps/ticketing/app.riot';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
RiotRoute: Route,
|
||||
RiotRouter: Router,
|
||||
GaRedirect: Redirect,
|
||||
GaLogout: Logout,
|
||||
GaApp: Ticketing,
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</ga-app>
|
23
client/src/components/apps/ticketing/app.riot
Normal file
23
client/src/components/apps/ticketing/app.riot
Normal file
@ -0,0 +1,23 @@
|
||||
<ga-ticketing>
|
||||
|
||||
<style>
|
||||
:host { display: block; }
|
||||
</style>
|
||||
|
||||
<div class="container">
|
||||
<ga-navbar></ga-navbar>
|
||||
<div class="columns"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
import Navbar from '../../navbar.riot';
|
||||
export default {
|
||||
|
||||
components: {
|
||||
GaNavbar: Navbar,
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
</script>
|
||||
</ga-ticketing>
|
12
client/src/components/logout.riot
Normal file
12
client/src/components/logout.riot
Normal file
@ -0,0 +1,12 @@
|
||||
<ga-logout>
|
||||
<style>
|
||||
:host { display: none; }
|
||||
</style>
|
||||
<script>
|
||||
export default {
|
||||
onMounted() {
|
||||
window.location = "/logout";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</ga-logout>
|
20
client/src/components/navbar.riot
Normal file
20
client/src/components/navbar.riot
Normal file
@ -0,0 +1,20 @@
|
||||
<ga-navbar>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<div class="level">
|
||||
<div class="level-left"></div>
|
||||
<div class="level-right">
|
||||
<a class="button is-warning level-item" href="/logout">
|
||||
Se déconnecter
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
</ga-navbar>
|
14
client/src/components/redirect.riot
Normal file
14
client/src/components/redirect.riot
Normal file
@ -0,0 +1,14 @@
|
||||
<ga-redirect>
|
||||
<style>
|
||||
:host { display: none; }
|
||||
</style>
|
||||
<script>
|
||||
import { router } from '@riotjs/route';
|
||||
export default {
|
||||
onMounted() {
|
||||
console.log(`redirect to ${this.props.path}`);
|
||||
router.push(this.props.path);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</ga-redirect>
|
Reference in New Issue
Block a user