Fix repair state when installation or uinstallation fails
This commit is contained in:
@@ -52,6 +52,12 @@ const isAppStopped = computed(() => {
|
||||
});
|
||||
|
||||
function onSetView(newView) {
|
||||
if (!isViewEnabled(newView, app.value.error?.details?.installationState)) {
|
||||
currentView.value = 'info';
|
||||
window.location.hash = `/app/${id.value}/info`;
|
||||
return;
|
||||
}
|
||||
|
||||
currentView.value = newView;
|
||||
window.location.hash = `/app/${id.value}/${newView}`;
|
||||
}
|
||||
@@ -151,16 +157,18 @@ async function refresh() {
|
||||
function isViewEnabled(view, errorState) {
|
||||
if (!errorState) return true;
|
||||
|
||||
if (view === 'info'
|
||||
|| view === 'display'
|
||||
|| view === 'uninstall'
|
||||
if (view === 'info' || view === 'uninstall' || view === 'eventlog') return true;
|
||||
|
||||
if (errorState === ISTATES.PENDING_INSTALL) return view === 'repair';
|
||||
if (errorState === ISTATES.PENDING_UNINSTALL) return false;
|
||||
|
||||
if (view === 'display'
|
||||
|| view === 'backups'
|
||||
|| view === 'access'
|
||||
|| view === 'proxy'
|
||||
|| view === 'graphs'
|
||||
|| view === 'security'
|
||||
|| view === 'cron'
|
||||
|| view === 'eventlog'
|
||||
) return true;
|
||||
|
||||
if (view === 'location') {
|
||||
|
||||
Reference in New Issue
Block a user