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>
import SignIn from "./views/SignIn.vue";
import {baseUri} from "./variables.js";
import {BASE_URI} from "./globals.js";
if (!sessionStorage.getItem("loggedin")) {
sessionStorage.setItem("loggedin", false);
@ -175,7 +175,7 @@
}
};
xhttp.open("POST", baseUri + "/login", false);
xhttp.open("POST", BASE_URI + "/login", false);
xhttp.send(
'{"username": "' +
loginData.username +
@ -200,7 +200,7 @@
location.reload();
}
};
whoxhttp.open("GET", baseUri + "/whoami", false);
whoxhttp.open("GET", BASE_URI + "/whoami", false);
whoxhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
whoxhttp.send(null);
location.reload();
@ -216,7 +216,7 @@
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.send(
"{" +
@ -250,7 +250,7 @@
};
xhttp.open(
"GET",
baseUri +
BASE_URI +
"/users/search/byUsername?username=" +
sessionStorage.getItem("username"),
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>
<style>
<style scoped>
p {
font-size: 20pt;
}

View File

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

View File

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

View File

@ -71,7 +71,7 @@
</v-container>
</template>
<script>
import {baseUri} from "../variables";
import {BASE_URI} from "../globals";
export default {
name: "Edituser",
@ -156,7 +156,7 @@
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("Authorization", sessionStorage.getItem("jwt"));

View File

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

View File

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

View File

@ -1,4 +1,5 @@
<template>
<div>
<v-row class="ma-5">
<v-col cols="4">
<WorkPausePie/>
@ -9,13 +10,18 @@
<v-col cols="4">
<revenue-pie/>
</v-col>
</v-row>
<v-row class="ma-5">
<v-col cols="12">
<MonthSummary/>
</v-col>
</v-row>
<v-row class="ma-5">
<v-col cols="12">
<WeekSummary/>
</v-col>
</v-row>
</div>
</template>
<script>

View File

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

View File

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

View File

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

View File

@ -22,7 +22,7 @@
</template>
<script>
import {baseUri} from "../variables.js";
import {BASE_URI} from "../globals.js";
import UsersItems from "./UsersItems.vue";
export default {
@ -82,7 +82,7 @@
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"));

View File

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

View File

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

View File

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

View File

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

View File

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