2024-02-17 20:48:14 +01:00
|
|
|
<script setup>
|
2024-03-08 23:35:11 +01:00
|
|
|
import { toast } from 'vue3-toastify';
|
2024-03-16 16:57:52 +01:00
|
|
|
import { ref } from 'vue'
|
2024-03-08 22:00:15 +01:00
|
|
|
import i18n, { setLang } from './i18n.js'
|
2024-03-16 13:56:29 +01:00
|
|
|
import { isLogged } from '@/rest/Users.js'
|
2024-04-17 21:41:29 +02:00
|
|
|
import { notifications, fetchNotifications, archiveNotification } from '@/rest/notifications.js'
|
2024-03-16 14:31:44 +01:00
|
|
|
|
2024-03-16 16:57:52 +01:00
|
|
|
import { appList, currentView } from '@/rest/apps.js'
|
2024-03-17 13:24:24 +01:00
|
|
|
var prevURL;
|
|
|
|
var currentURL = window.location.hash;
|
|
|
|
|
|
|
|
window.onhashchange = function() {
|
|
|
|
prevURL = currentURL;
|
|
|
|
currentURL = window.location.hash;
|
|
|
|
}
|
2024-03-18 17:28:14 +01:00
|
|
|
const Logged = ref(isLogged());
|
|
|
|
|
2024-04-21 17:42:29 +02:00
|
|
|
if(Logged.value){
|
2024-04-17 21:41:29 +02:00
|
|
|
fetchNotifications();
|
|
|
|
}
|
|
|
|
|
2024-03-17 13:24:24 +01:00
|
|
|
window.addEventListener('hashchange', () => {
|
2024-03-18 17:34:35 +01:00
|
|
|
if((location.hash === "#/home" && prevURL === "#/login") || (location.hash === "#/home" && prevURL === "#/profil")){
|
2024-03-17 13:24:24 +01:00
|
|
|
window.location.reload();
|
|
|
|
}
|
2024-03-18 17:34:35 +01:00
|
|
|
});
|
2024-03-08 20:22:00 +01:00
|
|
|
const home=ref(i18n("app.home"))
|
|
|
|
const settings=ref(i18n("app.settings"))
|
|
|
|
const login=ref(i18n("app.login"))
|
2024-03-09 11:07:13 +01:00
|
|
|
const active=ref(false)
|
2024-04-17 21:41:29 +02:00
|
|
|
const notification = ref(false)
|
2024-03-16 13:56:29 +01:00
|
|
|
|
2024-03-16 16:57:52 +01:00
|
|
|
const apps = ref([])
|
|
|
|
appList().then(e => apps.value = e)
|
|
|
|
|
2024-02-17 20:48:14 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2024-03-02 14:46:59 +01:00
|
|
|
<div class="container">
|
|
|
|
<div class="topBar">
|
2024-03-01 15:21:10 +01:00
|
|
|
<ul class="horizontal">
|
2024-03-08 20:22:00 +01:00
|
|
|
<li title=home>
|
2024-03-09 22:48:33 +01:00
|
|
|
<a class="icon" href="#home">
|
2024-03-15 20:23:33 +01:00
|
|
|
<img class="clyde" src="/Clyde.png" style="width: 40px; height: auto; margin-top:4px">
|
2024-03-02 14:46:59 +01:00
|
|
|
</a></li>
|
2024-03-08 20:22:00 +01:00
|
|
|
<li title=home>
|
2024-03-09 22:48:33 +01:00
|
|
|
<a class="icon" href="#home">
|
2024-03-16 13:56:29 +01:00
|
|
|
<div class=" fa-solid fa-house" style="margin-top: 7px; margin-bottom: 3px;"></div>
|
2024-03-02 14:46:59 +01:00
|
|
|
</a></li>
|
2024-03-08 20:22:00 +01:00
|
|
|
<li style="float: right;" title=login>
|
2024-03-09 22:48:33 +01:00
|
|
|
<a class="icon" href="#/login">
|
2024-04-19 20:22:31 +02:00
|
|
|
<div class="fa-solid fa-user" :style="Logged ? 'color: red' : ''" style="margin-top: 7px; margin-bottom: 3px; "></div>
|
2024-02-27 00:51:30 +01:00
|
|
|
</a></li>
|
2024-04-19 20:22:31 +02:00
|
|
|
<li style="float: right;" title=notifications @click="notification = !notification">
|
|
|
|
<a class="icon">
|
2024-04-17 21:41:29 +02:00
|
|
|
<div class="fa-solid fa-bell" :style="notifications.length != 0 ? 'color:orange': '' " style="margin-top: 7px; margin-bottom: 3px;"></div>
|
|
|
|
<ul v-if=notification id="notification">
|
2024-04-19 20:22:31 +02:00
|
|
|
<li v-for="notif in notifications" @click="archiveNotification(notif.id)"> {{ i18n(notif.subject) }} - {{ notif.body }}</li>
|
2024-04-17 21:41:29 +02:00
|
|
|
</ul>
|
2024-02-27 00:51:30 +01:00
|
|
|
</a></li>
|
2024-03-22 20:14:20 +01:00
|
|
|
<li @click="active=!active" class="option"style="float: right;" title=settings>
|
2024-04-19 20:22:31 +02:00
|
|
|
<a class="icon">
|
2024-03-02 14:46:59 +01:00
|
|
|
<div class="fa-solid fa-gear" style="margin-top: 7px; margin-bottom: 3px;"></div>
|
2024-03-11 21:45:51 +01:00
|
|
|
<div v-if="active" class="dropdown">
|
2024-03-14 21:27:03 +01:00
|
|
|
<div class="dropdown-content">{{i18n("app.language")}}</div>
|
2024-03-09 22:48:33 +01:00
|
|
|
<ul style="list-style-type:none;">
|
|
|
|
<li style=" margin-bottom:10px;margin-right:20px;float:left; font-size:10px; color:black;">
|
2024-03-11 12:02:27 +01:00
|
|
|
<button @:click="setLang('en');" href="#home">EN</button>
|
2024-03-09 22:48:33 +01:00
|
|
|
|
|
|
|
</li>
|
2024-03-11 12:02:27 +01:00
|
|
|
<li style="float:left;font-size:10px; color:black;"><button @:click="setLang('fr');" href="#home">FR</button></li>
|
2024-03-09 11:07:13 +01:00
|
|
|
</ul>
|
2024-03-09 22:48:33 +01:00
|
|
|
<div style='align-items:center;'>
|
|
|
|
<a style="cursor:pointer;font-size:20px;" href="#/profil" class="dropdown-content">
|
2024-03-14 21:27:03 +01:00
|
|
|
{{i18n("app.manage.profile")}}
|
2024-03-09 22:48:33 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
2024-03-09 11:07:13 +01:00
|
|
|
</div>
|
2024-03-07 15:42:36 +01:00
|
|
|
</a></li>
|
2024-03-01 15:21:10 +01:00
|
|
|
</ul>
|
2024-03-02 14:46:59 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="leftBar">
|
2024-03-01 15:21:10 +01:00
|
|
|
<ul class="vertical">
|
2024-03-16 16:57:52 +01:00
|
|
|
<li v-for="app in apps">
|
2024-03-17 13:24:24 +01:00
|
|
|
<a :href="app.path">
|
2024-03-16 16:57:52 +01:00
|
|
|
<div class="fa-solid" :class="app.icon" style="font-size: 40px;"></div>
|
|
|
|
<div class="text">{{app.text}}</div>
|
|
|
|
</a>
|
|
|
|
</li>
|
2024-02-27 00:51:30 +01:00
|
|
|
</ul>
|
2024-03-02 14:46:59 +01:00
|
|
|
</div>
|
|
|
|
<div class="page">
|
2024-03-16 15:06:21 +01:00
|
|
|
<Suspense>
|
2024-03-22 13:54:30 +01:00
|
|
|
<component :is="currentView" />
|
2024-03-16 15:06:21 +01:00
|
|
|
</Suspense>
|
2024-03-02 14:46:59 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-02-17 20:48:14 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped>
|
2024-03-01 15:21:10 +01:00
|
|
|
|
2024-03-02 14:46:59 +01:00
|
|
|
.container{
|
2024-03-22 13:54:30 +01:00
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
2024-03-02 14:46:59 +01:00
|
|
|
display:grid;
|
2024-04-17 21:43:49 +02:00
|
|
|
|
|
|
|
grid-template-columns:[firstCol-start]70px[firstCol-end secondCol-start] auto [endCol];
|
|
|
|
grid-template-rows:[firstRow-start] var(--header-size) [firstRow-end secondRow-start] calc(100% - var(--header-size)) [endRow];
|
2024-03-02 14:46:59 +01:00
|
|
|
grid-template-areas:
|
|
|
|
"topBar topBar"
|
|
|
|
"leftBar page";
|
2024-04-17 21:43:49 +02:00
|
|
|
|
2024-03-01 15:21:10 +01:00
|
|
|
}
|
|
|
|
|
2024-03-02 14:46:59 +01:00
|
|
|
.page {
|
|
|
|
grid-area:page;
|
2024-03-22 13:54:30 +01:00
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
2024-03-01 15:21:10 +01:00
|
|
|
}
|
2024-03-02 14:46:59 +01:00
|
|
|
|
|
|
|
.topBar{
|
|
|
|
grid-area:topBar;
|
|
|
|
}
|
|
|
|
|
|
|
|
.leftBar{
|
|
|
|
grid-area:leftBar;
|
|
|
|
}
|
2024-03-09 11:07:13 +01:00
|
|
|
.option {
|
|
|
|
position: relative;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dropdown {
|
|
|
|
margin-top:55px;
|
2024-03-09 22:48:33 +01:00
|
|
|
width:160px;
|
|
|
|
display: inline-block;
|
|
|
|
height:110px;
|
2024-03-09 11:07:13 +01:00
|
|
|
font-size: 13px;
|
|
|
|
position: absolute;
|
|
|
|
z-index: 1;
|
|
|
|
background-color:white;
|
|
|
|
}
|
|
|
|
|
2024-03-09 22:48:33 +01:00
|
|
|
.dropdown-content {
|
|
|
|
min-width: 160px;
|
|
|
|
text-align: center;
|
|
|
|
margin-bottom: 10px;
|
|
|
|
right:0;
|
|
|
|
color:rgb(50,50,50);
|
2024-03-09 11:07:13 +01:00
|
|
|
text-decoration: none;
|
2024-03-09 22:48:33 +01:00
|
|
|
font-size:24px
|
2024-03-09 11:07:13 +01:00
|
|
|
}
|
2024-03-02 14:46:59 +01:00
|
|
|
|
2024-03-09 22:48:33 +01:00
|
|
|
.dropdown-content div{
|
|
|
|
display:block;
|
|
|
|
}
|
|
|
|
|
2024-02-27 00:51:30 +01:00
|
|
|
ul.vertical{
|
|
|
|
list-style-type: none;
|
2024-04-17 21:43:49 +02:00
|
|
|
margin-top: var(--header-size);
|
2024-03-01 15:21:10 +01:00
|
|
|
top:0;
|
|
|
|
left:0;
|
2024-04-22 00:09:39 +02:00
|
|
|
padding: 25px 0 25px 0;
|
2024-02-27 00:51:30 +01:00
|
|
|
width: 70px ;
|
|
|
|
background-color: rgb(53, 53, 53);
|
|
|
|
border-right:5px;
|
|
|
|
border-color:black;
|
2024-04-22 00:09:39 +02:00
|
|
|
height: calc( 100% - var(--header-size) );
|
2024-02-27 00:51:30 +01:00
|
|
|
position: fixed;
|
2024-04-19 12:35:07 +02:00
|
|
|
overflow: scroll;
|
2024-02-27 00:51:30 +01:00
|
|
|
transition-duration: .3s;
|
|
|
|
}
|
|
|
|
|
2024-03-07 15:42:36 +01:00
|
|
|
li a{
|
2024-02-27 00:51:30 +01:00
|
|
|
display: flex;
|
|
|
|
padding: 8px 16px;
|
|
|
|
color:rgb(255, 255, 255);
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
ul.vertical li a:hover:not(.active) {
|
|
|
|
background-color: rgb(112, 112, 112);
|
|
|
|
border-radius:6px;
|
|
|
|
color: white;
|
|
|
|
transform: translate(0px ,1px);
|
|
|
|
}
|
|
|
|
|
|
|
|
ul.vertical li a.active {
|
|
|
|
background-color: rgb(239, 60, 168);
|
|
|
|
border-radius:6px;
|
|
|
|
}
|
|
|
|
|
|
|
|
ul.horizontal li a.active {
|
|
|
|
background-color: rgb(57, 57, 57);
|
|
|
|
border-radius:6px;
|
|
|
|
}
|
|
|
|
ul.horizontal {
|
|
|
|
z-index: 101;
|
2024-03-01 15:21:10 +01:00
|
|
|
box-shadow: 0px 3px 3px rgb(0, 0, 0);
|
2024-02-27 00:51:30 +01:00
|
|
|
display: block ;
|
|
|
|
list-style-type:none;
|
|
|
|
margin:0;
|
|
|
|
padding: 0;
|
|
|
|
top: 0;
|
2024-03-01 15:21:10 +01:00
|
|
|
left:0;
|
|
|
|
|
2024-02-27 00:51:30 +01:00
|
|
|
position: fixed;
|
2024-04-17 21:43:49 +02:00
|
|
|
height:var(--header-size);
|
2024-02-27 00:51:30 +01:00
|
|
|
width: 100%;
|
|
|
|
background-color: rgb(24, 24, 24);
|
|
|
|
}
|
|
|
|
|
|
|
|
ul.horizontal li {
|
|
|
|
font-size: 35px;
|
|
|
|
float: left;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-03-09 22:48:33 +01:00
|
|
|
ul.horizontal li a.icon:hover:not(.active){
|
2024-02-27 00:51:30 +01:00
|
|
|
background-color: black;
|
|
|
|
border-radius:6px;
|
|
|
|
color:white;
|
|
|
|
}
|
|
|
|
|
|
|
|
ul.vertical:hover {
|
|
|
|
z-index: 100;
|
|
|
|
width: 250px;
|
2024-03-01 15:21:10 +01:00
|
|
|
border-top-right-radius: 40px;
|
|
|
|
box-shadow: 3px 0px 3px rgb(0, 0, 0);
|
2024-02-27 00:51:30 +01:00
|
|
|
transition-duration: .3s;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.text {
|
|
|
|
right: 0%;
|
|
|
|
width: 0%;
|
2024-04-20 19:30:01 +02:00
|
|
|
visibility: collapse;
|
2024-02-27 00:51:30 +01:00
|
|
|
opacity: 0;
|
|
|
|
color: white;
|
|
|
|
font-size: 1.2em;
|
|
|
|
font-weight: 600;
|
|
|
|
transition-duration: .3s;
|
|
|
|
}
|
|
|
|
|
|
|
|
ul.vertical:hover .text {
|
2024-04-20 19:30:01 +02:00
|
|
|
opacity:1;
|
|
|
|
visibility:visible;
|
2024-03-12 11:10:14 +01:00
|
|
|
width: 60%;
|
2024-02-27 00:51:30 +01:00
|
|
|
transition-duration: .3s;
|
2024-03-12 11:10:14 +01:00
|
|
|
padding-left: 15px;
|
2024-02-27 00:51:30 +01:00
|
|
|
}
|
2024-03-13 23:28:25 +01:00
|
|
|
|
|
|
|
.clyde:hover{
|
|
|
|
content: url("./assets/angry_clyde.png")
|
|
|
|
}
|
2024-04-17 21:41:29 +02:00
|
|
|
|
|
|
|
#notification{
|
|
|
|
position: absolute;
|
|
|
|
top: 61px;
|
|
|
|
right: 0;
|
|
|
|
background-color: white;
|
|
|
|
width: 300px;
|
|
|
|
height: 600px;
|
2024-04-19 20:22:31 +02:00
|
|
|
border-radius: 10px;
|
|
|
|
margin: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#notification > li{
|
|
|
|
color: black;
|
|
|
|
list-style: none;
|
|
|
|
font-size: 0.4em;
|
|
|
|
display: block;
|
|
|
|
background-color: #00FF00A0;
|
|
|
|
margin: 1px;
|
|
|
|
border-radius: 42px;
|
|
|
|
padding: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
#notification > li:hover{
|
|
|
|
background-color: #00FF0000
|
2024-04-17 21:41:29 +02:00
|
|
|
}
|
2024-03-09 22:48:33 +01:00
|
|
|
|
2024-02-17 20:48:14 +01:00
|
|
|
</style>
|
2024-03-16 16:57:52 +01:00
|
|
|
|
|
|
|
<!-- vim:set noet sts=0 sw=4 ts=2: -->
|