filemanager: Show non-dismissable dialog on fatal error
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<MainLayout>
|
||||
<template #dialogs>
|
||||
<Dialog v-model:visible="fatalError" modal header="Error" :closable="false" :closeOnEscape="false">
|
||||
<p>{{ fatalError }}</p>
|
||||
</Dialog>
|
||||
|
||||
<!-- have to use v-model instead of : bind - https://github.com/primefaces/primevue/issues/815 -->
|
||||
<Dialog v-model:visible="newFileDialog.visible" modal :style="{ width: '50vw' }" @show="onDialogShow('newFileDialogNameInput')">
|
||||
<template #header>
|
||||
@@ -118,6 +122,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
cwd: '/',
|
||||
fatalError: '',
|
||||
activeItem: null,
|
||||
activeDirectoryItem: {},
|
||||
items: [],
|
||||
@@ -363,6 +368,7 @@ export default {
|
||||
|
||||
if (error || result.statusCode !== 200) {
|
||||
console.error(`Invalid resource ${type} ${resourceId}`, error || result.statusCode);
|
||||
this.fatalError = `Invalid resource ${type} ${resourceId}`;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -377,12 +383,13 @@ export default {
|
||||
|
||||
if (error || result.statusCode !== 200) {
|
||||
console.error(`Invalid resource ${type} ${resourceId}`, error || result.statusCode);
|
||||
this.fatalError = `Invalid resource ${type} ${resourceId}`;
|
||||
return;
|
||||
}
|
||||
|
||||
this.title = result.body.name;
|
||||
} else {
|
||||
console.error(`Unsupported type ${type}`);
|
||||
this.fatalError = `Unsupported type ${type}`;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -397,7 +404,7 @@ export default {
|
||||
|
||||
this.$watch(() => this.$route.params, (toParams, previousParams) => {
|
||||
if (toParams.type !== 'app' && toParams.type !== 'volume') {
|
||||
console.error(`Unknown type ${toParams.type}`);
|
||||
this.fatalError = `Unknown type ${toParams.type}`;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user