diff --git a/src/assets/less/forms.less b/src/assets/less/forms.less index d70444a2322..8b104c252ab 100644 --- a/src/assets/less/forms.less +++ b/src/assets/less/forms.less @@ -3,13 +3,13 @@ border-color: #e4e3e2; } -#export-csv-modal .ui-dropdown.ui-widget { +#export-csv-modal, #export-upgrade-modal .ui-dropdown.ui-widget { height: 20px; margin: 0 0 0 10px; width: auto; } -#export-csv-modal .ui-dropdown.ui-widget .ui-inputtext { +#export-csv-modal, #export-upgrade-modal .ui-dropdown.ui-widget .ui-inputtext { height: auto; width: auto; font-size: inherit; diff --git a/src/common/list/base-list.ts b/src/common/list/base-list.ts index 4f83c65715a..cbcab740a11 100644 --- a/src/common/list/base-list.ts +++ b/src/common/list/base-list.ts @@ -18,7 +18,7 @@ import { BreadcrumbService } from 'common/breadcrumb/breadcrumb.service'; export abstract class BaseList implements OnInit { @ViewChild(TextFilterComponent, { static: true }) textFilter: TextFilterComponent; @ViewChild('ptable', { static: false }) ptable: Table; - @ViewChild('selectAllCheckbox', { static: true }) selectAllCheckbox: ElementRef; + @ViewChild('selectAllCheckbox', { static: false }) selectAllCheckbox: ElementRef; public selectedItems: Array; public HEADER_HEIGHT: number; public FILTER_WIDTH: number; diff --git a/src/organization/collector/collector_detail.component.ts b/src/organization/collector/collector_detail.component.ts index ec6156fe19d..f572b7e511f 100755 --- a/src/organization/collector/collector_detail.component.ts +++ b/src/organization/collector/collector_detail.component.ts @@ -21,7 +21,7 @@ import { ColumnWithSort } from 'common/object'; }) export class CollectorDetailComponent implements OnInit { - @ViewChild('headerInfo', { static: true }) set content(content: ElementRef) { this.headerInfoEl = content; } + @ViewChild('headerInfo', { static: false }) set content(content: ElementRef) { this.headerInfoEl = content; } private headerInfoEl: ElementRef; private window = window; @@ -102,7 +102,7 @@ export class CollectorDetailComponent implements OnInit { return this.service.accountService.navigateOrganization(subPath); } - onResize($event) { + onResize(event) { this.listHeight = this.getListHeight(); } diff --git a/src/organization/device/base/base_device.ts b/src/organization/device/base/base_device.ts index 1e4e41f8853..d80e65c8bd5 100644 --- a/src/organization/device/base/base_device.ts +++ b/src/organization/device/base/base_device.ts @@ -30,19 +30,6 @@ export class BaseDevice extends BaseList implements OnInit, AfterViewInit { return item.upgrade_status == DeviceUpgradeStatus.StatusWaiting || item.upgrade_status == DeviceUpgradeStatus.StatusRequested; } - isUpgradable(item: DeviceListItem) { - if (item.agent_version < '1.7.0') { - return false; - } - if (item.agent_version >= item.latest_agent_version) { - return false; - } - if (this.upgradeWaiting(item)) { - return false; - } - return true; - } - isAgentUpToDate(item: DeviceListItem) { if (item.agent_version >= item.latest_agent_version) { return true; diff --git a/src/organization/device/device.service.ts b/src/organization/device/device.service.ts index c9b6836fbff..d2c77e14de1 100755 --- a/src/organization/device/device.service.ts +++ b/src/organization/device/device.service.ts @@ -19,8 +19,14 @@ export class DeviceService extends BaseListService { return this.accountService.executePost(`/organization/${this.accountService.getOrganizationId()}/device/${deviceId}/update`, data); } - upgradeDevices(deviceIds: any) { - return this.accountService.executePost(`/organization/${this.accountService.getOrganizationId()}/device/request_upgrade`, deviceIds); + upgradeDevices(ids: Array, limit: number) { + let data = { + selected_ids: ids, + filters: this.getFilters(), + sort: this.listSorting, + limit: limit + }; + return this.accountService.executePost(`/organization/${this.accountService.getOrganizationId()}/device/request_upgrade`, data); } updateLabels(deviceIds: number[], updateLabelItems: any[]) { diff --git a/src/organization/device/device_list.component.html b/src/organization/device/device_list.component.html index be62818ab39..09a8d4665c7 100755 --- a/src/organization/device/device_list.component.html +++ b/src/organization/device/device_list.component.html @@ -31,11 +31,21 @@

Devices - - - - - + + + + + Total: {{ response.total }}

@@ -131,34 +141,6 @@

-