summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole3/frontend/src/app/service
diff options
context:
space:
mode:
Diffstat (limited to 'admin/WebConsole3/frontend/src/app/service')
-rw-r--r--admin/WebConsole3/frontend/src/app/service/og-commands.service.ts15
-rw-r--r--admin/WebConsole3/frontend/src/app/service/og-common.service.ts16
2 files changed, 18 insertions, 13 deletions
diff --git a/admin/WebConsole3/frontend/src/app/service/og-commands.service.ts b/admin/WebConsole3/frontend/src/app/service/og-commands.service.ts
index 1ea33faa..6b54a896 100644
--- a/admin/WebConsole3/frontend/src/app/service/og-commands.service.ts
+++ b/admin/WebConsole3/frontend/src/app/service/og-commands.service.ts
@@ -39,9 +39,16 @@ export class OGCommandsService {
this.commandService.execute(this.execution).subscribe(
(response: any[]) => {
// Buscar en la respuesta si hay algún statuscode diferente de 200
- const errors = response.filter(function(value) {
- return (value.statusCode && value.statusCode !== '!200');
- } );
+ const errors = [];
+ const keys = Object.keys(response);
+ keys.forEach((index) => {
+ const elemKeys = Object.keys(response[index]);
+ elemKeys.forEach((elemKey) => {
+ if (elemKey === 'statusCode' && response[index][elemKey] !== 200) {
+ errors.push(response[index]);
+ }
+ });
+ });
let errorStr = '';
let toasterOpts = {type: 'success', title: 'success', body: this.translate.instant('successfully_executed')};
if (errors.length > 0) {
@@ -116,7 +123,7 @@ export class OGCommandsService {
// Crear como nombre para mostrar, el disco y partición del sistema
const obj = Object.assign({}, client.partitions[index]);
const str = 'disco: ' + obj.numDisk + ', part: ' + obj.numPartition + ', SO: ' + client.partitions[index].osName;
- clonablePartitions.push(obj.numDisk + ' ' + obj.numPartition)
+ clonablePartitions.push(obj.numDisk + ' ' + obj.numPartition);
options.scope.partitions.push(str);
}
}
diff --git a/admin/WebConsole3/frontend/src/app/service/og-common.service.ts b/admin/WebConsole3/frontend/src/app/service/og-common.service.ts
index b529199d..3de25304 100644
--- a/admin/WebConsole3/frontend/src/app/service/og-common.service.ts
+++ b/admin/WebConsole3/frontend/src/app/service/og-common.service.ts
@@ -198,15 +198,13 @@ export class OgCommonService {
}
saveSelection() {
- if (Object.keys(this.selectedClients).length > 0) {
- localStorage.setItem('selectedClients', JSON.stringify(this.selectedClients, function (key, value) {
- let result = value;
- if (key === 'parent' && typeof value === 'object') {
- result = value.id;
- }
- return result;
- }));
- }
+ localStorage.setItem('selectedClients', JSON.stringify(this.selectedClients, function (key, value) {
+ let result = value;
+ if (key === 'parent' && typeof value === 'object') {
+ result = value.id;
+ }
+ return result;
+ }));
}
getSelectionSize() {