This commit is contained in:
@@ -197,13 +197,13 @@
|
|||||||
</v-menu>
|
</v-menu>
|
||||||
</v-toolbar-items>
|
</v-toolbar-items>
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
<v-content>
|
<v-main>
|
||||||
<v-container fluid>
|
<v-container fluid>
|
||||||
<transition name="fade" mode="out-in" @after-leave="afterLeave">
|
<transition name="fade" mode="out-in" @after-leave="afterLeave">
|
||||||
<router-view class="view" :key="$route.fullPath"></router-view>
|
<router-view class="view" :key="$route.fullPath"></router-view>
|
||||||
</transition>
|
</transition>
|
||||||
</v-container>
|
</v-container>
|
||||||
</v-content>
|
</v-main>
|
||||||
<v-footer
|
<v-footer
|
||||||
v-if="!isAuthenticated"
|
v-if="!isAuthenticated"
|
||||||
absolute
|
absolute
|
||||||
|
|||||||
@@ -131,11 +131,12 @@ export default {
|
|||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
// Custom confirmation
|
// Custom confirmation
|
||||||
//
|
//
|
||||||
confirmGeneric(tKey) {
|
confirmGeneric(tKey, ttype = "info") {
|
||||||
return VM_LOCAL.$root.$gzconfirm({
|
return VM_LOCAL.$root.$gzconfirm({
|
||||||
message: window.$gz.translation.get(tKey),
|
message: window.$gz.translation.get(tKey),
|
||||||
yesButtonText: window.$gz.translation.get("OK"),
|
yesButtonText: window.$gz.translation.get("OK"),
|
||||||
noButtonText: window.$gz.translation.get("Cancel")
|
noButtonText: window.$gz.translation.get("Cancel"),
|
||||||
|
type: ttype
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,25 @@
|
|||||||
<v-dialog
|
<v-dialog
|
||||||
persistent
|
persistent
|
||||||
v-model="isVisible"
|
v-model="isVisible"
|
||||||
:max-width="options.width"
|
:max-width="maxWidth"
|
||||||
|
:width="width"
|
||||||
@keydown.esc="cancel"
|
@keydown.esc="cancel"
|
||||||
:data-cy="!!$ay.dev ? 'gzconfirm' : false"
|
:data-cy="!!$ay.dev ? 'gzconfirm' : false"
|
||||||
>
|
>
|
||||||
<v-card elevation="24">
|
<v-card elevation="24">
|
||||||
<v-card-title class="headline lighten-2" primary-title>
|
<v-card-title class="headline lighten-2" primary-title>
|
||||||
|
<template v-if="options.type == 'success'">
|
||||||
|
<v-icon large color="success">fa-check-circle</v-icon>
|
||||||
|
</template>
|
||||||
|
<template v-if="options.type == 'info'">
|
||||||
|
<v-icon large color="info">fa-info-circle</v-icon>
|
||||||
|
</template>
|
||||||
|
<template v-if="options.type == 'warning'">
|
||||||
|
<v-icon large color="warning">fa-exclamation-circle</v-icon>
|
||||||
|
</template>
|
||||||
|
<template v-if="options.type == 'error'">
|
||||||
|
<v-icon large color="error">fa-exclamation-triangle</v-icon>
|
||||||
|
</template>
|
||||||
<span v-if="options.title"> {{ options.title }} </span>
|
<span v-if="options.title"> {{ options.title }} </span>
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
|
|
||||||
@@ -16,8 +29,6 @@
|
|||||||
{{ options.message }}
|
{{ options.message }}
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
|
||||||
<!-- <v-divider></v-divider> v-bind:class="options.type" -->
|
|
||||||
|
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<v-btn
|
<v-btn
|
||||||
@@ -41,36 +52,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
/**
|
|
||||||
* Vuetify Confirm Dialog component
|
|
||||||
*
|
|
||||||
* Insert component where you want to use it:
|
|
||||||
* <confirm ref="confirm"></confirm>
|
|
||||||
*
|
|
||||||
* Call it:
|
|
||||||
* this.$refs.confirm.open('Delete', 'Are you sure?', { color: 'red' }).then((confirm) => {})
|
|
||||||
* Or use await:
|
|
||||||
* if (await this.$refs.confirm.open('Delete', 'Are you sure?', { color: 'red' })) {
|
|
||||||
* // yes
|
|
||||||
* }
|
|
||||||
* else {
|
|
||||||
* // cancel
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* Alternatively you can place it in main App component and access it globally via this.$root.$confirm
|
|
||||||
* <template>
|
|
||||||
* <v-app>
|
|
||||||
* ...
|
|
||||||
* <confirm ref="confirm"></confirm>
|
|
||||||
* </v-app>
|
|
||||||
* </template>
|
|
||||||
*
|
|
||||||
* mounted() {
|
|
||||||
* this.$root.$confirm = this.$refs.confirm.open
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
width: 290,
|
||||||
|
maxWidth: 290,
|
||||||
isVisible: false,
|
isVisible: false,
|
||||||
resolve: null,
|
resolve: null,
|
||||||
reject: null,
|
reject: null,
|
||||||
@@ -79,14 +64,22 @@ export default {
|
|||||||
message: null,
|
message: null,
|
||||||
yesButtonText: null,
|
yesButtonText: null,
|
||||||
noButtonText: null,
|
noButtonText: null,
|
||||||
type: "warning", //one of success, info, warning, and error, see v-alert docs for more info
|
type: "info" //one of success, info, warning, and error, see v-alert docs for more info
|
||||||
width: 290,
|
|
||||||
zIndex: 200
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
open(options) {
|
open(options) {
|
||||||
this.options = Object.assign(this.options, options);
|
this.options = Object.assign(this.options, options);
|
||||||
|
this.maxWidth = Math.floor(window.innerWidth * 0.9);
|
||||||
|
let calculatedWidth = Math.floor(window.innerWidth * 0.5);
|
||||||
|
if (calculatedWidth < 290) {
|
||||||
|
this.width = 290;
|
||||||
|
} else if (calculatedWidth > 800) {
|
||||||
|
this.width = 800;
|
||||||
|
} else {
|
||||||
|
this.width = calculatedWidth;
|
||||||
|
}
|
||||||
|
|
||||||
this.isVisible = true;
|
this.isVisible = true;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.resolve = resolve;
|
this.resolve = resolve;
|
||||||
|
|||||||
@@ -416,14 +416,16 @@ export default {
|
|||||||
let vm = this;
|
let vm = this;
|
||||||
try {
|
try {
|
||||||
let dialogResult = await window.$gz.dialog.confirmGeneric(
|
let dialogResult = await window.$gz.dialog.confirmGeneric(
|
||||||
"AdminEraseDatabaseWarning"
|
"AdminEraseDatabaseWarning",
|
||||||
|
"warning"
|
||||||
);
|
);
|
||||||
if (dialogResult == false) {
|
if (dialogResult == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogResult = await window.$gz.dialog.confirmGeneric(
|
dialogResult = await window.$gz.dialog.confirmGeneric(
|
||||||
"AdminEraseDatabaseLastWarning"
|
"AdminEraseDatabaseLastWarning",
|
||||||
|
"error"
|
||||||
);
|
);
|
||||||
if (dialogResult == false) {
|
if (dialogResult == false) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user