Rename baseUri to BASE_URI, some smaller adjustments

This commit is contained in:
Marcel Schwarz 2020-07-22 00:36:29 +02:00
parent 417ab3da50
commit 1f8e8069cb
19 changed files with 62 additions and 68 deletions

View File

@ -138,7 +138,7 @@
<script> <script>
import SignIn from "./views/SignIn.vue"; import SignIn from "./views/SignIn.vue";
import {baseUri} from "./variables.js"; import {BASE_URI} from "./globals.js";
if (!sessionStorage.getItem("loggedin")) { if (!sessionStorage.getItem("loggedin")) {
sessionStorage.setItem("loggedin", false); sessionStorage.setItem("loggedin", false);
@ -175,7 +175,7 @@
} }
}; };
xhttp.open("POST", baseUri + "/login", false); xhttp.open("POST", BASE_URI + "/login", false);
xhttp.send( xhttp.send(
'{"username": "' + '{"username": "' +
loginData.username + loginData.username +
@ -200,7 +200,7 @@
location.reload(); location.reload();
} }
}; };
whoxhttp.open("GET", baseUri + "/whoami", false); whoxhttp.open("GET", BASE_URI + "/whoami", false);
whoxhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt")); whoxhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
whoxhttp.send(null); whoxhttp.send(null);
location.reload(); location.reload();
@ -216,7 +216,7 @@
document.getElementById("loginError").innerHTML = "The username already exist"; document.getElementById("loginError").innerHTML = "The username already exist";
} }
}; };
xhttp.open("POST", baseUri + "/sign-up", true); xhttp.open("POST", BASE_URI + "/sign-up", true);
xhttp.setRequestHeader("Content-Type", "application/json"); xhttp.setRequestHeader("Content-Type", "application/json");
xhttp.send( xhttp.send(
"{" + "{" +
@ -250,7 +250,7 @@
}; };
xhttp.open( xhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/users/search/byUsername?username=" + "/users/search/byUsername?username=" +
sessionStorage.getItem("username"), sessionStorage.getItem("username"),
false false

1
frontend/src/globals.js Normal file
View File

@ -0,0 +1 @@
export const BASE_URI = 'http://plesk.icaotix.de:5000'

View File

@ -1 +0,0 @@
export const baseUri = 'http://plesk.icaotix.de:5000'

View File

@ -29,7 +29,7 @@
}; };
</script> </script>
<style> <style scoped>
p { p {
font-size: 20pt; font-size: 20pt;
} }

View File

@ -37,7 +37,7 @@
</v-container> </v-container>
</template> </template>
<script> <script>
import {baseUri} from "../variables"; import {BASE_URI} from "../globals";
export default { export default {
name: "CreateTimeTrackAccount", name: "CreateTimeTrackAccount",
@ -58,7 +58,7 @@
suc = true; suc = true;
} }
}; };
xhttp.open("POST", baseUri + "/accounts", false); xhttp.open("POST", BASE_URI + "/accounts", false);
xhttp.setRequestHeader("Content-Type", "application/json"); xhttp.setRequestHeader("Content-Type", "application/json");
xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt")); xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));

View File

@ -142,7 +142,7 @@
</v-container> </v-container>
</template> </template>
<script> <script>
import {baseUri} from "../variables"; import {BASE_URI} from "../globals";
export default { export default {
name: "CreateTimeTrackAccount", name: "CreateTimeTrackAccount",
@ -175,7 +175,7 @@
}; };
accountxhttp.open( accountxhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/accounts/search/findByUsernameAndName?username=" + "/accounts/search/findByUsernameAndName?username=" +
sessionStorage.getItem("username") + sessionStorage.getItem("username") +
"&account=" + "&account=" +
@ -196,7 +196,7 @@
suc = true; suc = true;
} }
}; };
xhttp.open("POST", baseUri + "/records", false); xhttp.open("POST", BASE_URI + "/records", false);
xhttp.setRequestHeader("Content-Type", "application/json"); xhttp.setRequestHeader("Content-Type", "application/json");
xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt")); xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
xhttp.send( xhttp.send(
@ -228,7 +228,7 @@
}; };
accountsxhttp.open( accountsxhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/accounts/search/findByUsername?username=" + "/accounts/search/findByUsername?username=" +
sessionStorage.getItem("username"), sessionStorage.getItem("username"),
false false

View File

@ -71,7 +71,7 @@
</v-container> </v-container>
</template> </template>
<script> <script>
import {baseUri} from "../variables"; import {BASE_URI} from "../globals";
export default { export default {
name: "Edituser", name: "Edituser",
@ -156,7 +156,7 @@
document.getElementById("locationnotcomplete").innerHTML = "Only numeric values are allowed"; document.getElementById("locationnotcomplete").innerHTML = "Only numeric values are allowed";
} }
}; };
xhttp.open("POST", baseUri + "/locations", false); xhttp.open("POST", BASE_URI + "/locations", false);
xhttp.setRequestHeader("Content-Type", "application/json"); xhttp.setRequestHeader("Content-Type", "application/json");
xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt")); xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));

View File

@ -66,7 +66,7 @@
</template> </template>
<script> <script>
import {baseUri} from "../variables.js"; import {BASE_URI} from "../globals.js";
export default { export default {
name: "Home", name: "Home",
@ -92,7 +92,7 @@
today = today._embedded.records; today = today._embedded.records;
} }
}; };
xhttp.open("GET", baseUri + "/records/search/today", false); xhttp.open("GET", BASE_URI + "/records/search/today", false);
xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt")); xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
xhttp.send(null); xhttp.send(null);
@ -123,7 +123,7 @@
}; };
accountxhttp.open( accountxhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/accounts/search/findByUsername?username=" + "/accounts/search/findByUsername?username=" +
sessionStorage.getItem("username"), sessionStorage.getItem("username"),
false false
@ -145,7 +145,7 @@
}; };
locationxhttp.open( locationxhttp.open(
"GET", "GET",
baseUri + "/users/" + sessionStorage.getItem("userIDOwn") + "/location", BASE_URI + "/users/" + sessionStorage.getItem("userIDOwn") + "/location",
false false
); );

View File

@ -44,14 +44,7 @@
</div> </div>
<div class="text-center mt-10"> <div class="text-center mt-10">
<v-btn <v-btn class="primary--text" rounded outlined dark @click="step++">Create Account</v-btn>
class="primary--text"
rounded
outlined
dark
@click="step++"
>Create Account
</v-btn>
</div> </div>
</v-card-text> </v-card-text>
</v-col> </v-col>

View File

@ -1,21 +1,27 @@
<template> <template>
<v-row class="ma-5"> <div>
<v-col cols="4"> <v-row class="ma-5">
<WorkPausePie/> <v-col cols="4">
</v-col> <WorkPausePie/>
<v-col cols="4"> </v-col>
<account-pie/> <v-col cols="4">
</v-col> <account-pie/>
<v-col cols="4"> </v-col>
<revenue-pie/> <v-col cols="4">
</v-col> <revenue-pie/>
<v-col cols="12"> </v-col>
<MonthSummary/> </v-row>
</v-col> <v-row class="ma-5">
<v-col cols="12"> <v-col cols="12">
<WeekSummary/> <MonthSummary/>
</v-col> </v-col>
</v-row> </v-row>
<v-row class="ma-5">
<v-col cols="12">
<WeekSummary/>
</v-col>
</v-row>
</div>
</template> </template>
<script> <script>

View File

@ -39,12 +39,7 @@
</v-row> </v-row>
</v-list-item-content> </v-list-item-content>
<v-list-item-action> <v-list-item-action>
<v-speed-dial <v-speed-dial v-model="fab" transition="slide-x-reverse-transition" direction="left" open-on-hover>
v-model="fab"
transition="slide-x-reverse-transition"
direction="left"
open-on-hover
>
<template v-slot:activator> <template v-slot:activator>
<v-btn v-model="fab" color="background" elevation="0" dark fab> <v-btn v-model="fab" color="background" elevation="0" dark fab>
<v-icon v-if="fab">mdi-close</v-icon> <v-icon v-if="fab">mdi-close</v-icon>

View File

@ -35,7 +35,7 @@
<script> <script>
import TimeRecordItem from "./TimeRecordItem.vue"; import TimeRecordItem from "./TimeRecordItem.vue";
import {baseUri} from "../variables.js"; import {BASE_URI} from "../globals.js";
export default { export default {
name: "TimeRecords", name: "TimeRecords",
@ -111,7 +111,7 @@
}; };
xhttp.open( xhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/records/search/allForUser?username=" + "/records/search/allForUser?username=" +
sessionStorage.getItem("username") + sessionStorage.getItem("username") +
"&sort=startdate,desc&page=" + "&sort=startdate,desc&page=" +

View File

@ -20,7 +20,7 @@
</template> </template>
<script> <script>
import {baseUri} from "../variables.js"; import {BASE_URI} from "../globals.js";
import TimeTrackAccountItem from "./TimeTrackAccountItem.vue"; import TimeTrackAccountItem from "./TimeTrackAccountItem.vue";
export default { export default {
@ -67,7 +67,7 @@
}; };
accountxhttp.open( accountxhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/accounts/search/findByUsername?username=" + "/accounts/search/findByUsername?username=" +
sessionStorage.getItem("timeTrackAccountListUser"), sessionStorage.getItem("timeTrackAccountListUser"),
false false

View File

@ -22,7 +22,7 @@
</template> </template>
<script> <script>
import {baseUri} from "../variables.js"; import {BASE_URI} from "../globals.js";
import UsersItems from "./UsersItems.vue"; import UsersItems from "./UsersItems.vue";
export default { export default {
@ -82,7 +82,7 @@
userLinks = usersInformation._links; userLinks = usersInformation._links;
} }
}; };
xhttp.open("GET", baseUri + "/users?page=" + this.page, false); xhttp.open("GET", BASE_URI + "/users?page=" + this.page, false);
xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt")); xhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));

View File

@ -12,7 +12,7 @@
<script> <script>
import VueApexCharts from "vue-apexcharts"; import VueApexCharts from "vue-apexcharts";
import {baseUri} from "../../variables.js"; import {BASE_URI} from "../../globals.js";
import {timeFormatter} from "./ApexFormatters"; import {timeFormatter} from "./ApexFormatters";
export default { export default {
@ -97,7 +97,7 @@
}; };
accountxhttp.open( accountxhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/accounts/search/findByUsername?username=" + "/accounts/search/findByUsername?username=" +
sessionStorage.getItem("username"), sessionStorage.getItem("username"),
false false
@ -144,7 +144,7 @@
}; };
xhttp.open( xhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/records/search/allForUser?username=" + "/records/search/allForUser?username=" +
sessionStorage.getItem("username") + sessionStorage.getItem("username") +
"&projection=overview" + "&projection=overview" +

View File

@ -13,7 +13,7 @@
<script> <script>
import VueApexCharts from "vue-apexcharts"; import VueApexCharts from "vue-apexcharts";
import {baseUri} from "../../variables.js"; import {BASE_URI} from "../../globals.js";
import {timeFormatter} from "./ApexFormatters"; import {timeFormatter} from "./ApexFormatters";
export default { export default {
@ -147,7 +147,7 @@
xhttp.open( xhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/records/search/allBetweenAndUser?start=" + "/records/search/allBetweenAndUser?start=" +
this.chartOptions.xaxis.categories[daysToDisplay - 1] + this.chartOptions.xaxis.categories[daysToDisplay - 1] +
"T00:00:01" + "T00:00:01" +

View File

@ -12,7 +12,7 @@
<script> <script>
import VueApexCharts from "vue-apexcharts"; import VueApexCharts from "vue-apexcharts";
import {baseUri} from "../../variables.js"; import {BASE_URI} from "../../globals.js";
export default { export default {
components: { components: {
@ -89,7 +89,7 @@
}; };
accountxhttp.open( accountxhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/accounts/search/findByUsername?username=" + "/accounts/search/findByUsername?username=" +
sessionStorage.getItem("username"), sessionStorage.getItem("username"),
false false
@ -136,7 +136,7 @@
}; };
xhttp.open( xhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/records/search/allForUser?username=" + "/records/search/allForUser?username=" +
sessionStorage.getItem("username") + sessionStorage.getItem("username") +
"&projection=overview" + "&projection=overview" +

View File

@ -13,7 +13,7 @@
<script> <script>
import VueApexCharts from "vue-apexcharts"; import VueApexCharts from "vue-apexcharts";
import {baseUri} from "../../variables.js"; import {BASE_URI} from "../../globals.js";
import {timeFormatter} from "./ApexFormatters"; import {timeFormatter} from "./ApexFormatters";
export default { export default {
@ -149,7 +149,7 @@
}; };
xhttp.open( xhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/records/search/allBetweenAndUser?start=" + "/records/search/allBetweenAndUser?start=" +
this.chartOptions.xaxis.categories[daysToDisplay - 1] + this.chartOptions.xaxis.categories[daysToDisplay - 1] +
"T00:00:01" + "T00:00:01" +

View File

@ -12,7 +12,7 @@
<script> <script>
import VueApexCharts from "vue-apexcharts"; import VueApexCharts from "vue-apexcharts";
import {baseUri} from "../../variables.js"; import {BASE_URI} from "../../globals.js";
import {timeFormatter} from "./ApexFormatters"; import {timeFormatter} from "./ApexFormatters";
export default { export default {
@ -96,7 +96,7 @@
}; };
xhttp.open( xhttp.open(
"GET", "GET",
baseUri + BASE_URI +
"/records/search/allForUser?username=" + "/records/search/allForUser?username=" +
sessionStorage.getItem("username") + sessionStorage.getItem("username") +
"&page=" + "&page=" +