From f44d4a76172aa1b8ca55607e273c8f7800b5bed6 Mon Sep 17 00:00:00 2001 From: Steven Zhang Date: Wed, 3 Dec 2025 21:50:55 -0800 Subject: [PATCH 01/30] NVSHAS-10195: Upgrade UI framework from Angular 14 to angular 20 --- admin/webapp/package.json | 83 +- admin/webapp/websrc/app/app.component.ts | 2 + admin/webapp/websrc/app/app.module.ts | 21 +- .../app/common/api/assets-http.service.ts | 76 +- .../app/common/api/auth-http.service.ts | 60 +- .../app/common/api/config-http.service.ts | 12 +- .../app/common/api/events-http.service.ts | 22 +- .../app/common/api/policy-http.service.ts | 63 +- .../directives/displayControl.directive.ts | 1 + .../common/directives/maskInput.directive.ts | 1 + .../directives/observe/observe.directive.ts | 1 + .../directives/observe/observe.module.ts | 5 +- .../remote-grid-binding.directive.ts | 1 + .../two-way-infinite-scroll.directive.ts | 3 +- .../button/button.component.ts | 2 + .../neuvector-formly/card/card.component.ts | 2 + .../checkbox/checkbox.component.ts | 2 + .../chips-input/chips-input.component.html | 22 +- .../chips-input/chips-input.component.ts | 2 + .../edit-table-controls.component.ts | 2 + .../edit-table/edit-table.component.html | 4 +- .../edit-table/edit-table.component.ts | 15 +- .../edit-webhook-table-controls.component.ts | 2 + .../formly-errors/formly-errors.component.ts | 2 + .../hint-wrapper/hint-wrapper.component.ts | 2 + .../icon-input/icon-input.component.html | 33 +- .../icon-input/icon-input.component.ts | 2 + .../multicheckbox/multicheckbox.component.ts | 2 + .../neuvector-formly.module.ts | 26 +- .../ngx-slider/ngx-slider.component.ts | 2 + .../panel-wrapper/panel-wrapper.component.ts | 2 + .../radio/radio.component.html | 4 +- .../neuvector-formly/radio/radio.component.ts | 2 + .../readonly-wrapper.component.ts | 2 + .../section-wrapper.component.ts | 2 + .../select/select.component.html | 7 +- .../select/select.component.ts | 2 + .../slider/slider.component.html | 16 +- .../slider/slider.component.ts | 2 + .../text-area/text-area.component.html | 6 +- .../text-area/text-area.component.ts | 3 + .../toggle/toggle.component.html | 4 +- .../toggle/toggle.component.ts | 2 + .../websrc/app/common/nvCommon.module.ts | 9 +- .../websrc/app/common/pipes/app.pipes.ts | 21 +- .../services/admission-rules.service.ts | 14 +- .../app/common/services/containers.service.ts | 9 +- .../common/services/dlp-sensors.service.ts | 10 +- .../app/common/services/namespaces.service.ts | 9 +- .../common/services/network-rules.service.ts | 28 +- .../app/common/services/nodes.service.ts | 4 +- .../app/common/services/platforms.service.ts | 4 +- .../services/security-events.service.ts | 58 +- .../common/services/waf-sensors.service.ts | 10 +- .../webapp/websrc/app/common/styles/app.scss | 7 + .../websrc/app/common/styles/app/common.scss | 6 +- .../websrc/app/common/styles/bootstrap.scss | 13 - .../app/common/styles/bootstrap/_alert.scss | 52 - .../app/common/styles/bootstrap/_badge.scss | 77 -- .../common/styles/bootstrap/_breadcrumb.scss | 42 - .../styles/bootstrap/_button-group.scss | 163 --- .../app/common/styles/bootstrap/_buttons.scss | 142 -- .../app/common/styles/bootstrap/_card.scss | 286 ---- .../common/styles/bootstrap/_carousel.scss | 197 --- .../app/common/styles/bootstrap/_close.scss | 40 - .../app/common/styles/bootstrap/_code.scss | 48 - .../styles/bootstrap/_custom-forms.scss | 528 -------- .../common/styles/bootstrap/_dropdown.scss | 192 --- .../app/common/styles/bootstrap/_forms.scss | 400 ------ .../common/styles/bootstrap/_functions.scss | 143 -- .../app/common/styles/bootstrap/_grid.scss | 73 -- .../app/common/styles/bootstrap/_images.scss | 42 - .../common/styles/bootstrap/_input-group.scss | 208 --- .../common/styles/bootstrap/_jumbotron.scss | 17 - .../common/styles/bootstrap/_list-group.scss | 154 --- .../app/common/styles/bootstrap/_media.scss | 8 - .../app/common/styles/bootstrap/_mixins.scss | 47 - .../app/common/styles/bootstrap/_modal.scss | 240 ---- .../app/common/styles/bootstrap/_nav.scss | 120 -- .../app/common/styles/bootstrap/_navbar.scss | 332 ----- .../common/styles/bootstrap/_pagination.scss | 74 -- .../app/common/styles/bootstrap/_popover.scss | 170 --- .../app/common/styles/bootstrap/_print.scss | 141 -- .../common/styles/bootstrap/_progress.scss | 47 - .../app/common/styles/bootstrap/_reboot.scss | 484 ------- .../app/common/styles/bootstrap/_root.scss | 19 - .../common/styles/bootstrap/_spinners.scss | 65 - .../app/common/styles/bootstrap/_tables.scss | 185 --- .../app/common/styles/bootstrap/_toasts.scss | 46 - .../app/common/styles/bootstrap/_tooltip.scss | 115 -- .../common/styles/bootstrap/_transitions.scss | 20 - .../app/common/styles/bootstrap/_type.scss | 125 -- .../common/styles/bootstrap/_utilities.scss | 18 - .../common/styles/bootstrap/_variables.scss | 1146 ----------------- .../styles/bootstrap/bootstrap-grid.scss | 30 - .../styles/bootstrap/bootstrap-reboot.scss | 12 - .../common/styles/bootstrap/bootstrap.scss | 44 - .../styles/bootstrap/mixins/_alert.scss | 13 - .../bootstrap/mixins/_background-variant.scss | 23 - .../styles/bootstrap/mixins/_badge.scss | 17 - .../bootstrap/mixins/_border-radius.scss | 76 -- .../styles/bootstrap/mixins/_box-shadow.scss | 20 - .../styles/bootstrap/mixins/_breakpoints.scss | 123 -- .../styles/bootstrap/mixins/_buttons.scss | 110 -- .../styles/bootstrap/mixins/_caret.scss | 62 - .../styles/bootstrap/mixins/_clearfix.scss | 7 - .../styles/bootstrap/mixins/_deprecate.scss | 10 - .../styles/bootstrap/mixins/_float.scss | 14 - .../styles/bootstrap/mixins/_forms.scss | 188 --- .../styles/bootstrap/mixins/_gradients.scss | 45 - .../bootstrap/mixins/_grid-framework.scss | 80 -- .../common/styles/bootstrap/mixins/_grid.scss | 71 - .../styles/bootstrap/mixins/_hover.scss | 37 - .../styles/bootstrap/mixins/_image.scss | 36 - .../styles/bootstrap/mixins/_list-group.scss | 21 - .../styles/bootstrap/mixins/_lists.scss | 7 - .../styles/bootstrap/mixins/_nav-divider.scss | 11 - .../styles/bootstrap/mixins/_pagination.scss | 22 - .../styles/bootstrap/mixins/_reset-text.scss | 17 - .../styles/bootstrap/mixins/_resize.scss | 6 - .../bootstrap/mixins/_screen-reader.scss | 34 - .../common/styles/bootstrap/mixins/_size.scss | 7 - .../styles/bootstrap/mixins/_table-row.scss | 39 - .../bootstrap/mixins/_text-emphasis.scss | 17 - .../styles/bootstrap/mixins/_text-hide.scss | 11 - .../bootstrap/mixins/_text-truncate.scss | 8 - .../styles/bootstrap/mixins/_transition.scss | 26 - .../styles/bootstrap/mixins/_visibility.scss | 8 - .../styles/bootstrap/utilities/_align.scss | 8 - .../bootstrap/utilities/_background.scss | 19 - .../styles/bootstrap/utilities/_borders.scss | 75 -- .../styles/bootstrap/utilities/_clearfix.scss | 9 - .../styles/bootstrap/utilities/_display.scss | 26 - .../styles/bootstrap/utilities/_embed.scss | 41 - .../styles/bootstrap/utilities/_flex.scss | 51 - .../styles/bootstrap/utilities/_float.scss | 11 - .../bootstrap/utilities/_interactions.scss | 5 - .../styles/bootstrap/utilities/_overflow.scss | 5 - .../styles/bootstrap/utilities/_position.scss | 32 - .../bootstrap/utilities/_screenreaders.scss | 11 - .../styles/bootstrap/utilities/_shadows.scss | 6 - .../styles/bootstrap/utilities/_sizing.scss | 20 - .../styles/bootstrap/utilities/_spacing.scss | 73 -- .../bootstrap/utilities/_stretched-link.scss | 19 - .../styles/bootstrap/utilities/_text.scss | 72 -- .../bootstrap/utilities/_visibility.scss | 13 - .../common/styles/bootstrap/vendor/_rfs.scss | 206 --- .../common/types/system-components/common.ts | 4 + .../websrc/app/common/utils/common.utils.ts | 2 +- .../app/core/systemPrepare/systemPrepare.scss | 9 +- .../app/core/translator/translator.service.ts | 22 +- .../custom-footer/custom-footer.component.ts | 2 + .../custom-header/custom-header.component.ts | 2 + .../app/frame/footer/footer.component.ts | 2 + .../websrc/app/frame/frame.component.ts | 2 + admin/webapp/websrc/app/frame/frame.module.ts | 9 +- .../app/frame/header/header.component.html | 6 +- .../app/frame/header/header.component.ts | 1 + .../header/navsearch/navsearch.component.ts | 2 + .../app/frame/sidebar/sidebar.component.ts | 2 + .../admission-rules-page.component.ts | 1 + ...mpliance-profile-assets-table.component.ts | 3 + .../edit-template-dialog.component.ts | 3 + .../templates-cell.component.ts | 3 + .../compliance-profile-assets.component.ts | 1 + .../action-cell/action-cell.component.ts | 1 + .../categories-cell.component.ts | 1 + ...iance-profile-templates-table.component.ts | 3 + .../edit-regulation-dialog.component.ts | 3 + .../regulations-cell.component.ts | 3 + .../compliance-profile-templates.component.ts | 1 + .../compliance-profile.component.ts | 3 + .../compliance-profile.service.ts | 64 +- .../compliance-charts.component.ts | 1 + .../compliance-item-details.component.ts | 3 + .../compliance-items-charts.component.ts | 1 + .../compliance-items-details.component.ts | 3 + ...mpliance-items-table-csv-cell.component.ts | 1 + ...mpliance-items-table-filter.component.html | 40 +- ...compliance-items-table-filter.component.ts | 3 + ...iance-items-table-impact-cell.component.ts | 3 + ...iance-items-table-status-cell.component.ts | 3 + .../compliance-items-table.component.ts | 3 + .../compliance-items.component.ts | 3 + .../routes/compliance/compliance.component.ts | 3 + .../routes/compliance/compliance.service.ts | 159 +-- .../admission-rules.component.ts | 3 + .../admission-rules/admission-rules.module.ts | 4 +- .../action-buttons.component.ts | 3 + ...d-edit-admission-rule-modal.component.html | 42 +- ...add-edit-admission-rule-modal.component.ts | 4 +- .../advance-setting-modal.component.ts | 3 + ...onfiguration-assessment-modal.component.ts | 3 + .../index-cell/index-cell.component.ts | 3 + .../matched-rule-list.component.ts | 3 + ...sment-result-printable-report.component.ts | 3 + .../criterion-description-icon.component.ts | 3 + .../export-admission-rules-modal.component.ts | 3 + .../import-test-file.component.ts | 3 + .../add-apikey-dialog.component.ts | 6 +- .../apikeys-grid-action-cell.component.ts | 1 + .../apikeys-grid-expiration-cell.component.ts | 1 + .../apikeys-grid-state-cell.component.ts | 3 + .../apikeys-grid/apikeys-grid.component.ts | 3 + .../application-protocols-panel.component.ts | 3 + ...pplication-conversation-chart.component.ts | 3 + .../application-volume-chart.component.ts | 3 + ...compliance-grid-category-cell.component.ts | 3 + .../compliance-grid-name-cell.component.ts | 3 + .../compliance-grid-status-cell.component.ts | 1 + .../compliance-grid.component.ts | 3 + .../remediation-detail-dialog.component.ts | 3 + ...liance-regulation-grid-dialog.component.ts | 1 + .../compliance-regulation-grid.component.ts | 1 + .../container-brief-dialog.component.ts | 1 + .../container-brief.component.ts | 3 + .../container-detail.component.ts | 3 + .../container-stats.component.ts | 1 + .../containers-grid-name-cell.component.ts | 3 + .../containers-grid-state-cell.component.ts | 1 + .../containers-grid-status-cell.component.ts | 3 + .../containers-grid.component.ts | 3 + .../controllers-grid-status-cell.component.ts | 3 + .../controllers-grid.component.ts | 3 + .../dlp-sensors/dlp-sensors.component.ts | 3 + .../add-edit-rule-modal.component.html | 12 +- .../add-edit-rule-modal.component.ts | 3 + .../add-edit-sensor-modal.component.html | 4 +- .../add-edit-sensor-modal.component.ts | 3 + .../pattern-action-buttons.component.ts | 1 + .../rule-action-buttons.component.ts | 3 + .../sensor-action-buttons.component.ts | 3 + .../enforcer-brief-dialog.component.ts | 1 + .../enforcer-brief.component.ts | 1 + .../enforcers-grid-status-cell.component.ts | 3 + .../enforcers-grid.component.ts | 3 + .../events-grid-filter.component.html | 28 +- .../events-grid-filter.component.ts | 3 + .../events-grid-level-cell.component.ts | 1 + .../events-grid-location-cell.component.ts | 3 + .../events-grid-message-cell.component.ts | 1 + .../events-grid-name-cell.component.ts | 3 + .../events-grid-user-cell.component.ts | 3 + .../events-grid/events-grid.component.ts | 3 + .../export-options-modal.component.ts | 1 + .../export-options.component.ts | 3 + ...-service-pod-grid-action-cell.component.ts | 3 + ...service-pod-grid-service-cell.component.ts | 3 + .../exposed-service-pod-grid.component.ts | 1 + ...osure-service-pod-report-grid.component.ts | 3 + .../conversation-entry-list.component.ts | 3 + .../exposed-servicepod-conv-grid.component.ts | 3 + ...rvicepod-grid-servicepod-cell.component.ts | 3 + .../external-host-cell.component.ts | 3 + .../exposure-grid/exposure-grid.component.ts | 3 + .../exposure-panel.component.ts | 3 + .../exposure-chart.component.ts | 3 + .../federated-config-form.component.ts | 1 + ...ederated-policy-configuration.component.ts | 4 +- .../file-access-rules.component.ts | 3 + .../file-access-rules.module.ts | 4 - ...edit-file-access-rule-modal.component.html | 10 +- ...d-edit-file-access-rule-modal.component.ts | 3 + .../operation-cell.component.ts | 1 + ...fined-file-access-rules-modal.component.ts | 1 + .../global-notifications.component.ts | 3 + .../group-details.component.html | 16 +- .../group-details/group-details.component.ts | 3 + .../custom-check-action-button.component.ts | 1 + .../custom-check/custom-check.component.html | 2 +- .../custom-check/custom-check.component.ts | 3 + ...roup-dlp-config-action-button.component.ts | 1 + .../group-dlp-config-modal.component.ts | 3 + .../partial/group-dlp/group-dlp.component.ts | 3 + ...roup-waf-config-action-button.component.ts | 1 + .../group-waf-config-modal.component.ts | 3 + .../partial/group-waf/group-waf.component.ts | 3 + .../partial/members/members.component.ts | 3 + .../components/groups/groups.component.ts | 3 + .../action-buttons.component.ts | 3 + .../add-edit-group-modal.component.html | 29 +- .../add-edit-group-modal.component.ts | 3 + .../group-network-rules.component.ts | 1 + .../group-response-rules.component.ts | 1 + .../monitor-metric-header.component.ts | 1 + .../monitor-metric-switch.component.ts | 3 + .../rule-detail-modal.component.ts | 3 + .../scorable-header.component.ts | 1 + .../switch-mode-modal.component.ts | 3 + ...ulti-cluster-grid-action-cell.component.ts | 2 + .../multi-cluster-grid.component.ts | 3 + .../namespaces-grid.component.ts | 3 + .../network-rules/network-rules.component.ts | 3 + .../network-rules/network-rules.module.ts | 1 - .../action-buttons.component.ts | 3 + ...add-edit-network-rule-modal.component.html | 17 +- .../add-edit-network-rule-modal.component.ts | 3 + .../from-to-cell/from-to-cell.component.ts | 1 + .../partial/id-cell/id-cell.component.ts | 3 + .../move-network-rules-modal.component.html | 2 +- .../move-network-rules-modal.component.ts | 3 + ...etwork-rules-printable-report.component.ts | 3 + .../network-rules-report-chart.component.ts | 1 + .../ports-cell/ports-cell.component.ts | 3 + .../ports-full-list-modal.component.ts | 1 + .../node-brief-dialog.component.ts | 1 + .../node-brief/node-brief.component.ts | 3 + .../nodes-grid-state-cell.component.ts | 1 + .../nodes-grid-status-cell.component.ts | 3 + .../nodes-grid/nodes-grid.component.ts | 3 + .../platforms-grid-status-cell.component.ts | 3 + .../platforms-grid.component.ts | 3 + .../pod-brief-dialog.component.ts | 1 + .../pod-brief/pod-brief.component.ts | 3 + .../policy-mode-caution.component.ts | 1 + .../policy-mode-chart.component.ts | 3 + .../policy-mode-panel.component.ts | 3 + .../process-grid-action-cell.component.ts | 1 + .../process-grid/process-grid.component.ts | 3 + ...-process-profile-rule-modal.component.html | 4 +- ...it-process-profile-rule-modal.component.ts | 1 + ...cess-profile-rule-name-header.component.ts | 3 + .../process-profile-rules.component.ts | 3 + .../process-profile-rules.module.ts | 1 - .../quick-filter/quick-filter.component.html | 2 +- .../quick-filter/quick-filter.component.ts | 3 + .../action-buttons.component.ts | 3 + ...dd-edit-response-rule-modal.component.html | 10 +- .../add-edit-response-rule-modal.component.ts | 3 + .../confirm-dialog-response-rule.component.ts | 3 + .../response-rules.component.ts | 3 + .../response-rules/response-rules.module.ts | 1 - .../risk-report-grid-filter.component.html | 24 +- .../risk-report-grid-filter.component.ts | 3 + .../risk-report-grid-level-cell.component.ts | 1 + ...isk-report-grid-location-cell.component.ts | 3 + ...risk-report-grid-message-cell.component.ts | 3 + .../risk-report-grid-name-cell.component.ts | 3 + .../risk-report-grid.component.ts | 3 + .../add-edit-role-dialog.component.html | 8 +- .../add-edit-role-dialog.component.ts | 1 + .../permission-checkbox.component.ts | 1 + .../roles-grid-action-cell.component.ts | 3 + .../roles-grid-permissions-cell.component.ts | 1 + .../roles-grid/roles-grid.component.ts | 7 +- .../scanners-grid/scanners-grid.component.ts | 3 + ...admission-control-status-view.component.ts | 1 + ...-improvement-completed-view.component.html | 28 +- ...re-improvement-completed-view.component.ts | 7 +- ...ore-improvement-exposure-view.component.ts | 3 + ...-improvement-general-header.component.html | 14 +- ...re-improvement-general-header.component.ts | 14 +- ...improvement-general-list-item.component.ts | 4 + .../score-improvement-general.component.ts | 1 + ...-privileged-containers-view.component.html | 2 +- ...as-privileged-containers-view.component.ts | 3 + ...run-as-root-containers-view.component.html | 2 +- ...t-run-as-root-containers-view.component.ts | 3 + ...improvement-service-risk-view.component.ts | 3 + .../score-prediction-header.component.html | 28 +- .../score-prediction-header.component.ts | 10 +- .../score-improvement-modal.component.ts | 3 + .../score-improvement-modal.module.ts | 4 +- .../security-events-chart.component.ts | 3 + .../security-events-panel.component.ts | 3 + .../risk-factor/risk-factor.component.ts | 3 + .../risk-instruction.component.ts | 3 + .../risk-score/risk-score.component.html | 14 +- .../risk-score/risk-score.component.ts | 14 +- .../score-instruction.component.ts | 3 + .../vulnerability-instruction.component.ts | 3 + .../security-risk-panel.component.ts | 3 + .../security-risk-panel.module.ts | 4 +- ...ew-report-assets-images-table.component.ts | 3 + ...iew-report-assets-nodes-table.component.ts | 3 + ...report-assets-platforms-table.component.ts | 3 + ...view-report-assets-pods-table.component.ts | 3 + ...ets-view-report-assets-tables.component.ts | 1 + .../assets-view-report.component.ts | 3 + ...view-report-appendix-packages.component.ts | 3 + .../risk-view-report-control-col.component.ts | 3 + ...k-view-report-description-col.component.ts | 1 + .../risk-view-report-impact-col.component.ts | 1 + ...isk-view-report-package-table.component.ts | 3 + ...risk-view-report-packages-col.component.ts | 3 + .../risk-view-report-table.component.ts | 3 + .../risks-view-report.component.ts | 3 + .../top-security-events-chart.component.ts | 3 + .../top-security-events-panel.component.ts | 3 + .../top-vulnerable-assets-chart.component.ts | 3 + .../top-vulnerable-assets-panel.component.ts | 3 + .../adjustable-div.component.ts | 3 + .../ag-grid-no-row-overlay.component.ts | 3 + .../confirm-dialog.component.ts | 3 + .../empty-data-chart-replacement.component.ts | 3 + .../safe-notification.component.ts | 1 + .../warning-notification.component.ts | 1 + .../ui/flag-ip-fqdn/flag-ip-fqdn.component.ts | 3 + .../import-file-modal.component.ts | 1 + .../ui/import-file/import-file.component.ts | 3 + .../ui/input-dialog/input-dialog.component.ts | 3 + .../loading-button.component.ts | 3 + .../loading-template.component.ts | 1 + .../multi-selector-dropdown.component.ts | 3 + .../panel-instruction-curtain.component.ts | 1 + .../risk-assets-legend.component.ts | 1 + .../add-edit-user-dialog.component.ts | 6 +- .../rancher-permissions-grid.component.ts | 1 + .../users-grid-action-cell.component.ts | 3 + .../users-grid-user-cell.component.html | 6 +- .../users-grid-user-cell.component.ts | 3 + .../users-grid-username-cell.component.ts | 3 + .../users-grid/users-grid.component.ts | 4 + .../users-grid/users-grid.module.ts | 2 +- ...rabilities-grid-severity-cell.component.ts | 1 + .../vulnerabilities-grid.component.ts | 1 + .../vulnerability-detail-dialog.component.ts | 3 + .../add-edit-rule-modal.component.html | 12 +- .../add-edit-rule-modal.component.ts | 3 + .../add-edit-sensor-modal.component.html | 4 +- .../add-edit-sensor-modal.component.ts | 3 + .../pattern-action-buttons.component.ts | 1 + .../rule-action-buttons.component.ts | 3 + .../sensor-action-buttons.component.ts | 3 + .../waf-sensors/waf-sensors.component.ts | 3 + .../container-details.component.html | 8 +- .../container-details.component.ts | 3 + ...ainers-printable-report-chart.component.ts | 1 + .../containers-printable-report.component.ts | 1 + .../routes/containers/containers.component.ts | 3 + .../dashboard-printable-report.component.ts | 3 + .../routes/dashboard/dashboard.component.ts | 3 + .../report-by-namespace-modal.component.ts | 1 + .../dlp-sensors-page.component.ts | 1 + .../app/routes/events/events.component.ts | 3 + .../fed-group-details.component.html | 14 +- .../fed-group-details.component.ts | 3 + .../federated-policy.component.ts | 3 + .../groups-page/groups-page.component.ts | 3 + .../joining-modal.component.html | 12 +- .../joining-modal/joining-modal.component.ts | 3 + .../multi-cluster-details.component.ts | 3 + .../multi-cluster/multi-cluster.component.ts | 3 + .../multi-cluster/multi-cluster.module.ts | 5 - .../promotion-modal.component.html | 6 +- .../promotion-modal.component.ts | 3 + .../token-modal/token-modal.component.ts | 1 + .../namespace-details.component.ts | 3 + .../domain-name-cell.component.ts | 3 + .../routes/namespaces/namespaces.component.ts | 3 + .../active-session.component.ts | 3 + .../advanced-filter.component.html | 20 +- .../advanced-filter.component.scss | 2 +- .../advanced-filter.component.ts | 3 + .../blacklist/blacklist.component.html | 30 +- .../blacklist/blacklist.component.scss | 2 +- .../blacklist/blacklist.component.ts | 3 + .../client-ip-cell.component.ts | 3 + .../edge-details/edge-details.component.ts | 3 + .../group-info/group-info.component.ts | 3 + .../host-info/host-info.component.ts | 1 + .../legend/legend.component.ts | 1 + .../namespace-info.component.ts | 1 + .../network-activities.component.html | 2 +- .../network-activities.component.ts | 3 + .../pod-info/pod-info.component.ts | 3 + .../server-ip-cell.component.ts | 3 + .../sniffer/sniffer.component.ts | 3 + .../network-rules-page.component.ts | 1 + .../node-detail/node-detail.component.ts | 3 + .../node-details/node-details.component.html | 8 +- .../node-details/node-details.component.ts | 3 + .../app/routes/nodes/nodes.component.ts | 3 + .../pages/login/alert/alert.component.ts | 1 + .../eula/agreement/agreement.component.ts | 3 + .../routes/pages/login/eula/eula.component.ts | 1 + .../app/routes/pages/login/login.component.ts | 3 + .../routes/pages/logout/logout.component.ts | 3 + .../platform-details.component.html | 2 +- .../platform-details.component.ts | 3 + .../routes/platforms/platforms.component.ts | 3 + .../regestries-communication.service.ts | 45 +- .../add-registry-dialog.component.ts | 3 + ...onnection-dialog-details-cell.component.ts | 3 + ...t-connection-dialog-type-cell.component.ts | 1 + .../test-settings-dialog.component.ts | 3 + .../registries-table-buttons.component.ts | 3 + .../registries-table.component.ts | 3 + .../registry-table-status-cell.component.ts | 3 + .../routes/registries/registries.component.ts | 3 + .../registry-details-dialog.component.html | 2 +- .../registry-details-dialog.component.ts | 1 + .../modules-charts.component.ts | 3 + .../module-vulnerabilities-cell.component.ts | 3 + .../modules-table/modules-table.component.ts | 1 + .../registry-modules.component.ts | 1 + .../status-cell/status-cell.component.ts | 1 + .../vulnerabilities-table.component.ts | 1 + .../layers-table-cves-cell.component.ts | 3 + .../layers-table/layers-table.component.ts | 1 + .../registry-vulnerabilities.component.ts | 3 + ...gistry-details-table-all-view.component.ts | 1 + ...try-details-table-status-cell.component.ts | 3 + .../registry-details-table.component.ts | 3 + ...-details-vulnerabilities-cell.component.ts | 1 + .../registry-details.component.html | 4 +- .../registry-details.component.ts | 3 + .../registry-overview.component.ts | 3 + .../response-rules-page.component.ts | 1 + ...ts-printable-report-bar-chart.component.ts | 1 + ...s-printable-report-detail-col.component.ts | 3 + ...printable-report-location-col.component.ts | 3 + ...ts-printable-report-pie-chart.component.ts | 1 + ...risk-reports-printable-report.component.ts | 1 + .../risk-reports/risk-reports.component.ts | 3 + .../advanced-filter-modal.component.html | 20 +- .../advanced-filter-modal.component.ts | 3 + .../date-slider/date-slider.component.ts | 1 + .../incident-details.component.ts | 3 + .../packet-modal/packet-modal.component.ts | 3 + .../review-network-rule-modal.component.ts | 3 + .../review-process-rule-modal.component.ts | 3 + .../security-event-chart.component.ts | 1 + ...s-printable-report-action-col.component.ts | 3 + ...events-printable-report-chart.component.ts | 1 + ...-printable-report-details-col.component.ts | 1 + ...printable-report-location-col.component.ts | 1 + ...printable-report-severity-col.component.ts | 3 + ...urity-events-printable-report.component.ts | 1 + .../threat-details.component.ts | 3 + .../violation-details.component.ts | 3 + .../security-events.component.html | 4 +- .../security-events.component.ts | 3 + .../group-domain-role-dialog.component.html | 4 +- .../group-domain-role-dialog.component.ts | 7 +- .../group-domain-role-table.component.html | 10 +- .../group-domain-role-table.component.ts | 7 +- .../group-domain-role.component.ts | 3 + .../password-panel.component.ts | 3 + .../reset-password-modal.component.ts | 1 + .../config-form/config-form.component.ts | 3 + .../configuration/configuration.component.ts | 5 +- .../csp-support-form.component.ts | 3 + .../export-form/export-form.component.ts | 3 + .../remote-repository-form.component.ts | 1 + .../support-form/support-form.component.ts | 3 + .../ldap/ldap-form/ldap-form.component.html | 17 +- .../ldap/ldap-form/ldap-form.component.ts | 3 + .../routes/settings/ldap/ldap.component.ts | 3 + .../test-connection-dialog.component.html | 12 +- .../test-connection-dialog.component.ts | 3 + .../license-info/license-info.component.html | 6 +- .../license-info/license-info.component.ts | 1 + .../license-renew/license-renew.component.ts | 3 + .../settings/license/license.component.ts | 3 + .../openid-form/openid-form.component.html | 25 +- .../openid-form/openid-form.component.ts | 3 + .../settings/openid/openid.component.ts | 3 + .../profile-form/profile-form.component.html | 8 +- .../profile-form/profile-form.component.ts | 3 + .../settings/profile/profile.component.ts | 3 + .../routes/settings/profile/profile.module.ts | 2 +- .../saml/saml-form/saml-form.component.html | 18 +- .../saml/saml-form/saml-form.component.ts | 3 + .../routes/settings/saml/saml.component.ts | 3 + .../app/routes/settings/settings.component.ts | 3 + .../password-profile.component.ts | 1 + .../routes/settings/users/users.component.ts | 35 +- ...t-signature-verifiers-modal.component.html | 10 +- ...dit-signature-verifiers-modal.component.ts | 3 + .../add-edit-verifiers-modal.component.html | 14 +- .../add-edit-verifiers-modal.component.ts | 3 + .../signature-action-buttons.component.ts | 1 + .../verifier-action-buttons.component.ts | 1 + .../signature-verifiers.component.ts | 5 +- .../app/routes/support/support.component.ts | 1 + .../controller-details.component.ts | 3 + .../enforcer-details.component.ts | 3 + .../scanner-details.component.ts | 3 + ...system-components-communication.service.ts | 26 +- .../system-components.component.ts | 3 + .../pdf-generation-dialog.component.html | 4 +- .../pdf-generation-dialog.component.ts | 3 + .../vulnerabilities.component.ts | 3 + .../vulnerabilities.service.ts | 4 +- .../vulnerability-charts.component.ts | 1 + .../vulnerability-items-charts.component.ts | 1 + .../vulnerability-items-details.component.ts | 3 + ...ility-items-table-action-cell.component.ts | 3 + ...rability-items-table-filter.component.html | 38 +- ...nerability-items-table-filter.component.ts | 3 + ...ility-items-table-impact-cell.component.ts | 3 + ...bility-items-table-score-cell.component.ts | 3 + ...ity-items-table-severtiy-cell.component.ts | 3 + .../vulnerability-items-table.component.html | 2 +- .../vulnerability-items-table.component.ts | 3 + .../vulnerability-items.component.ts | 3 + ...bility-profile-table-dialog.component.html | 28 +- ...rability-profile-table-dialog.component.ts | 3 + ...ility-profile-table-edit-cell.component.ts | 1 + ...y-profile-table-import-dialog.component.ts | 1 + .../vulnerability-profile-table.component.ts | 3 + .../vulnerability-profile.component.ts | 3 + .../vulnerability-profile.service.ts | 22 +- .../waf-sensors-page.component.ts | 1 + admin/webapp/websrc/material-theme.scss | 40 +- admin/webapp/websrc/styles.scss | 28 +- 607 files changed, 2021 insertions(+), 9050 deletions(-) delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_alert.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_badge.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_breadcrumb.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_button-group.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_buttons.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_card.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_carousel.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_close.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_code.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_custom-forms.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_dropdown.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_forms.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_functions.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_grid.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_images.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_input-group.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_jumbotron.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_list-group.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_media.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_mixins.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_modal.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_nav.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_navbar.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_pagination.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_popover.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_print.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_progress.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_reboot.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_root.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_spinners.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_tables.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_toasts.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_tooltip.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_transitions.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_type.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_utilities.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/_variables.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/bootstrap-grid.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/bootstrap-reboot.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/bootstrap.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_alert.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_background-variant.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_badge.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_border-radius.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_box-shadow.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_breakpoints.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_buttons.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_caret.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_clearfix.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_deprecate.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_float.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_forms.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_gradients.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_grid-framework.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_grid.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_hover.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_image.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_list-group.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_lists.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_nav-divider.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_pagination.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_reset-text.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_resize.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_screen-reader.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_size.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_table-row.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_text-emphasis.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_text-hide.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_text-truncate.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_transition.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/mixins/_visibility.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_align.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_background.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_borders.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_clearfix.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_display.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_embed.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_flex.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_float.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_interactions.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_overflow.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_position.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_screenreaders.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_shadows.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_sizing.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_spacing.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_stretched-link.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_text.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/utilities/_visibility.scss delete mode 100644 admin/webapp/websrc/app/common/styles/bootstrap/vendor/_rfs.scss diff --git a/admin/webapp/package.json b/admin/webapp/package.json index 5e02cd4cb..79f07ce82 100644 --- a/admin/webapp/package.json +++ b/admin/webapp/package.json @@ -15,21 +15,12 @@ "format": "prettier --write \"websrc/app/**/*.{ts,html,json}\"", "format:check": "prettier --config ./.prettierrc --list-different \"websrc/app/**/*.{ts,html,json}\"", "prebuild:watch": "npm run prebuild", - "build:watch": "ng lint --fix; ng build --watch --configuration development", + "build:watch": "ng build --watch --configuration development", "test": "ng test" }, "dependencies": { - "@angular-slider/ngx-slider": "^2.0.4", - "@angular/animations": "14.3.0", - "@angular/cdk": "14.2.7", - "@angular/common": "14.3.0", - "@angular/compiler": "14.3.0", - "@angular/core": "14.3.0", - "@angular/forms": "14.3.0", - "@angular/material": "14.2.7", - "@angular/platform-browser": "14.3.0", - "@angular/platform-browser-dynamic": "14.3.0", - "@angular/router": "14.3.0", + "@angular-slider/ngx-slider": "^20.0.0", + "@angular/material": "^20.2.14", "@antv/g6": "^4.8.9", "@circlon/angular-tree-component": "11.0.4", "@fortawesome/fontawesome-free": "5.15.4", @@ -40,18 +31,15 @@ "@fullcalendar/interaction": "4.4.2", "@fullcalendar/list": "4.4.2", "@fullcalendar/timegrid": "4.4.2", - "@ngx-formly/core": "^5.11.1", - "@ngx-formly/material": "^5.11.1", - "@ngx-translate/core": "11.0.1", + "@ngx-formly/core": "^7.0.1", + "@ngx-formly/material": "^7.0.1", + "@ngx-translate/core": "^17.0.0", "@ngx-translate/http-loader": "4.0.0", - "@typescript-eslint/eslint-plugin": "^5.19.0", - "@typescript-eslint/parser": "^5.19.0", "ag-grid-angular": "^31.3.4", "ag-grid-community": "^31.3.4", - "ang-jsoneditor": "^1.10.5", - "angular-gauge": "^4.0.0", + "ang-jsoneditor": "^4.0.2", "angular-imask": "6.6.3", - "angular-notifier": "^11.0.0", + "angular-notifier": "^14.0.0", "axe-core": "^4.4.1", "bootstrap": "5.3.3", "chart.js": "3.9.1", @@ -76,20 +64,21 @@ "lodash": "4.17.21", "moment": "2.30.1", "ng2-charts": "3.0.8", - "ng2-file-upload": "^1.4.0", - "ngx-avatar": "^4.1.0", - "ngx-bootstrap": "5.6.2", - "ngx-cookie-service": "13.1.2", + "ng2-file-upload": "^9.0.0", + "ngx-avatars": "^1.10.1", + "ngx-bootstrap": "^20.0.2", + "ngx-cookie-service": "^21.1.0", + "ngx-gauge": "^12.0.0", "ngx-infinite-scroll": "9.1.0", "ngx-select-ex": "4.0.0", - "ngx-toastr": "13.2.1", + "ngx-timeago": "^4.0.0", + "ngx-toastr": "^19.1.0", "ngx-webstorage-service": "^5.0.0", "pako": "^2.0.4", "popper.js": "1.16.1", "prettier": "^2.6.2", "prettier-eslint": "^13.0.0", "roboto-fontface": "0.10.0", - "rxjs": "6.6.7", "rxjs-compat": "6.6.7", "save-dev": "0.0.1-security", "screenfull": "3.3.3", @@ -101,19 +90,27 @@ "ts-helpers": "1.1.2", "tslib": "2.8.1", "uuid": "^8.3.2", - "web-animations-js": "2.3.2", - "zone.js": "0.11.4" + "web-animations-js": "2.3.2" }, "devDependencies": { - "@angular-builders/custom-webpack": "14.1.0", - "@angular-devkit/build-angular": "14.2.13", - "@angular-eslint/builder": "14.4.0", - "@angular-eslint/eslint-plugin": "14.4.0", - "@angular-eslint/eslint-plugin-template": "14.4.0", - "@angular-eslint/schematics": "14.4.0", - "@angular-eslint/template-parser": "14.4.0", - "@angular/cli": "14.2.13", - "@angular/compiler-cli": "14.3.0", + "@angular-builders/custom-webpack": "^20.0.0", + "@angular-devkit/build-angular": "^20.3.13", + "@angular-eslint/builder": "^20.7.0", + "@angular-eslint/eslint-plugin": "^20.7.0", + "@angular-eslint/eslint-plugin-template": "^20.7.0", + "@angular-eslint/schematics": "^20.7.0", + "@angular-eslint/template-parser": "^20.7.0", + "@angular/animations": "^20.3.15", + "@angular/cdk": "^20.2.14", + "@angular/cli": "^20.3.13", + "@angular/common": "^20.3.15", + "@angular/compiler": "^20.3.15", + "@angular/compiler-cli": "^20.3.15", + "@angular/core": "^20.3.15", + "@angular/forms": "^20.3.15", + "@angular/platform-browser": "^20.3.15", + "@angular/platform-browser-dynamic": "^20.3.15", + "@angular/router": "^20.3.15", "@types/codemirror": "0.0.109", "@types/file-saver": "^2.0.5", "@types/jasmine": "3.10.18", @@ -122,6 +119,11 @@ "@types/lodash": "4.14.118", "@types/node": "12.20.55", "@types/uuid": "^8.3.4", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "@typescript-eslint/utils": "^6.21.0", + "ajv": "^8.17.1", + "ajv-keywords": "^5.1.0", "brotli-webpack-plugin": "^1.1.0", "compression-webpack-plugin": "^10.0.0", "eslint": "^8.12.0", @@ -138,9 +140,14 @@ "karma-jasmine-html-reporter": "1.7.0", "karma-read-json": "1.1.0", "loaders.css": "0.1.2", + "rxjs": "^7.8.2", + "schema-utils": "^4.3.3", "ts-node": "8.10.2", "tslint": "6.1.3", - "typescript": "4.6.2" + "typescript": "5.8", + "webpack": "^5.103.0", + "webpack-dev-server": "^4.15.2", + "zone.js": "^0.13.3" }, "overrides": { "@angular/cli": { diff --git a/admin/webapp/websrc/app/app.component.ts b/admin/webapp/websrc/app/app.component.ts index aaa8aa07f..518746d87 100644 --- a/admin/webapp/websrc/app/app.component.ts +++ b/admin/webapp/websrc/app/app.component.ts @@ -23,7 +23,9 @@ import { Cluster, ClusterData } from '@common/types'; import { MapConstant } from '@common/constants/map.constant'; @Component({ + standalone: false, selector: 'app-root', + templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], }) diff --git a/admin/webapp/websrc/app/app.module.ts b/admin/webapp/websrc/app/app.module.ts index d39d3b92c..9d7874311 100644 --- a/admin/webapp/websrc/app/app.module.ts +++ b/admin/webapp/websrc/app/app.module.ts @@ -1,6 +1,5 @@ -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; // this is needed! import { NgModule, Inject } from '@angular/core'; -import { HttpClient, HttpClientModule } from '@angular/common/http'; +import { HttpClient, provideHttpClient } from '@angular/common/http'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; @@ -13,6 +12,9 @@ import { RoutesModule } from './routes/routes.module'; import { GlobalVariable } from '@common/variables/global.variable'; import { GlobalConstant } from '@common/constants/global.constant'; import { LOCAL_STORAGE, StorageService } from 'ngx-webstorage-service'; +import { BrowserModule } from '@angular/platform-browser'; +import { HTTP_INTERCEPTORS, withInterceptorsFromDi } from '@angular/common/http'; +import { AuthInterceptor } from '@core/interceptor/auth.interceptor'; export function createTranslateLoader(http: HttpClient) { return new TranslateHttpLoader(http, './assets/i18n/', '.json'); @@ -27,12 +29,11 @@ export function getWindow() { @NgModule({ declarations: [AppComponent], imports: [ - HttpClientModule, - BrowserAnimationsModule, CoreModule, FrameModule, NvCommonModule.forRoot(), RoutesModule, + BrowserModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, @@ -41,7 +42,17 @@ export function getWindow() { }, }), ], - providers: [{ provide: WindowWrapper, useFactory: getWindow }], + providers: [ + provideHttpClient( + withInterceptorsFromDi(), + ), + { provide: WindowWrapper, useFactory: getWindow }, + { + provide: HTTP_INTERCEPTORS, + useClass: AuthInterceptor, + multi: true, // This is mandatory + }, + ], bootstrap: [AppComponent], }) export class AppModule { diff --git a/admin/webapp/websrc/app/common/api/assets-http.service.ts b/admin/webapp/websrc/app/common/api/assets-http.service.ts index fd4cfc1e2..b7b8a44ba 100644 --- a/admin/webapp/websrc/app/common/api/assets-http.service.ts +++ b/admin/webapp/websrc/app/common/api/assets-http.service.ts @@ -19,7 +19,37 @@ import { import { PathConstant } from '@common/constants/path.constant'; import { PlatformsData } from '@common/types/compliance/platformsData'; import { Observable } from 'rxjs'; -import { pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; + +interface WorkloadResponse { + workloads: Workload[]; +} + +interface VulnerabilityReportResponse { + report: { + vulnerabilities: Vulnerability[]; + }; +} + +interface ProcessInfoResponse { + processes: ProcessInfo[]; +} + +interface ConfigResponse { + config: ScanConfig; +} + +interface ControllerResponse { + controllers: Controller[]; +} + +interface EnforcerResponse { + enforcers: Enforcer[]; +} + +interface ScannerResponse { + scanners: Scanner[]; +} @Injectable() export class AssetsHttpService { @@ -42,8 +72,8 @@ export class AssetsHttpService { getContainers(): Observable { return GlobalVariable.http - .get(PathConstant.CONTAINER_URL) - .pipe(pluck('workloads')); + .get(PathConstant.CONTAINER_URL) + .pipe(map(r => r.workloads)); } getScannedContainers(start: number, limit: number): Observable { @@ -72,10 +102,10 @@ export class AssetsHttpService { isShowingAccepted ? { id, show: 'accepted' } : { id } ) as any; return GlobalVariable.http - .get(PathConstant.SCAN_URL, { + .get(PathConstant.SCAN_URL, { params, }) - .pipe(pluck('report', 'vulnerabilities')); + .pipe(map(r => r.report.vulnerabilities)); } getHostReport( @@ -86,8 +116,8 @@ export class AssetsHttpService { isShowingAccepted ? { id, show: 'accepted' } : { id } ) as any; return GlobalVariable.http - .get(PathConstant.SCAN_HOST_URL, { params }) - .pipe(pluck('report', 'vulnerabilities')); + .get(PathConstant.SCAN_HOST_URL, { params }) + .pipe(map(r => r.report.vulnerabilities)); } getPlatformReport( @@ -98,36 +128,36 @@ export class AssetsHttpService { isShowingAccepted ? { platform, show: 'accepted' } : { platform } ) as any; return GlobalVariable.http - .get(PathConstant.SCAN_PLATFORM_URL, { params }) - .pipe(pluck('report', 'vulnerabilities')); + .get(PathConstant.SCAN_PLATFORM_URL, { params }) + .pipe(map(r => r.report.vulnerabilities)); } getNodeWorkloads(id: string): Observable { return GlobalVariable.http - .get(PathConstant.NODE_WORKLOADS_URL, { params: { id } }) - .pipe(pluck('workloads')); + .get(PathConstant.NODE_WORKLOADS_URL, { params: { id } }) + .pipe(map(r => r.workloads)); } getProcess(id: string): Observable { return GlobalVariable.http - .get(PathConstant.CONTAINER_PROCESS_URL, { + .get(PathConstant.CONTAINER_PROCESS_URL, { params: { id }, }) - .pipe(pluck('processes')); + .pipe(map(r => r.processes)); } getProcessHistory(id: string): Observable { return GlobalVariable.http - .get(PathConstant.CONTAINER_PROCESS_HISTORY_URL, { + .get(PathConstant.CONTAINER_PROCESS_HISTORY_URL, { params: { id }, }) - .pipe(pluck('processes')); + .pipe(map(r => r.processes)); } getScanConfig(): Observable { return GlobalVariable.http - .get(PathConstant.SCAN_CONFIG_URL) - .pipe(pluck('config')); + .get(PathConstant.SCAN_CONFIG_URL) + .pipe(map(r => r.config)); } postScanConfig(config: ScanConfig): Observable { @@ -189,8 +219,8 @@ export class AssetsHttpService { getControllers(): Observable { return GlobalVariable.http - .get(PathConstant.CONTROLLER_URL) - .pipe(pluck('controllers')); + .get(PathConstant.CONTROLLER_URL) + .pipe(map(r => r.controllers)); } getControllerStats(id: string): Observable { @@ -202,8 +232,8 @@ export class AssetsHttpService { getEnforcers(): Observable { return GlobalVariable.http - .get(PathConstant.ENFORCER_URL) - .pipe(pluck('enforcers')); + .get(PathConstant.ENFORCER_URL) + .pipe(map(r => r.enforcers)); } getEnforcerStats(id: string): Observable { @@ -214,7 +244,7 @@ export class AssetsHttpService { getScanners(): Observable { return GlobalVariable.http - .get(PathConstant.SCANNER_URL) - .pipe(pluck('scanners')); + .get(PathConstant.SCANNER_URL) + .pipe(map(r => r.scanners)); } } diff --git a/admin/webapp/websrc/app/common/api/auth-http.service.ts b/admin/webapp/websrc/app/common/api/auth-http.service.ts index 2c8f0fb63..61153f4ee 100644 --- a/admin/webapp/websrc/app/common/api/auth-http.service.ts +++ b/admin/webapp/websrc/app/common/api/auth-http.service.ts @@ -20,20 +20,50 @@ import { } from '@common/types'; import { GlobalVariable } from '@common/variables/global.variable'; import { Observable } from 'rxjs'; -import { map, pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; + + +interface SsoServerResponse { + redirect: SsoServer; +} + +interface LicenseResponse { + license: LicenseGetResponse; +} + +interface PublicPasswordProfileResponse { + pwd_profiles: PublicPasswordProfile; +} + +interface RoleResponse { + roles: Role[]; +} + +interface ApikeyResponse { + apikey: Apikey; +} + +interface ApikeyInitResponse { + apikey: ApikeyInit; +} + +interface PermissionOptionsResponse { + options: PermissionOptionResponse; +} + @Injectable() export class AuthHttpService { getSamlSLOServer(): Observable { return GlobalVariable.http - .get(PathConstant.SAML_SLO_URL) - .pipe(pluck('redirect')); + .get(PathConstant.SAML_SLO_URL) + .pipe(map(r => r.redirect)); } getLicense(): Observable { return GlobalVariable.http - .get(PathConstant.LICENSE_URL) - .pipe(pluck('license')); + .get(PathConstant.LICENSE_URL) + .pipe(map(r => r.license)); } postLicense(body: RenewLicensePostBody): Observable { @@ -89,8 +119,8 @@ export class AuthHttpService { getRoles(): Observable { return GlobalVariable.http - .get(PathConstant.ROLES) - .pipe(pluck('roles')); + .get(PathConstant.ROLES) + .pipe(map(r => r.roles)); } addRole(role: Role): Observable { @@ -117,18 +147,18 @@ export class AuthHttpService { getApikey(name: string): Observable { return GlobalVariable.http - .get(PathConstant.APIKEY_URL, { + .get(PathConstant.APIKEY_URL, { params: { name }, }) - .pipe(pluck('apikey')); + .pipe(map(r => r.apikey)); } postApikey(apikey: Apikey): Observable { return GlobalVariable.http - .post(PathConstant.APIKEY_URL, { + .post(PathConstant.APIKEY_URL, { apikey, }) - .pipe(pluck('apikey')); + .pipe(map(r => r.apikey)); } deleteApikey(name: string): Observable { @@ -161,8 +191,8 @@ export class AuthHttpService { getPermissionOptions(): Observable { return GlobalVariable.http - .get(PathConstant.PERMISSION_OPTIONS) - .pipe(pluck('options')); + .get(PathConstant.PERMISSION_OPTIONS) + .pipe(map(r => r.options)); } getPwdProfile(): Observable { @@ -183,8 +213,8 @@ export class AuthHttpService { getPublicPwdProfile(): Observable { return GlobalVariable.http - .get(PathConstant.PUBLIC_PASSWORD_PROFILE) - .pipe(pluck('pwd_profile')); + .get(PathConstant.PUBLIC_PASSWORD_PROFILE) + .pipe(map(r => r.pwd_profiles)); } patchPwdProfile(profile: PasswordProfile): Observable { diff --git a/admin/webapp/websrc/app/common/api/config-http.service.ts b/admin/webapp/websrc/app/common/api/config-http.service.ts index 37c1495ed..46ea5809a 100644 --- a/admin/webapp/websrc/app/common/api/config-http.service.ts +++ b/admin/webapp/websrc/app/common/api/config-http.service.ts @@ -12,7 +12,11 @@ import { } from '@common/types'; import { GlobalVariable } from '@common/variables/global.variable'; import { BehaviorSubject, Observable, throwError } from 'rxjs'; -import { pluck, catchError } from 'rxjs/operators'; +import { catchError, map } from 'rxjs/operators'; + +interface ConfigResponse { + config: ConfigV2Response; +} @Injectable() export class ConfigHttpService { @@ -29,8 +33,8 @@ export class ConfigHttpService { if (source) options = Object.assign(options, { params: { source: source } }); return GlobalVariable.http - .get(PathConstant.CONFIG_V2_URL, options) - .pipe(pluck('config')); + .get(PathConstant.CONFIG_V2_URL, options) + .pipe(map(r=> r.config)); } getFedConfig(): Observable { @@ -57,7 +61,6 @@ export class ConfigHttpService { const options = { params: { id: exportMode }, responseType: 'arraybuffer' as any, - cache: false, headers: { 'Cache-Control': 'no-store' }, }; return GlobalVariable.http @@ -138,7 +141,6 @@ export class ConfigHttpService { getCspSupport() { const options = { responseType: 'arraybuffer' as any, - cache: false, headers: { 'Cache-Control': 'no-store' }, observe: 'response' as any, }; diff --git a/admin/webapp/websrc/app/common/api/events-http.service.ts b/admin/webapp/websrc/app/common/api/events-http.service.ts index 71860d0b0..a66ab0e50 100644 --- a/admin/webapp/websrc/app/common/api/events-http.service.ts +++ b/admin/webapp/websrc/app/common/api/events-http.service.ts @@ -3,30 +3,38 @@ import { PathConstant } from '@common/constants/path.constant'; import { Audit, EventItem } from '@common/types'; import { GlobalVariable } from '@common/variables/global.variable'; import { Observable } from 'rxjs'; -import { pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; + +interface EventsResponse { + events: EventItem[]; +} + +interface AuditsResponse { + audits: Audit[]; +} @Injectable() export class EventsHttpService { getEvents(): Observable { return GlobalVariable.http - .get(PathConstant.EVENT_URL) - .pipe(pluck('events')); + .get(PathConstant.EVENT_URL) + .pipe(map(r => r.events)); } getEventsByLimit(start: number, limit: number): Observable { return GlobalVariable.http - .get(PathConstant.EVENT_URL, { + .get(PathConstant.EVENT_URL, { params: { start, limit, }, }) - .pipe(pluck('events')); + .pipe(map(r => r.events)); } getRiskReports(): Observable { return GlobalVariable.http - .get(PathConstant.AUDIT_URL) - .pipe(pluck('audits')); + .get(PathConstant.AUDIT_URL) + .pipe(map(r => r.audits)); } } diff --git a/admin/webapp/websrc/app/common/api/policy-http.service.ts b/admin/webapp/websrc/app/common/api/policy-http.service.ts index a394fde75..06f269afe 100644 --- a/admin/webapp/websrc/app/common/api/policy-http.service.ts +++ b/admin/webapp/websrc/app/common/api/policy-http.service.ts @@ -4,7 +4,32 @@ import { Group, NetworkRule, ResponseRule, Service } from '@common/types'; import { GlobalVariable } from '@common/variables/global.variable'; import { Observable } from 'rxjs'; import { GlobalConstant } from '@common/constants/global.constant'; -import { pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; + +interface GroupResponse { + group: Group; +} + +interface ServiceResponse { + services: Service[]; + service: Service; +} + +interface ConfigResponse { + config: any; +} + +interface DLPGroupResponse { + dlp_group: any; +} + +interface WAFGroupResponse { + waf_group: any; +} + +interface SensorsResponse { + sensors: any[]; +} @Injectable() export class PolicyHttpService { @@ -30,10 +55,10 @@ export class PolicyHttpService { getGroup(name: string): Observable { return GlobalVariable.http - .get(PathConstant.GROUP_URL, { + .get(PathConstant.GROUP_URL, { params: { name }, }) - .pipe(pluck('group')); + .pipe(map(r => r.group)); } postGroup(payload) { @@ -68,20 +93,20 @@ export class PolicyHttpService { getServices(params?: any): Observable { if (params) { return GlobalVariable.http - .get(PathConstant.SERVICE_URL, { + .get(PathConstant.SERVICE_URL, { params, }) - .pipe(pluck('services')); + .pipe(map(r => r.services)); } return GlobalVariable.http - .get(PathConstant.SERVICE_URL) - .pipe(pluck('services')); + .get(PathConstant.SERVICE_URL) + .pipe(map(r => r.services)); } getService(name: string): Observable { return GlobalVariable.http - .get(PathConstant.SERVICE_URL, { params: { name } }) - .pipe(pluck('service')); + .get(PathConstant.SERVICE_URL, { params: { name } }) + .pipe(map(r => r.service)); } patchService(payload, config?) { @@ -113,8 +138,8 @@ export class PolicyHttpService { getGroupScript(name: string) { return GlobalVariable.http - .get(PathConstant.GROUP_SCRIPT_URL, { params: { name } }) - .pipe(pluck('config')); + .get(PathConstant.GROUP_SCRIPT_URL, { params: { name } }) + .pipe(map(r => r.config)); } patchGroupScript(payload) { @@ -123,8 +148,8 @@ export class PolicyHttpService { getDLPGroups(name: string) { return GlobalVariable.http - .get(PathConstant.DLP_GROUPS_URL, { params: { name } }) - .pipe(pluck('dlp_group')); + .get(PathConstant.DLP_GROUPS_URL, { params: { name } }) + .pipe(map(r => r.dlp_group)); } patchDLPGroup(payload) { @@ -147,14 +172,14 @@ export class PolicyHttpService { }); } return GlobalVariable.http - .get(PathConstant.DLP_SENSORS_URL, ...options) - .pipe(pluck('sensors')); + .get(PathConstant.DLP_SENSORS_URL, ...options) + .pipe(map(r => r.sensors)); } getWAFGroups(name: string) { return GlobalVariable.http - .get(PathConstant.WAF_GROUPS_URL, { params: { name } }) - .pipe(pluck('waf_group')); + .get(PathConstant.WAF_GROUPS_URL, { params: { name } }) + .pipe(map(r => r.waf_group)); } patchWAFGroup(payload) { @@ -177,7 +202,7 @@ export class PolicyHttpService { }); } return GlobalVariable.http - .get(PathConstant.WAF_SENSORS_URL, ...options) - .pipe(pluck('sensors')); + .get(PathConstant.WAF_SENSORS_URL, ...options) + .pipe(map(r => r.sensors)); } } diff --git a/admin/webapp/websrc/app/common/directives/displayControl.directive.ts b/admin/webapp/websrc/app/common/directives/displayControl.directive.ts index a30a85ecd..f9f757d73 100644 --- a/admin/webapp/websrc/app/common/directives/displayControl.directive.ts +++ b/admin/webapp/websrc/app/common/directives/displayControl.directive.ts @@ -3,6 +3,7 @@ import { AuthUtilsService } from '@common/utils/auth.utils'; @Directive({ selector: '[appDisplayControl]', + standalone: false, }) export class DisplayControlDirective { constructor( diff --git a/admin/webapp/websrc/app/common/directives/maskInput.directive.ts b/admin/webapp/websrc/app/common/directives/maskInput.directive.ts index c79b245a9..48e89a9c0 100644 --- a/admin/webapp/websrc/app/common/directives/maskInput.directive.ts +++ b/admin/webapp/websrc/app/common/directives/maskInput.directive.ts @@ -9,6 +9,7 @@ import { ControlContainer } from '@angular/forms'; @Directive({ selector: '[appMaskInput]', + standalone: false, }) export class MaskInputDirective implements OnInit { @Input() maskOnBlur = false; diff --git a/admin/webapp/websrc/app/common/directives/observe/observe.directive.ts b/admin/webapp/websrc/app/common/directives/observe/observe.directive.ts index 3a48aec4f..6822a48ad 100644 --- a/admin/webapp/websrc/app/common/directives/observe/observe.directive.ts +++ b/admin/webapp/websrc/app/common/directives/observe/observe.directive.ts @@ -21,6 +21,7 @@ export class ErrorContext { @Directive({ selector: '[appObserve]', + standalone: false, }) export class ObserveDirective implements OnDestroy, OnInit { private errorRef!: TemplateRef; diff --git a/admin/webapp/websrc/app/common/directives/observe/observe.module.ts b/admin/webapp/websrc/app/common/directives/observe/observe.module.ts index 15b75d937..9c82aa9b8 100644 --- a/admin/webapp/websrc/app/common/directives/observe/observe.module.ts +++ b/admin/webapp/websrc/app/common/directives/observe/observe.module.ts @@ -2,7 +2,8 @@ import { NgModule } from '@angular/core'; import { ObserveDirective } from '@common/directives/observe/observe.directive'; @NgModule({ - declarations: [ObserveDirective], - exports: [ObserveDirective], + declarations: [ ObserveDirective ], + imports: [], + exports: [ ObserveDirective ], }) export class ObserveModule {} diff --git a/admin/webapp/websrc/app/common/directives/remote-grid-binding.directive.ts b/admin/webapp/websrc/app/common/directives/remote-grid-binding.directive.ts index 4940992ca..dc1a11246 100644 --- a/admin/webapp/websrc/app/common/directives/remote-grid-binding.directive.ts +++ b/admin/webapp/websrc/app/common/directives/remote-grid-binding.directive.ts @@ -12,6 +12,7 @@ import { catchError, tap } from 'rxjs/operators'; @Directive({ selector: '[remoteGridBinding]', + standalone: false, }) export class RemoteGridBindingDirective { @Input() remoteGridBinding!: RemoteGridApi; diff --git a/admin/webapp/websrc/app/common/directives/two-way-infinite-scroll.directive.ts b/admin/webapp/websrc/app/common/directives/two-way-infinite-scroll.directive.ts index 457e139a6..3f2b9d6e9 100644 --- a/admin/webapp/websrc/app/common/directives/two-way-infinite-scroll.directive.ts +++ b/admin/webapp/websrc/app/common/directives/two-way-infinite-scroll.directive.ts @@ -8,10 +8,11 @@ import { @Directive({ selector: '[appTwoWayInfiniteScroll]', + standalone: false, }) export class TwoWayInfiniteScrollDirective implements OnInit { @Input() ctx: any; - element: HTMLDivElement; + element!: HTMLDivElement; constructor(private elementRef: ElementRef) { console.log('appTwoWayInfiniteScroll is working...'); diff --git a/admin/webapp/websrc/app/common/neuvector-formly/button/button.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/button/button.component.ts index c959cd948..d2c7fb73b 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/button/button.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/button/button.component.ts @@ -2,7 +2,9 @@ import { Component } from '@angular/core'; import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; @Component({ + standalone: false, selector: 'app-button', + templateUrl: './button.component.html', styleUrls: ['./button.component.scss'], }) diff --git a/admin/webapp/websrc/app/common/neuvector-formly/card/card.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/card/card.component.ts index 614d48377..607228939 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/card/card.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/card/card.component.ts @@ -38,7 +38,9 @@ import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; * }; */ @Component({ + standalone: false, selector: 'app-card', + templateUrl: './card.component.html', styleUrls: ['./card.component.scss'], }) diff --git a/admin/webapp/websrc/app/common/neuvector-formly/checkbox/checkbox.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/checkbox/checkbox.component.ts index bc65ff92e..0a4d20e7e 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/checkbox/checkbox.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/checkbox/checkbox.component.ts @@ -2,7 +2,9 @@ import { Component, OnInit } from '@angular/core'; import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; @Component({ + standalone: false, selector: 'app-checkbox', + templateUrl: './checkbox.component.html', styleUrls: ['./checkbox.component.scss'], }) diff --git a/admin/webapp/websrc/app/common/neuvector-formly/chips-input/chips-input.component.html b/admin/webapp/websrc/app/common/neuvector-formly/chips-input/chips-input.component.html index f7cb6d7de..0bea2d76f 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/chips-input/chips-input.component.html +++ b/admin/webapp/websrc/app/common/neuvector-formly/chips-input/chips-input.component.html @@ -1,10 +1,10 @@ - - {{ field.templateOptions.label || '' | translate }} - + {{ field.templateOptions?.label ?? '' | translate }} + - @@ -12,24 +12,24 @@ - + - + [placeholder]="field.templateOptions?.placeholder ?? '' | translate" + [required]="field.templateOptions?.required" /> + - {{ field.templateOptions.hint | translate }} + {{ field.templateOptions?.hint ?? '' | translate }} - {{ field.templateOptions.hint || '' | translate }} + {{ field.templateOptions?.hint ?? '' | translate }} diff --git a/admin/webapp/websrc/app/common/neuvector-formly/chips-input/chips-input.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/chips-input/chips-input.component.ts index 8c83ce6d2..488d3ff52 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/chips-input/chips-input.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/chips-input/chips-input.component.ts @@ -7,7 +7,9 @@ import { InputDialogComponent } from '@components/ui/input-dialog/input-dialog.c import { TranslateService } from '@ngx-translate/core'; @Component({ + standalone: false, selector: 'app-chips-input', + templateUrl: './chips-input.component.html', styleUrls: ['./chips-input.component.scss'], }) diff --git a/admin/webapp/websrc/app/common/neuvector-formly/edit-table-controls/edit-table-controls.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/edit-table-controls/edit-table-controls.component.ts index 5e7e5bb10..33902134c 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/edit-table-controls/edit-table-controls.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/edit-table-controls/edit-table-controls.component.ts @@ -3,9 +3,11 @@ import { FormControl, FormGroup } from '@angular/forms'; import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; @Component({ + standalone: false, selector: 'app-edit-table-controls', templateUrl: './edit-table-controls.component.html', styleUrls: ['./edit-table-controls.component.scss'], + }) export class EditTableControlsComponent extends FieldType diff --git a/admin/webapp/websrc/app/common/neuvector-formly/edit-table/edit-table.component.html b/admin/webapp/websrc/app/common/neuvector-formly/edit-table/edit-table.component.html index 1ed0330ac..25cf8eddb 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/edit-table/edit-table.component.html +++ b/admin/webapp/websrc/app/common/neuvector-formly/edit-table/edit-table.component.html @@ -33,7 +33,7 @@ type="button" class="mt-3" (click)="add()" - [disabled]="field.templateOptions.disabled"> + [disabled]="field.templateOptions?.disabled"> add_circle - {{ field.templateOptions.addButtonText | translate }} + {{ field.templateOptions?.addButtonText | translate }} diff --git a/admin/webapp/websrc/app/common/neuvector-formly/edit-table/edit-table.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/edit-table/edit-table.component.ts index e80e6d9dd..b5326f92c 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/edit-table/edit-table.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/edit-table/edit-table.component.ts @@ -13,7 +13,9 @@ interface VisibleField { } @Component({ + standalone: false, selector: 'app-edit-table', + templateUrl: './edit-table.component.html', styleUrls: ['./edit-table.component.scss'], }) @@ -29,12 +31,17 @@ export class EditTableComponent } ngOnInit(): void { - this.field.templateOptions.remove = this.remove.bind(this); - this.field.templateOptions.add = this.add.bind(this); + if (!this.field.props) { + this.field.props = {}; + } + + this.field.props.remove = this.remove.bind(this); + this.field.props.add = this.add.bind(this); + this.dataSource.data = this.field.fieldGroup!; - this.visibleFields = this.getFields(this.field.fieldArray!); + const fieldArray = typeof this.field.fieldArray === 'function' ? this.field.fieldArray(this.field) : this.field.fieldArray!; + this.visibleFields = this.getFields(fieldArray); } - getFields(fa: FormlyFieldConfig): VisibleField[] { const ret: VisibleField[] = []; fa.fieldGroup?.forEach(ffg => { diff --git a/admin/webapp/websrc/app/common/neuvector-formly/edit-webhook-table-controls/edit-webhook-table-controls.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/edit-webhook-table-controls/edit-webhook-table-controls.component.ts index 92ed5d1fa..772c3428c 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/edit-webhook-table-controls/edit-webhook-table-controls.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/edit-webhook-table-controls/edit-webhook-table-controls.component.ts @@ -8,9 +8,11 @@ import { FederatedConfigurationService } from '@services/federated-configuration import { GlobalConstant } from '@common/constants/global.constant'; @Component({ + standalone: false, selector: 'app-edit-webhook-table-controls', templateUrl: './edit-webhook-table-controls.component.html', styleUrls: ['./edit-webhook-table-controls.component.scss'], + }) export class EditWebhookTableControlsComponent extends FieldType diff --git a/admin/webapp/websrc/app/common/neuvector-formly/formly-errors/formly-errors.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/formly-errors/formly-errors.component.ts index 7c2f54f1d..009295f78 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/formly-errors/formly-errors.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/formly-errors/formly-errors.component.ts @@ -3,7 +3,9 @@ import { FieldTypeConfig } from '@ngx-formly/core'; import { FormlyValidators } from '@common/neuvector-formly/neuvector-formly.module'; @Component({ + standalone: false, selector: 'app-formly-errors', + templateUrl: './formly-errors.component.html', styleUrls: ['./formly-errors.component.scss'], }) diff --git a/admin/webapp/websrc/app/common/neuvector-formly/hint-wrapper/hint-wrapper.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/hint-wrapper/hint-wrapper.component.ts index b13e927e7..eb9285d77 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/hint-wrapper/hint-wrapper.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/hint-wrapper/hint-wrapper.component.ts @@ -2,8 +2,10 @@ import { Component, OnInit } from '@angular/core'; import { FieldWrapper } from '@ngx-formly/core'; @Component({ + standalone: false, selector: 'app-hint-wrapper', templateUrl: './hint-wrapper.component.html', styleUrls: ['./hint-wrapper.component.scss'], + }) export class HintWrapperComponent extends FieldWrapper {} diff --git a/admin/webapp/websrc/app/common/neuvector-formly/icon-input/icon-input.component.html b/admin/webapp/websrc/app/common/neuvector-formly/icon-input/icon-input.component.html index 2cef20f57..b265c33b9 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/icon-input/icon-input.component.html +++ b/admin/webapp/websrc/app/common/neuvector-formly/icon-input/icon-input.component.html @@ -1,54 +1,53 @@
- {{ field.templateOptions.icon }} + {{ field.templateOptions?.icon }} - {{ field.templateOptions.label || '' | translate }} + {{ field.templateOptions?.label || '' | translate }} {{ field.templateOptions.prefix }}{{ field.templateOptions?.prefix ?? '' }} {{ field.templateOptions.hint || '' | translate }}{{ field.templateOptions?.hint ?? '' | translate }} - {{ field.templateOptions.hint | translate }} + {{ field.templateOptions?.hint ?? '' | translate }} diff --git a/admin/webapp/websrc/app/common/neuvector-formly/icon-input/icon-input.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/icon-input/icon-input.component.ts index aeb75e67f..754710e7f 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/icon-input/icon-input.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/icon-input/icon-input.component.ts @@ -2,9 +2,11 @@ import { Component } from '@angular/core'; import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; @Component({ + standalone: false, selector: 'app-icon-input', templateUrl: './icon-input.component.html', styleUrls: ['./icon-input.component.scss'], + }) export class IconInputComponent extends FieldType { passwordVisible = false; diff --git a/admin/webapp/websrc/app/common/neuvector-formly/multicheckbox/multicheckbox.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/multicheckbox/multicheckbox.component.ts index 588a08b66..5fb686450 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/multicheckbox/multicheckbox.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/multicheckbox/multicheckbox.component.ts @@ -4,9 +4,11 @@ import { FieldType } from '@ngx-formly/material/form-field'; import { MatCheckbox } from '@angular/material/checkbox'; @Component({ + standalone: false, selector: 'app-multicheckbox', templateUrl: './multicheckbox.component.html', styleUrls: ['./multicheckbox.component.scss'], + }) export class MulticheckboxComponent extends FieldType { @ViewChildren(MatCheckbox) checkboxes!: QueryList; diff --git a/admin/webapp/websrc/app/common/neuvector-formly/neuvector-formly.module.ts b/admin/webapp/websrc/app/common/neuvector-formly/neuvector-formly.module.ts index c04a5d7e5..1ab1ff26b 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/neuvector-formly.module.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/neuvector-formly.module.ts @@ -15,7 +15,7 @@ import { webhookUsernameValidator, } from '@common/neuvector-formly/formlyValidators'; -import { TranslateModule } from '@ngx-translate/core'; +import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { MatButtonModule } from '@angular/material/button'; import { ToggleComponent } from './toggle/toggle.component'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; @@ -54,6 +54,12 @@ import { PanelWrapperComponent } from './panel-wrapper/panel-wrapper.component'; import { MatExpansionModule } from '@angular/material/expansion'; import { CardComponent } from './card/card.component'; import { MatCardModule } from '@angular/material/card'; +import { HttpClient } from '@angular/common/http'; +import { TranslateHttpLoader } from '@ngx-translate/http-loader'; + +function createTranslateLoader(http: HttpClient) { + return new TranslateHttpLoader(http, './assets/i18n/', '.json'); +} export enum FormlyValidators { REQUIRED = 'required', @@ -100,11 +106,6 @@ export enum CardSeverity { declarations: [ IconInputComponent, ToggleComponent, - SliderComponent, - ChipsInputComponent, - MaskInputDirective, - FormlyErrorsComponent, - TextAreaComponent, SelectComponent, RadioComponent, SectionWrapperComponent, @@ -114,11 +115,16 @@ export enum CardSeverity { HintWrapperComponent, CheckboxComponent, ButtonComponent, + SliderComponent, NgxSliderComponent, MulticheckboxComponent, EditWebhookTableControlsComponent, PanelWrapperComponent, CardComponent, + ChipsInputComponent, + FormlyErrorsComponent, + TextAreaComponent, + MaskInputDirective, ], imports: [ FormlySelectModule, @@ -126,7 +132,13 @@ export enum CardSeverity { ReactiveFormsModule, MatChipsModule, MatInputModule, - TranslateModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: createTranslateLoader, + deps: [HttpClient], + }, + }), MatIconModule, MatSliderModule, MatButtonModule, diff --git a/admin/webapp/websrc/app/common/neuvector-formly/ngx-slider/ngx-slider.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/ngx-slider/ngx-slider.component.ts index 1928ef327..07a7eb5f1 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/ngx-slider/ngx-slider.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/ngx-slider/ngx-slider.component.ts @@ -4,9 +4,11 @@ import { Options } from '@angular-slider/ngx-slider'; import { TranslateService } from '@ngx-translate/core'; @Component({ + standalone: false, selector: 'app-ngx-slider', templateUrl: './ngx-slider.component.html', styleUrls: ['./ngx-slider.component.scss'], + }) export class NgxSliderComponent extends FieldType diff --git a/admin/webapp/websrc/app/common/neuvector-formly/panel-wrapper/panel-wrapper.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/panel-wrapper/panel-wrapper.component.ts index cec068e95..5ae978e4e 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/panel-wrapper/panel-wrapper.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/panel-wrapper/panel-wrapper.component.ts @@ -2,9 +2,11 @@ import { Component } from '@angular/core'; import { FieldWrapper } from '@ngx-formly/core'; @Component({ + standalone: false, selector: 'app-panel-wrapper', templateUrl: './panel-wrapper.component.html', styleUrls: ['./panel-wrapper.component.scss'], + }) export class PanelWrapperComponent extends FieldWrapper { panelOpenState = false; diff --git a/admin/webapp/websrc/app/common/neuvector-formly/radio/radio.component.html b/admin/webapp/websrc/app/common/neuvector-formly/radio/radio.component.html index b3173885e..dbb6e7aa1 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/radio/radio.component.html +++ b/admin/webapp/websrc/app/common/neuvector-formly/radio/radio.component.html @@ -3,8 +3,8 @@ [formlyAttributes]="field" aria-label="Select an option" class="d-flex"> -
diff --git a/admin/webapp/websrc/app/common/neuvector-formly/toggle/toggle.component.ts b/admin/webapp/websrc/app/common/neuvector-formly/toggle/toggle.component.ts index 96adb9d7f..1c890842e 100644 --- a/admin/webapp/websrc/app/common/neuvector-formly/toggle/toggle.component.ts +++ b/admin/webapp/websrc/app/common/neuvector-formly/toggle/toggle.component.ts @@ -3,9 +3,11 @@ import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; import { TranslateService } from '@ngx-translate/core'; @Component({ + standalone: false, selector: 'app-toggle', templateUrl: './toggle.component.html', styleUrls: ['./toggle.component.scss'], + }) export class ToggleComponent extends FieldType { constructor(private tr: TranslateService) { diff --git a/admin/webapp/websrc/app/common/nvCommon.module.ts b/admin/webapp/websrc/app/common/nvCommon.module.ts index a5dfc9643..95372cbd9 100644 --- a/admin/webapp/websrc/app/common/nvCommon.module.ts +++ b/admin/webapp/websrc/app/common/nvCommon.module.ts @@ -54,7 +54,6 @@ import { TimepickerModule } from 'ngx-bootstrap/timepicker'; import { TooltipModule } from 'ngx-bootstrap/tooltip'; import { PopoverModule } from 'ngx-bootstrap/popover'; import { TypeaheadModule } from 'ngx-bootstrap/typeahead'; -import { DatepickerModule } from 'ngx-bootstrap/datepicker'; import { CookieService } from 'ngx-cookie-service'; import { BsDatepickerModule } from 'ngx-bootstrap/datepicker'; import { ColorsService } from './colors/colors.service'; @@ -79,8 +78,7 @@ import { DashboardService } from '@services/dashboard.service'; import { SignaturesService } from '@services/signatures.service'; import { DisplayControlDirective } from '@common/directives/displayControl.directive'; - -import { TimeAgoPipe } from 'time-ago-pipe'; +import { TimeagoModule } from 'ngx-timeago'; import { BytesPipe } from '@common/pipes/app.pipes'; import { ShortenFromMiddlePipe } from '@common/pipes/app.pipes'; import { CapitalizePipe } from '@common/pipes/app.pipes'; @@ -122,7 +120,6 @@ import { RemoteGridBindingDirective } from './directives/remote-grid-binding.dir ButtonsModule.forRoot(), CarouselModule.forRoot(), CollapseModule.forRoot(), - DatepickerModule.forRoot(), BsDatepickerModule.forRoot(), BsDropdownModule.forRoot(), ModalModule.forRoot(), @@ -170,6 +167,7 @@ import { RemoteGridBindingDirective } from './directives/remote-grid-binding.dir MatStepperModule, MatBadgeModule, EnforcerBriefModule, + TimeagoModule.forRoot(), ], providers: [ PendingChangesGuard, @@ -215,7 +213,6 @@ import { RemoteGridBindingDirective } from './directives/remote-grid-binding.dir PolicyHttpService, RisksHttpService, SecurityEventsService, - TimeAgoPipe, GraphHttpService, SignaturesService, ], @@ -235,7 +232,6 @@ import { RemoteGridBindingDirective } from './directives/remote-grid-binding.dir ButtonsModule, CarouselModule, CollapseModule, - DatepickerModule, BsDatepickerModule, BsDropdownModule, ModalModule, @@ -288,7 +284,6 @@ import { RemoteGridBindingDirective } from './directives/remote-grid-binding.dir ], }) -// https://github.com/ocombe/ng2-translate/issues/209 export class NvCommonModule { static forRoot(): ModuleWithProviders { return { diff --git a/admin/webapp/websrc/app/common/pipes/app.pipes.ts b/admin/webapp/websrc/app/common/pipes/app.pipes.ts index 760d47246..4226b7c29 100644 --- a/admin/webapp/websrc/app/common/pipes/app.pipes.ts +++ b/admin/webapp/websrc/app/common/pipes/app.pipes.ts @@ -1,6 +1,9 @@ import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ name: 'shortenFromMiddle' }) +@Pipe({ + standalone: false, + name: 'shortenFromMiddle' +}) export class ShortenFromMiddlePipe implements PipeTransform { transform(str: string | undefined, len: number = 8): string { if (str && str.length > len) { @@ -13,7 +16,10 @@ export class ShortenFromMiddlePipe implements PipeTransform { } } -@Pipe({ name: 'capitalizeWord' }) +@Pipe({ + standalone: false, + name: 'capitalizeWord' +}) export class CapitalizePipe implements PipeTransform { transform(word: string | undefined): string { return !!word @@ -22,7 +28,10 @@ export class CapitalizePipe implements PipeTransform { } } -@Pipe({ name: 'capitalizeWords' }) +@Pipe({ + standalone: false, + name: 'capitalizeWords' +}) export class CapitalizeWordsPipe implements PipeTransform { transform(words: string | undefined): string { let capitalizePipe = new CapitalizePipe(); @@ -35,7 +44,10 @@ export class CapitalizeWordsPipe implements PipeTransform { } } -@Pipe({ name: 'bytes' }) +@Pipe({ + standalone: false, + name: 'bytes' +}) export class BytesPipe implements PipeTransform { transform( bytes: string, @@ -66,6 +78,7 @@ export class BytesPipe implements PipeTransform { * Finds an object from given source using the given key - value pairs */ @Pipe({ + standalone: false, name: 'findByKey', pure: false, }) diff --git a/admin/webapp/websrc/app/common/services/admission-rules.service.ts b/admin/webapp/websrc/app/common/services/admission-rules.service.ts index a8a14c9e7..de05eaf26 100644 --- a/admin/webapp/websrc/app/common/services/admission-rules.service.ts +++ b/admin/webapp/websrc/app/common/services/admission-rules.service.ts @@ -10,7 +10,7 @@ import { DomSanitizer } from '@angular/platform-browser'; import { BytesPipe } from '@common/pipes/app.pipes'; import { GridOptions, IsFullWidthRowParams } from 'ag-grid-community'; import { forkJoin, Observable } from 'rxjs'; -import { pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; import { capitalizeWord, parseDivideStyle } from '@common/utils/common.utils'; import { AbstractControl } from '@angular/forms'; import { @@ -31,6 +31,10 @@ export type AdmissionTestRow = AdmissionTestResult & { visible: boolean; }; +interface AdmissionResponse { + rules: Array; +} + @Injectable({ providedIn: 'root', }) @@ -616,13 +620,13 @@ export class AdmissionRulesService { .pipe(); let rules: Observable> = !!scope ? GlobalVariable.http - .get>(PathConstant.ADMISSION_URL, { + .get(PathConstant.ADMISSION_URL, { params: { scope: scope }, }) - .pipe(pluck('rules')) + .pipe(map(r => r.rules)) : GlobalVariable.http - .get>(PathConstant.ADMISSION_URL) - .pipe(pluck('rules')); + .get(PathConstant.ADMISSION_URL) + .pipe(map(r => r.rules)); let options = GlobalVariable.http .get(PathConstant.ADMCTL_CONDITION_OPTION_URL) .pipe(); diff --git a/admin/webapp/websrc/app/common/services/containers.service.ts b/admin/webapp/websrc/app/common/services/containers.service.ts index 080a13c29..4ae3be166 100644 --- a/admin/webapp/websrc/app/common/services/containers.service.ts +++ b/admin/webapp/websrc/app/common/services/containers.service.ts @@ -12,8 +12,8 @@ import { filterExitWorkloadsV2, workloadToV2, } from '@common/utils/common.utils'; -import { Observable, range } from 'rxjs'; -import { concatMap, delay, map, repeatWhen, takeWhile } from 'rxjs/operators'; +import { Observable, range, timer } from 'rxjs'; +import { concatMap, map, takeWhile, switchMap } from 'rxjs/operators'; export type WorkloadRow = WorkloadChildV2 & { parent_id?: string; @@ -84,9 +84,8 @@ export class ContainersService { } startContainerStats(id: string) { - return this.assetsHttpService.getContainerStats(id).pipe( - map(statsData => this.utils.parseContainerStats(statsData)), - repeatWhen(res => res.pipe(delay(5000))) + return timer(0, 5000).pipe( + switchMap(() => this.assetsHttpService.getContainerStats(id)) ); } diff --git a/admin/webapp/websrc/app/common/services/dlp-sensors.service.ts b/admin/webapp/websrc/app/common/services/dlp-sensors.service.ts index 1fa67897d..745444a44 100644 --- a/admin/webapp/websrc/app/common/services/dlp-sensors.service.ts +++ b/admin/webapp/websrc/app/common/services/dlp-sensors.service.ts @@ -7,11 +7,15 @@ import { MapConstant } from '@common/constants/map.constant'; import { TranslateService } from '@ngx-translate/core'; import { DomSanitizer } from '@angular/platform-browser'; import { UtilsService } from '@common/utils/app.utils'; -import { pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; import { SensorActionButtonsComponent } from '@components/dlp-sensors/partial/sensor-action-buttons/sensor-action-buttons.component'; import { RuleActionButtonsComponent } from '@components/dlp-sensors/partial/rule-action-buttons/rule-action-buttons.component'; import { PatternActionButtonsComponent } from '@components/dlp-sensors/partial/pattern-action-buttons/pattern-action-buttons.component'; +interface SensorsResponse { + sensors: any[]; +} + @Injectable({ providedIn: 'root', }) @@ -213,8 +217,8 @@ export class DlpSensorsService { }); } return GlobalVariable.http - .get(PathConstant.DLP_SENSORS_URL, ...options) - .pipe(pluck('sensors')); + .get(PathConstant.DLP_SENSORS_URL, ...options) + .pipe(map(r => r.sensors)); }; updateDlpSensorData = (payload, opType) => { diff --git a/admin/webapp/websrc/app/common/services/namespaces.service.ts b/admin/webapp/websrc/app/common/services/namespaces.service.ts index 639c6de76..c1aeed51e 100644 --- a/admin/webapp/websrc/app/common/services/namespaces.service.ts +++ b/admin/webapp/websrc/app/common/services/namespaces.service.ts @@ -2,7 +2,11 @@ import { Injectable } from '@angular/core'; import { AssetsHttpService } from '@common/api/assets-http.service'; import { Domain } from '@common/types'; import { Observable } from 'rxjs'; -import { map, pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; + +interface DomainsResponse { + domains: Domain[]; +} @Injectable() export class NamespacesService { @@ -22,8 +26,7 @@ export class NamespacesService { getNamespaces(): Observable { return this.assetsHttpService.getDomain().pipe( - pluck('domains'), - map(domains => domains.filter(d => d.name.charAt(0) !== '_')) + map((r: DomainsResponse) => r.domains.filter(d => d.name.charAt(0) !== '_')) ); } } diff --git a/admin/webapp/websrc/app/common/services/network-rules.service.ts b/admin/webapp/websrc/app/common/services/network-rules.service.ts index ac95ed5a2..9c53d914a 100644 --- a/admin/webapp/websrc/app/common/services/network-rules.service.ts +++ b/admin/webapp/websrc/app/common/services/network-rules.service.ts @@ -7,7 +7,7 @@ import { TranslateService } from '@ngx-translate/core'; import { DomSanitizer } from '@angular/platform-browser'; import { DatePipe } from '@angular/common'; import { forkJoin } from 'rxjs'; -import { pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; import { ActionButtonsComponent } from '@components/network-rules/partial/action-buttons/action-buttons.component'; import { FromToCellComponent } from '@components/network-rules/partial/from-to-cell/from-to-cell.component'; import { IdCellComponent } from '@components/network-rules/partial/id-cell/id-cell.component'; @@ -15,6 +15,20 @@ import { PortsCellComponent } from '@components/network-rules/partial/ports-cell import { NetworkRule } from '@common/types/network-rules/network-rules'; import * as pako from 'pako'; +interface GroupResponse { + groups: Array; +} + +interface HostResponse { + hosts: Array; +} + +interface ApplicationResponse { + list: { + application: Array; + }; +} + @Injectable({ providedIn: 'root', }) @@ -337,7 +351,7 @@ export class NetworkRulesService { getAutoCompleteData = source => { let groupReq = GlobalVariable.http - .get(PathConstant.GROUP_LIST_URL, { + .get(PathConstant.GROUP_LIST_URL, { params: { scope: source === GlobalConstant.NAV_SOURCE.FED_POLICY @@ -345,15 +359,15 @@ export class NetworkRulesService { : GlobalConstant.SCOPE.LOCAL, }, }) - .pipe(pluck('groups')); + .pipe(map(r => r.groups)); let hostReq = GlobalVariable.http - .get(PathConstant.NODES_URL) - .pipe(pluck('hosts')); + .get(PathConstant.NODES_URL) + .pipe(map(r => r.hosts)); let applicationReq = GlobalVariable.http - .get(PathConstant.POLICY_APP_URL) - .pipe(pluck('list', 'application')); + .get(PathConstant.POLICY_APP_URL) + .pipe(map(r => r.list.application)); return forkJoin([groupReq, hostReq, applicationReq]).pipe(); }; diff --git a/admin/webapp/websrc/app/common/services/nodes.service.ts b/admin/webapp/websrc/app/common/services/nodes.service.ts index 33d7b1f0d..1020f4c37 100644 --- a/admin/webapp/websrc/app/common/services/nodes.service.ts +++ b/admin/webapp/websrc/app/common/services/nodes.service.ts @@ -3,7 +3,7 @@ import { AssetsHttpService } from '@common/api/assets-http.service'; import { RisksHttpService } from '@common/api/risks-http.service'; import { Host } from '@common/types'; import { Observable } from 'rxjs'; -import { pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; @Injectable() export class NodesService { @@ -25,7 +25,7 @@ export class NodesService { } getNodes(): Observable { - return this.assetsHttpService.getNodeBrief().pipe(pluck('hosts')); + return this.assetsHttpService.getNodeBrief().pipe(map(r => r.hosts)); } getNodeContainers(id: string) { diff --git a/admin/webapp/websrc/app/common/services/platforms.service.ts b/admin/webapp/websrc/app/common/services/platforms.service.ts index 30a1e8782..ac4bcd1a3 100644 --- a/admin/webapp/websrc/app/common/services/platforms.service.ts +++ b/admin/webapp/websrc/app/common/services/platforms.service.ts @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; import { AssetsHttpService } from '@common/api/assets-http.service'; import { Platform } from '@common/types'; import { Observable } from 'rxjs'; -import { pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; @Injectable() export class PlatformsService { @@ -21,6 +21,6 @@ export class PlatformsService { } getPlatforms(): Observable { - return this.assetsHttpService.getPlatform().pipe(pluck('platforms')); + return this.assetsHttpService.getPlatform().pipe(map(r => r.platforms)); } } diff --git a/admin/webapp/websrc/app/common/services/security-events.service.ts b/admin/webapp/websrc/app/common/services/security-events.service.ts index 1c14f9273..76ce760da 100644 --- a/admin/webapp/websrc/app/common/services/security-events.service.ts +++ b/admin/webapp/websrc/app/common/services/security-events.service.ts @@ -9,11 +9,31 @@ import { TranslateService } from '@ngx-translate/core'; import { DomSanitizer } from '@angular/platform-browser'; import { AuthUtilsService } from '@common/utils/auth.utils'; import { DatePipe } from '@angular/common'; -import { TimeAgoPipe } from 'time-ago-pipe'; -import { pluck } from 'rxjs/operators'; +import { TimeagoFormatter } from 'ngx-timeago'; +import { map } from 'rxjs/operators'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { EnforcerBriefDialogComponent } from '@routes/components/enforcer-brief/enforcer-brief-dialog/enforcer-brief-dialog.component'; +interface HostResponse { + host: any; +} + +interface EnforcerResponse { + enforcer: any; +} + +interface ThreatResponse { + threat: any; +} + +interface ProcessProfileResponse { + process_profile: any; +} + +interface PolicyRuleResponse { + rule: any; +} + @Injectable() export class SecurityEventsService { private readonly $win; @@ -32,7 +52,7 @@ export class SecurityEventsService { private utils: UtilsService, private authUtilsService: AuthUtilsService, private datePipe: DatePipe, - private timeAgoPipe: TimeAgoPipe, + private timeAgoFormatter: TimeagoFormatter, private dialog: MatDialog ) { this.$win = $(GlobalVariable.window); @@ -141,8 +161,8 @@ export class SecurityEventsService { threat.reported_at, 'MMM dd, y HH:mm:ss' ); - displayedThreat.relativeDate = this.timeAgoPipe.transform( - displayedThreat.reportedAt + displayedThreat.relativeDate = this.timeAgoFormatter.format( + new Date(displayedThreat.reportedAt).getTime() ); displayedThreat.orgReportedAt = this.datePipe.transform( threat.reported_at, @@ -243,8 +263,8 @@ export class SecurityEventsService { violation.reported_at, 'MMM dd, y HH:mm:ss' ); - displayedViolation.relativeDate = this.timeAgoPipe.transform( - displayedViolation.reportedAt + displayedViolation.relativeDate = this.timeAgoFormatter.format( + new Date(displayedViolation.reportedAt).getTime() ); displayedViolation.orgReportedAt = this.datePipe.transform( violation.reported_at, @@ -404,8 +424,8 @@ export class SecurityEventsService { incident.reported_at, 'MMM dd, y HH:mm:ss' ); - displayedIncident.relativeDate = this.timeAgoPipe.transform( - displayedIncident.reportedAt + displayedIncident.relativeDate = this.timeAgoFormatter.format( + new Date(displayedIncident.reportedAt).getTime() ); displayedIncident.orgReportedAt = this.datePipe.transform( incident.reported_at, @@ -455,18 +475,18 @@ export class SecurityEventsService { getHost = id => { return GlobalVariable.http - .get(PathConstant.NODES_URL, { + .get(PathConstant.NODES_URL, { params: { id: id }, }) - .pipe(pluck('host')); + .pipe(map(r => r.host)); }; getEnforcer = id => { return GlobalVariable.http - .get(PathConstant.SINGLE_ENFORCER, { + .get(PathConstant.SINGLE_ENFORCER, { params: { id: id }, }) - .pipe(pluck('enforcer')); + .pipe(map(r => r.enforcer)); }; getProcess = id => { @@ -481,14 +501,14 @@ export class SecurityEventsService { getPacketData = (id: string) => { return GlobalVariable.http - .get(PathConstant.THREAT_URL, { params: { id: id } }) - .pipe(pluck('threat')); + .get(PathConstant.THREAT_URL, { params: { id: id } }) + .pipe(map(r => r.threat)); }; getProcessRule = (name: string) => { return GlobalVariable.http - .get(PathConstant.PROCESS_PROFILE_URL, { params: { name: name } }) - .pipe(pluck('process_profile')); + .get(PathConstant.PROCESS_PROFILE_URL, { params: { name: name } }) + .pipe(map(r => r.process_profile)); }; updateProcessRule = (payload: any) => { @@ -499,8 +519,8 @@ export class SecurityEventsService { getNetworkRule = (ruleId: number) => { return GlobalVariable.http - .get(PathConstant.POLICY_RULE_URL, { params: { id: ruleId } }) - .pipe(pluck('rule')); + .get(PathConstant.POLICY_RULE_URL, { params: { id: ruleId } }) + .pipe(map(r => r.rule)); }; updateNetworkRule = (networkRule: any) => { diff --git a/admin/webapp/websrc/app/common/services/waf-sensors.service.ts b/admin/webapp/websrc/app/common/services/waf-sensors.service.ts index f2a4a7a0d..dc3813444 100644 --- a/admin/webapp/websrc/app/common/services/waf-sensors.service.ts +++ b/admin/webapp/websrc/app/common/services/waf-sensors.service.ts @@ -7,11 +7,15 @@ import { MapConstant } from '@common/constants/map.constant'; import { TranslateService } from '@ngx-translate/core'; import { DomSanitizer } from '@angular/platform-browser'; import { UtilsService } from '@common/utils/app.utils'; -import { pluck } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; import { SensorActionButtonsComponent } from '@components/waf-sensors/partial/sensor-action-buttons/sensor-action-buttons.component'; import { RuleActionButtonsComponent } from '@components/waf-sensors/partial/rule-action-buttons/rule-action-buttons.component'; import { PatternActionButtonsComponent } from '@components/waf-sensors/partial/pattern-action-buttons/pattern-action-buttons.component'; +interface sensorsResponse { + sensors: any[]; +} + @Injectable({ providedIn: 'root', }) @@ -213,8 +217,8 @@ export class WafSensorsService { }); } return GlobalVariable.http - .get(PathConstant.WAF_SENSORS_URL, ...options) - .pipe(pluck('sensors')); + .get(PathConstant.WAF_SENSORS_URL, ...options) + .pipe(map(r => r.sensors)); }; updateWafSensorData = (payload, opType) => { diff --git a/admin/webapp/websrc/app/common/styles/app.scss b/admin/webapp/websrc/app/common/styles/app.scss index e2784ada6..893bc846e 100644 --- a/admin/webapp/websrc/app/common/styles/app.scss +++ b/admin/webapp/websrc/app/common/styles/app.scss @@ -13,6 +13,13 @@ @import 'googleapis/roboto_mono'; +// eos-ds +@import "eos-ds/scss/index"; +@import "eos-ds/css/eos-style"; +// eos-icon +@import "eos-icon/css/eos-icons"; + + // Variables @import 'app/variables'; // Globals diff --git a/admin/webapp/websrc/app/common/styles/app/common.scss b/admin/webapp/websrc/app/common/styles/app/common.scss index f77c0aaf0..5df6715a1 100644 --- a/admin/webapp/websrc/app/common/styles/app/common.scss +++ b/admin/webapp/websrc/app/common/styles/app/common.scss @@ -750,12 +750,12 @@ hr.solid { min-width: 125px; } -mwl-gauge.score { +ngx-gauge.score { } -mwl-gauge.score > .gauge > .dial { +ngx-gauge.score > .gauge > .dial { stroke-width: 10; } -mwl-gauge.score > .gauge > .value { +ngx-gauge.score > .gauge > .value { stroke-width: 5; } diff --git a/admin/webapp/websrc/app/common/styles/bootstrap.scss b/admin/webapp/websrc/app/common/styles/bootstrap.scss deleted file mode 100644 index 5b137352c..000000000 --- a/admin/webapp/websrc/app/common/styles/bootstrap.scss +++ /dev/null @@ -1,13 +0,0 @@ -// -// This file compiles to a custom bootstrap stylesheet for NeuVector -// - -// Override bootstrap variables -@import "app/variables"; -// Bootstrap -@import "bootstrap/bootstrap"; -// eos-ds -@import "eos-ds/scss/index"; -@import "eos-ds/css/eos-style"; -// eos-icon -@import "eos-icon/css/eos-icons"; diff --git a/admin/webapp/websrc/app/common/styles/bootstrap/_alert.scss b/admin/webapp/websrc/app/common/styles/bootstrap/_alert.scss deleted file mode 100644 index 8451abef7..000000000 --- a/admin/webapp/websrc/app/common/styles/bootstrap/_alert.scss +++ /dev/null @@ -1,52 +0,0 @@ -// -// Base styles -// - -.alert { - position: relative; - padding: $alert-padding-y $alert-padding-x; - margin-bottom: $alert-margin-bottom; - border: $alert-border-width solid transparent; - @include border-radius($alert-border-radius); -} - -// Headings for larger alerts -.alert-heading { - // Specified to prevent conflicts of changing $headings-color - color: inherit; -} - -// Provide class for links that match alerts -.alert-link { - font-weight: $alert-link-font-weight; -} - - -// Dismissible alerts -// -// Expand the right padding and account for the close button's positioning. - -.alert-dismissible { - padding-right: $close-font-size + $alert-padding-x * 2; - - // Adjust close link position - .close { - position: absolute; - top: 0; - right: 0; - z-index: 2; - padding: $alert-padding-y $alert-padding-x; - color: inherit; - } -} - - -// Alternate styles -// -// Generate contextual modifier classes for colorizing the alert. - -@each $color, $value in $theme-colors { - .alert-#{$color} { - @include alert-variant(theme-color-level($color, $alert-bg-level), theme-color-level($color, $alert-border-level), theme-color-level($color, $alert-color-level)); - } -} diff --git a/admin/webapp/websrc/app/common/styles/bootstrap/_badge.scss b/admin/webapp/websrc/app/common/styles/bootstrap/_badge.scss deleted file mode 100644 index 23a35e3ba..000000000 --- a/admin/webapp/websrc/app/common/styles/bootstrap/_badge.scss +++ /dev/null @@ -1,77 +0,0 @@ -// Base class -// -// Requires one of the contextual, color modifier classes for `color` and -// `background-color`. - -.badge { - display: inline-block; - padding: $badge-padding-y $badge-padding-x; - @include font-size($badge-font-size); - font-weight: $badge-font-weight; - line-height: 1; - text-align: center; - white-space: nowrap; - vertical-align: baseline; - @include border-radius($badge-border-radius); - @include transition($badge-transition); - - @at-root a#{&} { - @include hover-focus() { - text-decoration: none; - } - } - - // Empty badges collapse automatically - &:empty { - display: none; - } -} - -// Sizing fix for badge in AG Grid cell renderer -.ag-badge { - margin-left: 0 !important; // needed for conflicting .badge rules in eos-style.css & badges.component.scss -} - -.ag-badge-60 { - width: 60px; -} - -.ag-badge-80 { - width: 80px; -} - -.ag-full { - width: 100%; -} - -// Quick fix for badges in buttons -.btn .badge { - position: relative; - top: -1px; -} - -// Pill badges -// -// Make them extra rounded with a modifier to replace v3's badges. - -.badge-pill { - padding-right: $badge-pill-padding-x; - padding-left: $badge-pill-padding-x; - @include border-radius($badge-pill-border-radius); -} - -// Colors -// -// Contextual variations (linked badges get darker on :hover). - -@each $color, $value in $theme-colors { - .badge-#{$color} { - @include badge-variant($value); - } -} - -@each $color, $value in $nv-colors { - .badge-#{$color} { - @include badge-variant($value); - } -} diff --git a/admin/webapp/websrc/app/common/styles/bootstrap/_breadcrumb.scss b/admin/webapp/websrc/app/common/styles/bootstrap/_breadcrumb.scss deleted file mode 100644 index 9bb9c9b77..000000000 --- a/admin/webapp/websrc/app/common/styles/bootstrap/_breadcrumb.scss +++ /dev/null @@ -1,42 +0,0 @@ -.breadcrumb { - display: flex; - flex-wrap: wrap; - padding: $breadcrumb-padding-y $breadcrumb-padding-x; - margin-bottom: $breadcrumb-margin-bottom; - @include font-size($breadcrumb-font-size); - list-style: none; - background-color: $breadcrumb-bg; - @include border-radius($breadcrumb-border-radius); -} - -.breadcrumb-item { - // The separator between breadcrumbs (by default, a forward-slash: "/") - + .breadcrumb-item { - padding-left: $breadcrumb-item-padding; - - &::before { - float: left; // Suppress inline spacings and underlining of the separator - padding-right: $breadcrumb-item-padding; - color: $breadcrumb-divider-color; - content: escape-svg($breadcrumb-divider); - } - } - - // IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built - // without `