diff options
author | devega <ma.devega@globunet.com> | 2019-05-17 13:21:04 +0200 |
---|---|---|
committer | devega <ma.devega@globunet.com> | 2019-05-17 13:21:04 +0200 |
commit | 4a04b450f918e47fb0758cac47b3f0581d8db859 (patch) | |
tree | fb0b5aa897eb8e4f375fa7c10adf48229900ee2c /admin/WebConsole3/frontend/src/app/service/og-commands.service.ts | |
parent | 1dde16d74e66dd6699108bc17c03021e3ec96214 (diff) | |
parent | d34b00c51df4dcc5aa88e76361b22ef7c1ff72a8 (diff) |
Merge remote-tracking branch 'origin/webconsole3' into webconsole3
Diffstat (limited to 'admin/WebConsole3/frontend/src/app/service/og-commands.service.ts')
-rw-r--r-- | admin/WebConsole3/frontend/src/app/service/og-commands.service.ts | 15 |
1 files changed, 11 insertions, 4 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); } } |