<commit_before>angular.module('hpcpm-ui').controller('RemovePowerLimitModalController', removePowerLimitModalController);

removePowerLimitModalController.$inject = ['$scope', '$rootScope', '$modalInstance', 'toaster', 'DataService', 'nodeName', 'deviceId'];

function removePowerLimitModalController($scope, $rootScope, $modalInstance, toaster, DataService, nodeName, deviceId) {
    $scope.name = nodeName;
    $scope.deviceId = deviceId;

    $scope.cancel = function () {
        $modalInstance.dismiss('cancel');
    };

    $scope.removePowerLimit = function () {
        DataService.removeDevicePowerLimit($scope.name, $scope.deviceId).then(function (response) {
            $scope.response = response;
            toaster.pop('success', 'Success', 'Device' + $scope.deviceId + ' power on node ' + $scope.name + ' removed successfully');
            $rootScope.$broadcast('RefreshNodeDetails');
        },
        function (error) {
          toaster.pop('error', 'Error ' + error.status, 'Cannot remove power limit from device: ' + $scope.deviceId);
        });
        $modalInstance.close();
    };


}<commit_msg>typo fix<commit_after>angular.module('hpcpm-ui').controller('RemovePowerLimitModalController', removePowerLimitModalController);

removePowerLimitModalController.$inject = ['$scope', '$rootScope', '$modalInstance', 'toaster', 'DataService', 'nodeName', 'deviceId'];

function removePowerLimitModalController($scope, $rootScope, $modalInstance, toaster, DataService, nodeName, deviceId) {
    $scope.name = nodeName;
    $scope.deviceId = deviceId;

    $scope.cancel = function () {
        $modalInstance.dismiss('cancel');
    };

    $scope.removePowerLimit = function () {
        DataService.removeDevicePowerLimit($scope.name, $scope.deviceId).then(function (response) {
            $scope.response = response;
            toaster.pop('success', 'Success', 'Device' + $scope.deviceId + ' power limit on node ' + $scope.name + ' removed successfully');
            $rootScope.$broadcast('RefreshNodeDetails');
        },
        function (error) {
          toaster.pop('error', 'Error ' + error.status, 'Cannot remove power limit from device: ' + $scope.deviceId);
        });
        $modalInstance.close();
    };


}
{'fraction_non_alphanumeric': 0.15028901734104047, 'fraction_numerical': 0.0, 'mean_word_length': 3.859611231101512, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4616945', 'n_tokens_mistral': 620, 'n_tokens_neox': 610, 'n_words': 116}