Update buefy dialog, notification, toast

This commit is contained in:
alkl58
2024-11-06 16:51:20 +01:00
committed by Milos Stojanovic
parent f757fcdec2
commit d9273d569a
8 changed files with 22 additions and 22 deletions

View File

@@ -48,7 +48,7 @@ new Vue({
this.$router.push('/').catch(() => {}) this.$router.push('/').catch(() => {})
}) })
.catch(() => { .catch(() => {
this.$notification.open({ this.$buefy.notification.open({
message: this.lang('Something went wrong'), message: this.lang('Something went wrong'),
type: 'is-danger', type: 'is-danger',
queue: false, queue: false,
@@ -57,7 +57,7 @@ new Vue({
}) })
}) })
.catch(() => { .catch(() => {
this.$notification.open({ this.$buefy.notification.open({
message: this.lang('Something went wrong'), message: this.lang('Something went wrong'),
type: 'is-danger', type: 'is-danger',
queue: false, queue: false,

View File

@@ -118,14 +118,14 @@ const funcs = {
.then((user) => { .then((user) => {
if (user.username !== store.state.user.username) { if (user.username !== store.state.user.username) {
this.$store.commit('destroyUser', user) this.$store.commit('destroyUser', user)
this.$toast.open({ this.$buefy.toast.open({
message: this.lang('Please log in'), message: this.lang('Please log in'),
type: 'is-danger', type: 'is-danger',
}) })
} }
}) })
.catch(() => { .catch(() => {
this.$toast.open({ this.$buefy.toast.open({
message: this.lang('Please log in'), message: this.lang('Please log in'),
type: 'is-danger', type: 'is-danger',
}) })
@@ -135,14 +135,14 @@ const funcs = {
this.checkUser() this.checkUser()
if (typeof error == 'string') { if (typeof error == 'string') {
this.$toast.open({ this.$buefy.toast.open({
message: this.lang(error), message: this.lang(error),
type: 'is-danger', type: 'is-danger',
duration: 5000, duration: 5000,
}) })
return return
} else if (error && error.response && error.response.data && error.response.data.data) { } else if (error && error.response && error.response.data && error.response.data.data) {
this.$toast.open({ this.$buefy.toast.open({
message: this.lang(error.response.data.data), message: this.lang(error.response.data.data),
type: 'is-danger', type: 'is-danger',
duration: 5000, duration: 5000,
@@ -150,7 +150,7 @@ const funcs = {
return return
} }
this.$toast.open({ this.$buefy.toast.open({
message: this.lang('Unknown error'), message: this.lang('Unknown error'),
type: 'is-danger', type: 'is-danger',
duration: 5000, duration: 5000,

View File

@@ -392,7 +392,7 @@ export default {
}) })
.then(ret => { .then(ret => {
this.isLoading = false this.isLoading = false
this.$dialog.alert({ this.$buefy.dialog.alert({
message: this.lang('Your file is ready'), message: this.lang('Your file is ready'),
confirmText: this.lang('Download'), confirmText: this.lang('Download'),
onConfirm: () => { onConfirm: () => {
@@ -439,7 +439,7 @@ export default {
return item.type == 'file' && item.name.split('.').pop() == 'zip' return item.type == 'file' && item.name.split('.').pop() == 'zip'
}, },
unzip(event, item) { unzip(event, item) {
this.$dialog.confirm({ this.$buefy.dialog.confirm({
message: this.lang('Are you sure you want to do this?'), message: this.lang('Are you sure you want to do this?'),
type: 'is-danger', type: 'is-danger',
cancelText: this.lang('Cancel'), cancelText: this.lang('Cancel'),
@@ -463,7 +463,7 @@ export default {
}) })
}, },
zip(event, item) { zip(event, item) {
this.$dialog.prompt({ this.$buefy.dialog.prompt({
message: this.lang('Name'), message: this.lang('Name'),
cancelText: this.lang('Cancel'), cancelText: this.lang('Cancel'),
confirmText: this.lang('Create'), confirmText: this.lang('Create'),
@@ -527,7 +527,7 @@ export default {
}) })
}, },
rename(event, item) { rename(event, item) {
this.$dialog.prompt({ this.$buefy.dialog.prompt({
message: this.lang('New name'), message: this.lang('New name'),
cancelText: this.lang('Cancel'), cancelText: this.lang('Cancel'),
confirmText: this.lang('Rename'), confirmText: this.lang('Rename'),
@@ -556,7 +556,7 @@ export default {
}) })
}, },
create(type) { create(type) {
this.$dialog.prompt({ this.$buefy.dialog.prompt({
cancelText: this.lang('Cancel'), cancelText: this.lang('Cancel'),
confirmText: this.lang('Create'), confirmText: this.lang('Create'),
inputAttrs: { inputAttrs: {
@@ -585,7 +585,7 @@ export default {
}) })
}, },
remove(event, item) { remove(event, item) {
this.$dialog.confirm({ this.$buefy.dialog.confirm({
message: this.lang('Are you sure you want to do this?'), message: this.lang('Are you sure you want to do this?'),
type: 'is-danger', type: 'is-danger',
cancelText: this.lang('Cancel'), cancelText: this.lang('Cancel'),

View File

@@ -81,7 +81,7 @@ export default {
}, },
methods: { methods: {
remove(user) { remove(user) {
this.$dialog.confirm({ this.$buefy.dialog.confirm({
message: this.lang('Are you sure you want to do this?'), message: this.lang('Are you sure you want to do this?'),
type: 'is-danger', type: 'is-danger',
cancelText: this.lang('Cancel'), cancelText: this.lang('Cancel'),
@@ -92,7 +92,7 @@ export default {
}) })
.then(() => { .then(() => {
this.users = _.reject(this.users, u => u.username == user.username) this.users = _.reject(this.users, u => u.username == user.username)
this.$toast.open({ this.$buefy.toast.open({
message: this.lang('Deleted'), message: this.lang('Deleted'),
type: 'is-success', type: 'is-success',
}) })

View File

@@ -58,7 +58,7 @@ export default {
content: this.content, content: this.content,
}) })
.then(() => { .then(() => {
this.$toast.open({ this.$buefy.toast.open({
message: this.lang('Updated'), message: this.lang('Updated'),
type: 'is-success', type: 'is-success',
}) })

View File

@@ -47,7 +47,7 @@ export default {
newpassword: this.newpassword, newpassword: this.newpassword,
}) })
.then(() => { .then(() => {
this.$toast.open({ this.$buefy.toast.open({
message: this.lang('Updated'), message: this.lang('Updated'),
type: 'is-success', type: 'is-success',
}) })

View File

@@ -93,7 +93,7 @@ export default {
chunkSize: this.$store.state.config.upload_chunk_size, chunkSize: this.$store.state.config.upload_chunk_size,
maxFileSize: this.$store.state.config.upload_max_size, maxFileSize: this.$store.state.config.upload_max_size,
maxFileSizeErrorCallback: (file) => { maxFileSizeErrorCallback: (file) => {
this.$notification.open({ this.$buefy.notification.open({
message: this.lang('File size error', file.name, this.formatBytes(this.$store.state.config.upload_max_size)), message: this.lang('File size error', file.name, this.formatBytes(this.$store.state.config.upload_max_size)),
type: 'is-danger', type: 'is-danger',
queue: false, queue: false,
@@ -103,7 +103,7 @@ export default {
}) })
if (!this.resumable.support) { if (!this.resumable.support) {
this.$dialog.alert({ this.$buefy.dialog.alert({
type: 'is-danger', type: 'is-danger',
message: this.lang('Browser not supported.'), message: this.lang('Browser not supported.'),
}) })
@@ -148,7 +148,7 @@ export default {
methods: { methods: {
closeWindow() { closeWindow() {
if (this.activeUploads) { if (this.activeUploads) {
this.$dialog.confirm({ this.$buefy.dialog.confirm({
message: this.lang('Are you sure you want to stop all uploads?'), message: this.lang('Are you sure you want to stop all uploads?'),
type: 'is-danger', type: 'is-danger',
cancelText: this.lang('Cancel'), cancelText: this.lang('Cancel'),

View File

@@ -172,7 +172,7 @@ export default {
confirmSave() { confirmSave() {
if (this.formFields.role == 'guest' && this.getPermissionsArray().length) { if (this.formFields.role == 'guest' && this.getPermissionsArray().length) {
this.$dialog.confirm({ this.$buefy.dialog.confirm({
message: this.lang('Are you sure you want to allow access to everyone?'), message: this.lang('Are you sure you want to allow access to everyone?'),
type: 'is-danger', type: 'is-danger',
cancelText: this.lang('Cancel'), cancelText: this.lang('Cancel'),
@@ -199,7 +199,7 @@ export default {
permissions: this.getPermissionsArray(), permissions: this.getPermissionsArray(),
}) })
.then(res => { .then(res => {
this.$toast.open({ this.$buefy.toast.open({
message: this.lang('Updated'), message: this.lang('Updated'),
type: 'is-success', type: 'is-success',
}) })