From: Tiago Melo Date: Thu, 12 Mar 2020 21:31:48 +0000 (-0100) Subject: mgr/dashboard: Replace ng2-tree with angular-tree-component X-Git-Tag: v15.2.0~51^2~1^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c5ea6c6a5b327f0ce9a61d5c295e5156ce59b154;p=ceph.git mgr/dashboard: Replace ng2-tree with angular-tree-component Fixes: https://tracker.ceph.com/issues/44450 Signed-off-by: Tiago Melo --- diff --git a/src/pybind/mgr/dashboard/frontend/angular.json b/src/pybind/mgr/dashboard/frontend/angular.json index 56a25e515b55c..c54fb5f553dc8 100644 --- a/src/pybind/mgr/dashboard/frontend/angular.json +++ b/src/pybind/mgr/dashboard/frontend/angular.json @@ -37,8 +37,7 @@ "node_modules/ngx-toastr/toastr.css", "node_modules/ngx-bootstrap/datepicker/bs-datepicker.css", "src/styles.scss", - "src/styles/vendor.overrides.scss", - "node_modules/ng2-tree/styles.css" + "src/styles/vendor.overrides.scss" ], "scripts": [ "node_modules/chart.js/dist/Chart.bundle.js" diff --git a/src/pybind/mgr/dashboard/frontend/package-lock.json b/src/pybind/mgr/dashboard/frontend/package-lock.json index 63d29ad9658be..a042d28572f60 100644 --- a/src/pybind/mgr/dashboard/frontend/package-lock.json +++ b/src/pybind/mgr/dashboard/frontend/package-lock.json @@ -3761,14 +3761,12 @@ "dev": true }, "angular-tree-component": { - "version": "8.5.2", - "resolved": "https://registry.npmjs.org/angular-tree-component/-/angular-tree-component-8.5.2.tgz", - "integrity": "sha512-3NwMB+vLq1+WHz2UVgsZA73E1LmIIWJlrrasCKXbLJ3S7NmY9O/wKcolji3Vp2W//5KQ33RXu1jiPXCOQdRzVA==", + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/angular-tree-component/-/angular-tree-component-8.5.6.tgz", + "integrity": "sha512-cxNem6872diZz9kIGqrjSJbKt0P3WSq9wTqZIeVJ8zsddI4Y6ShAVZlZNXUMRyJq246c9pJ6JJEAOzKVLk9xgA==", "requires": { "lodash": "^4.17.11", - "mobx": "^5.14.2", - "mobx-angular": "3.0.3", - "opencollective-postinstall": "^2.0.2" + "mobx": "^4.15.1" } }, "ansi-colors": { @@ -12806,14 +12804,9 @@ } }, "mobx": { - "version": "5.15.2", - "resolved": "https://registry.npmjs.org/mobx/-/mobx-5.15.2.tgz", - "integrity": "sha512-eVmHGuSYd0ZU6x8gYMdgLEnCC9kfBJaf7/qJt+/yIxczVVUiVzHvTBjZH3xEa5FD5VJJSh1/Ba4SThE4ErEGjw==" - }, - "mobx-angular": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/mobx-angular/-/mobx-angular-3.0.3.tgz", - "integrity": "sha512-mZuuose70V+Sd0hMWDElpRe3mA6GhYjSQN3mHzqk2XWXRJ+eWQa/f3Lqhw+Me/Xd2etWsGR1hnRa1BfQ2ZDtpw==" + "version": "4.15.4", + "resolved": "https://registry.npmjs.org/mobx/-/mobx-4.15.4.tgz", + "integrity": "sha512-nyuHPqmKnVOnbvkjR8OrijBtovxAHYC+JU8/qBqvBw4Dez/n+zzxqNHbZNFy7/07+wwc/Qz7JS9WSfy1LcYISA==" }, "moment": { "version": "2.24.0", @@ -13013,11 +13006,6 @@ } } }, - "ng2-tree": { - "version": "2.0.0-rc.11", - "resolved": "https://registry.npmjs.org/ng2-tree/-/ng2-tree-2.0.0-rc.11.tgz", - "integrity": "sha512-COGMatd+YrwJb3LSobagDC+t2PlSh4GkgG75Akh9QbXOSdFFPkbGmZvILg2xO4Hc+xicacvHp+6GINvjIeJwkA==" - }, "ngx-bootstrap": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/ngx-bootstrap/-/ngx-bootstrap-5.1.2.tgz", @@ -13536,7 +13524,8 @@ "opencollective-postinstall": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", - "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==" + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "dev": true }, "opn": { "version": "5.5.0", @@ -15481,11 +15470,6 @@ "tslib": "^1.9.0" } }, - "rxjs-compat": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/rxjs-compat/-/rxjs-compat-6.5.3.tgz", - "integrity": "sha512-BIJX2yovz3TBpjJoAZyls2QYuU6ZiCaZ+U96SmxQpuSP/qDUfiXPKOVLbThBB2WZijNHkdTTJXKRwvv5Y48H7g==" - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index a6763dbd91ea7..7890e3560203d 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -90,7 +90,7 @@ "@auth0/angular-jwt": "2.1.1", "@ngx-translate/i18n-polyfill": "1.0.0", "@swimlane/ngx-datatable": "15.0.2", - "angular-tree-component": "8.5.2", + "angular-tree-component": "8.5.6", "async-mutex": "0.1.4", "bootstrap": "4.3.1", "chart.js": "2.8.0", @@ -102,11 +102,9 @@ "ng-bootstrap-form-validation": "5.0.0", "ng-click-outside": "5.3.0", "ng2-charts": "2.3.0", - "ng2-tree": "2.0.0-rc.11", "ngx-bootstrap": "5.1.2", "ngx-toastr": "11.0.0", "rxjs": "6.5.3", - "rxjs-compat": "6.5.3", "simplebar-angular": "2.0.1", "swagger-ui-dist": "3.23.11", "tslib": "1.10.0", diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts index c592e29386b75..7db6861101db3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/block.module.ts @@ -3,8 +3,8 @@ import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { RouterModule, Routes } from '@angular/router'; +import { TreeModule } from 'angular-tree-component'; import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation'; -import { TreeModule } from 'ng2-tree'; import { BsDatepickerModule } from 'ngx-bootstrap/datepicker'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; import { ModalModule } from 'ngx-bootstrap/modal'; @@ -67,8 +67,8 @@ import { RbdTrashRestoreModalComponent } from './rbd-trash-restore-modal/rbd-tra ModalModule.forRoot(), SharedModule, RouterModule, - TreeModule, - NgBootstrapFormValidationModule + NgBootstrapFormValidationModule, + TreeModule.forRoot() ], declarations: [ RbdListComponent, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.html index ed5ecec46c3a6..29d91ef472ccd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.html @@ -1,19 +1,23 @@
iSCSI Topology - - - -   + + + + {{ node.data.name }} +   - {{ node.status }} + [ngClass]="{'badge-success': ['logged_in'].includes(node.data.status), 'badge-danger': ['logged_out'].includes(node.data.status)}"> + {{ node.data.status }} - +
- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.scss index bc6646e5f376f..33d580283df6b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.scss +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.scss @@ -1,8 +1,5 @@ // Angular2-Tree Component ::ng-deep tree-root { - tree-viewport { - padding-bottom: 1.5em; - } .tree-children { overflow: inherit; } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts index a08d669044b7e..e1634f1e4d176 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts @@ -3,8 +3,8 @@ import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; +import { TreeModule } from 'angular-tree-component'; import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation'; -import { TreeModule } from 'ng2-tree'; import { AlertModule } from 'ngx-bootstrap/alert'; import { BsDatepickerModule } from 'ngx-bootstrap/datepicker'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; @@ -79,10 +79,10 @@ import { ServicesComponent } from './services/services.component'; ModalModule.forRoot(), AlertModule.forRoot(), TooltipModule.forRoot(), - TreeModule, MgrModulesModule, TypeaheadModule.forRoot(), TimepickerModule.forRoot(), + TreeModule.forRoot(), BsDatepickerModule.forRoot(), NgBootstrapFormValidationModule, CephSharedModule diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.html index a3961e433a913..d56a8e37eb986 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/crushmap/crushmap.component.html @@ -6,20 +6,26 @@
- - - - {{ node.status }} + + + + + + {{ node.data.status }}   + [ngClass]="{'type-osd': node.data.type === 'osd'}" + [innerHTML]="node.data.name"> - +