Compare commits
5 Commits
af8bc8872d
...
tonitch/fi
Author | SHA1 | Date | |
---|---|---|---|
d21655c535
|
|||
490bf403f0 | |||
c61a092809 | |||
2cffe28720
|
|||
060526c20d
|
@ -2,7 +2,7 @@
|
|||||||
import { toast } from 'vue3-toastify';
|
import { toast } from 'vue3-toastify';
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import i18n, { setLang } from './i18n.js'
|
import i18n, { setLang } from './i18n.js'
|
||||||
import { isLogged } from '@/rest/Users.js'
|
import { isLogged, getSelf } from '@/rest/Users.js'
|
||||||
import { notifications, fetchNotifications, archiveNotification } from '@/rest/notifications.js'
|
import { notifications, fetchNotifications, archiveNotification } from '@/rest/notifications.js'
|
||||||
|
|
||||||
import { appList, currentView } from '@/rest/apps.js'
|
import { appList, currentView } from '@/rest/apps.js'
|
||||||
@ -14,9 +14,11 @@ window.onhashchange = function() {
|
|||||||
currentURL = window.location.hash;
|
currentURL = window.location.hash;
|
||||||
}
|
}
|
||||||
const Logged = ref(isLogged());
|
const Logged = ref(isLogged());
|
||||||
|
const user = ref();
|
||||||
|
|
||||||
if(Logged.value){
|
if(Logged.value){
|
||||||
fetchNotifications();
|
fetchNotifications();
|
||||||
|
getSelf().then(e => user.value = e);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('hashchange', () => {
|
window.addEventListener('hashchange', () => {
|
||||||
@ -49,7 +51,7 @@ window.addEventListener('hashchange', () => {
|
|||||||
</a></li>
|
</a></li>
|
||||||
<li style="float: right;" title=login>
|
<li style="float: right;" title=login>
|
||||||
<a class="icon" href="#/login">
|
<a class="icon" href="#/login">
|
||||||
<div class="fa-solid fa-user" :style="Logged ? 'color: red' : ''" style="margin-top: 7px; margin-bottom: 3px; "></div>
|
<div class="fa-solid fa-user" :style="Logged ? 'color: red' : ''" style="margin-top: 7px; margin-bottom: 3px; "></div>
|
||||||
</a></li>
|
</a></li>
|
||||||
<li style="float: right;" title=notifications @click="notification = !notification">
|
<li style="float: right;" title=notifications @click="notification = !notification">
|
||||||
<a class="icon">
|
<a class="icon">
|
||||||
@ -75,6 +77,7 @@ window.addEventListener('hashchange', () => {
|
|||||||
{{i18n("app.manage.profile")}}
|
{{i18n("app.manage.profile")}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<span v-if=Logged>RegNo - {{ user.regNo }}</span>
|
||||||
</div>
|
</div>
|
||||||
</a></li>
|
</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -133,10 +136,12 @@ window.addEventListener('hashchange', () => {
|
|||||||
|
|
||||||
|
|
||||||
.dropdown {
|
.dropdown {
|
||||||
|
color:black;
|
||||||
margin-top:55px;
|
margin-top:55px;
|
||||||
width:160px;
|
width:160px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height:110px;
|
/* height:110px; */
|
||||||
|
text-align: center;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
@ -32,6 +32,9 @@
|
|||||||
<div>
|
<div>
|
||||||
{{ i18n("firstname/name") }} : {{user.firstName}} {{user.lastName}}
|
{{ i18n("firstname/name") }} : {{user.firstName}} {{user.lastName}}
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ i18n("regNo") }} : {{user.regNo}}
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{{ i18n("login.guest.email") }}: {{user.email}}
|
{{ i18n("login.guest.email") }}: {{user.email}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -192,10 +192,10 @@
|
|||||||
<div>
|
<div>
|
||||||
{{ i18n("login.guest.email") }}: {{user.email}}
|
{{ i18n("login.guest.email") }}: {{user.email}}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="user.role==='Student'">
|
<div>
|
||||||
{{ i18n("regNo") }} : {{user.regNo}}
|
{{ i18n("regNo") }} : {{user.regNo}}
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div>
|
||||||
{{ i18n("role") }}: {{i18n((user.role))}}
|
{{ i18n("role") }}: {{i18n((user.role))}}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -138,7 +138,6 @@ const emit = defineEmits(["modified"]);
|
|||||||
#researches{
|
#researches{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: scroll;
|
|
||||||
}
|
}
|
||||||
#search{
|
#search{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -223,4 +222,4 @@ a{
|
|||||||
#toggledResearchButton:hover{
|
#toggledResearchButton:hover{
|
||||||
background: #ff2d55;
|
background: #ff2d55;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -82,7 +82,7 @@ function getPP(){
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div> <ListResearches :allResearcher="allResearcher" :research-list="researchList" :manage="true" @modified="modifiedResearch"></ListResearches> </div>
|
<ListResearches :allResearcher="allResearcher" :research-list="researchList" :manage="true" @modified="modifiedResearch"></ListResearches>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -181,4 +181,4 @@ a{
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -2,9 +2,14 @@ import { ref } from 'vue'
|
|||||||
import { restGet, restPost } from '@/rest/restConsumer.js'
|
import { restGet, restPost } from '@/rest/restConsumer.js'
|
||||||
|
|
||||||
export const notifications = ref([]);
|
export const notifications = ref([]);
|
||||||
|
let timerSet = false
|
||||||
|
|
||||||
export function fetchNotifications(){
|
export function fetchNotifications(){
|
||||||
restGet("/notifications").then( e => notifications.value = e );
|
restGet("/notifications").then( e => notifications.value = e );
|
||||||
|
if(!timerSet){
|
||||||
|
timerSet = true;
|
||||||
|
setTimeout(() => {timerSet = false; fetchNotifications()}, 5000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function archiveNotification(id){
|
export function archiveNotification(id){
|
||||||
|
Reference in New Issue
Block a user