pridana komponenta pre FullScreenLoader,
pozity FullScreenLoader po pridani BugAdd a pri nacitani Dashboard
This commit is contained in:
parent
1eda8f80bf
commit
726a9b0f43
35
webapp/src/components/FullScreenLoader.vue
Normal file
35
webapp/src/components/FullScreenLoader.vue
Normal file
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<div class="fullscreen-loader">
|
||||
<div class="spinner"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.fullscreen-loader {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border: 6px solid #fff;
|
||||
border-top: 6px solid #3498db;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,4 +1,6 @@
|
||||
<template>
|
||||
<FullScreenLoader v-if="loading" />
|
||||
|
||||
<div id="bug-add">
|
||||
<h1>Pridať nový bug</h1>
|
||||
|
||||
@ -103,9 +105,11 @@
|
||||
|
||||
<script>
|
||||
import { backend } from "../backend";
|
||||
import FullScreenLoader from "../components/FullScreenLoader.vue";
|
||||
|
||||
export default {
|
||||
name: "BugAdd",
|
||||
components: { FullScreenLoader },
|
||||
data() {
|
||||
return {
|
||||
bugReport: {
|
||||
@ -116,6 +120,7 @@ export default {
|
||||
files: [],
|
||||
},
|
||||
selectedFiles: [],
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@ -140,6 +145,7 @@ export default {
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.loading = true;
|
||||
// Vytvorenie FormData objektu pre odoslanie súborov
|
||||
const formData = new FormData();
|
||||
formData.append("title", this.bugReport.title);
|
||||
@ -168,13 +174,15 @@ export default {
|
||||
)
|
||||
.then((result) => {
|
||||
console.log(result);
|
||||
this.resetForm();
|
||||
this.$router.push("/");
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
// this.resetForm();
|
||||
// this.$router.push("/");
|
||||
},
|
||||
resetForm() {
|
||||
this.bugReport = {
|
||||
|
@ -1,4 +1,6 @@
|
||||
<template>
|
||||
<FullScreenLoader v-if="loading" />
|
||||
|
||||
<div id="dashboard">
|
||||
<div id="inbox">
|
||||
<h2>Nezaradené</h2>
|
||||
@ -138,14 +140,17 @@ function isDragable(element) {
|
||||
import ReportBox from "../components/ReportBox.vue";
|
||||
import draggable from "vuedraggable";
|
||||
import { backend } from "../backend";
|
||||
import FullScreenLoader from "../components/FullScreenLoader.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ReportBox,
|
||||
draggable,
|
||||
FullScreenLoader,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
itemsUncategorized: [],
|
||||
itemsWaiting: [],
|
||||
itemsInProgress: [],
|
||||
@ -153,12 +158,14 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
loadData() {
|
||||
loadData(use_loader = true) {
|
||||
if (use_loader) this.loading = true;
|
||||
backend.getAllGrouped(Array(0, 1, 2, 3)).then((all_grouped) => {
|
||||
this.itemsUncategorized = all_grouped[0];
|
||||
this.itemsWaiting = all_grouped[1];
|
||||
this.itemsInProgress = all_grouped[2];
|
||||
this.itemsBlocked = all_grouped[3];
|
||||
if (use_loader) this.loading = false;
|
||||
});
|
||||
},
|
||||
getDataByStatus(report_status) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user