This commit is contained in:
Girish Ramakrishnan
2024-05-25 13:00:20 +02:00
parent 4ca5fcf472
commit 36887abf88
2 changed files with 2 additions and 30 deletions

View File

@@ -1,6 +1,7 @@
'use strict';
/* global angular:false */
/* global window, localStorage, document */
/* global $:false */
/* global async */
/* global ERROR,ISTATES,HSTATES,RSTATES,APP_TYPES,NOTIFICATION_TYPES */
@@ -484,36 +485,6 @@ app.directive('ngClickSelect', function () {
};
});
// handles various states and triggers a href or configure/repair view
// used by attaching to controller $scope
// if $scope.appPostInstallConfirm.show(app); exists it will be called if not yet confirmed
function onAppClick(app, $event, isOperator, $scope) {
function stopEvent() {
$event.originalEvent.stopPropagation();
$event.originalEvent.preventDefault();
}
if (app.installationState !== ISTATES.INSTALLED) {
if (app.installationState === ISTATES.ERROR && isOperator) $scope.showAppConfigure(app, 'repair');
return stopEvent();
}
// app.health can also be null to indicate insufficient data
if (!app.health) return stopEvent();
if (app.runState === RSTATES.STOPPED) return stopEvent();
if (app.runState === RSTATES.STOPPED) return stopEvent();
if (app.health === HSTATES.UNHEALTHY || app.health === HSTATES.ERROR || app.health === HSTATES.DEAD) {
if (isOperator) $scope.showAppConfigure(app, 'repair');
return stopEvent();
}
if (app.pendingPostInstallConfirmation && $scope.appPostInstallConfirm) {
$scope.appPostInstallConfirm.show(app);
return stopEvent();
}
}
app.directive('ngClickReveal', function () {
return {
restrict: 'A',

View File

@@ -2,6 +2,7 @@
/* global angular */
/* global Clipboard */
/* global window */
/* global $, TASK_TYPES */
angular.module('Application').controller('UserSettingsController', ['$scope', '$location', '$translate', '$timeout', 'Client', function ($scope, $location, $translate, $timeout, Client) {