Format App.vue
This commit is contained in:
parent
cfad59d139
commit
695df651e1
@ -93,7 +93,6 @@
|
|||||||
|
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
|
|
||||||
|
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
|
|
||||||
@ -104,7 +103,6 @@
|
|||||||
</v-menu>
|
</v-menu>
|
||||||
<v-card v-if="loggedIn == 'false'">
|
<v-card v-if="loggedIn == 'false'">
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
|
|
||||||
<v-row justify="center">
|
<v-row justify="center">
|
||||||
<v-dialog v-model="dialog" width="70%" persistent>
|
<v-dialog v-model="dialog" width="70%" persistent>
|
||||||
<template v-slot:activator="{ on }">
|
<template v-slot:activator="{ on }">
|
||||||
@ -158,10 +156,7 @@ export default {
|
|||||||
dialog: false,
|
dialog: false,
|
||||||
menu: false,
|
menu: false,
|
||||||
loggedIn: sessionStorage.getItem("loggedin"),
|
loggedIn: sessionStorage.getItem("loggedin"),
|
||||||
fullname:
|
fullname: sessionStorage.getItem("firstname") + " " + sessionStorage.getItem("lastname")
|
||||||
sessionStorage.getItem("firstname") +
|
|
||||||
" " +
|
|
||||||
sessionStorage.getItem("lastname")
|
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
forward() {
|
forward() {
|
||||||
@ -172,10 +167,7 @@ export default {
|
|||||||
|
|
||||||
xhttp.onreadystatechange = function () {
|
xhttp.onreadystatechange = function () {
|
||||||
if ((this.status == 200) & (this.readyState == 4)) {
|
if ((this.status == 200) & (this.readyState == 4)) {
|
||||||
sessionStorage.setItem(
|
sessionStorage.setItem("jwt", this.getResponseHeader("Authorization"));
|
||||||
"jwt",
|
|
||||||
this.getResponseHeader("Authorization")
|
|
||||||
);
|
|
||||||
sessionStorage.setItem("loggedin", true);
|
sessionStorage.setItem("loggedin", true);
|
||||||
} else if (this.status != 200 && this.status != 0) {
|
} else if (this.status != 200 && this.status != 0) {
|
||||||
document.getElementById("loginError").innerHTML =
|
document.getElementById("loginError").innerHTML =
|
||||||
@ -202,20 +194,14 @@ export default {
|
|||||||
sessionStorage.setItem("username", userInformation.username);
|
sessionStorage.setItem("username", userInformation.username);
|
||||||
sessionStorage.setItem("userIDOwn", userInformation.id);
|
sessionStorage.setItem("userIDOwn", userInformation.id);
|
||||||
|
|
||||||
this.fullname =
|
this.fullname = sessionStorage.getItem("firstname")
|
||||||
sessionStorage.getItem("firstname") +
|
+ " "
|
||||||
" " +
|
+ sessionStorage.getItem("lastname");
|
||||||
sessionStorage.getItem("lastname");
|
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
whoxhttp.open("GET", baseUri + "/whoami", false);
|
whoxhttp.open("GET", baseUri + "/whoami", false);
|
||||||
|
whoxhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
|
||||||
whoxhttp.setRequestHeader(
|
|
||||||
"Authorization",
|
|
||||||
sessionStorage.getItem("jwt")
|
|
||||||
);
|
|
||||||
|
|
||||||
whoxhttp.send(null);
|
whoxhttp.send(null);
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@ -227,8 +213,7 @@ export default {
|
|||||||
if ((this.status == 201) & (this.readyState == 4)) {
|
if ((this.status == 201) & (this.readyState == 4)) {
|
||||||
location.reload();
|
location.reload();
|
||||||
} else if (this.status != 201 && this.status != 0) {
|
} else if (this.status != 201 && this.status != 0) {
|
||||||
document.getElementById("loginError").innerHTML =
|
document.getElementById("loginError").innerHTML = "The username already exist";
|
||||||
"The username already exist";
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhttp.open("POST", baseUri + "/sign-up", true);
|
xhttp.open("POST", baseUri + "/sign-up", true);
|
||||||
@ -252,10 +237,7 @@ export default {
|
|||||||
location.reload();
|
location.reload();
|
||||||
},
|
},
|
||||||
toAccounts() {
|
toAccounts() {
|
||||||
sessionStorage.setItem(
|
sessionStorage.setItem("timeTrackAccountListUser", sessionStorage.getItem("username"));
|
||||||
"timeTrackAccountListUser",
|
|
||||||
sessionStorage.getItem("username")
|
|
||||||
);
|
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
xhttp.onreadystatechange = function () {
|
xhttp.onreadystatechange = function () {
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
@ -275,21 +257,16 @@ export default {
|
|||||||
);
|
);
|
||||||
|
|
||||||
xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
|
xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
|
||||||
|
|
||||||
xhttp.send(null);
|
xhttp.send(null);
|
||||||
this.users = JSON.parse(sessionStorage.getItem("users"));
|
this.users = JSON.parse(sessionStorage.getItem("users"));
|
||||||
|
|
||||||
if (this.$route.path == "/timetrackaccounts") {
|
if (this.$route.path == "/timetrackaccounts") {
|
||||||
|
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.$router.push("/timetrackaccounts");
|
this.$router.push("/timetrackaccounts");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.$vuetify.theme.dark = true;
|
this.$vuetify.theme.dark = true;
|
||||||
}
|
}
|
||||||
@ -302,6 +279,7 @@ export default {
|
|||||||
color: #f1f1f1f1;
|
color: #f1f1f1f1;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.v-application {
|
.v-application {
|
||||||
font-family: "Montserrat", sans-serif;
|
font-family: "Montserrat", sans-serif;
|
||||||
background-color: var(--v-background-base) !important;
|
background-color: var(--v-background-base) !important;
|
||||||
|
Loading…
Reference in New Issue
Block a user