X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2FnsListPanel%2FnsListPanel.jsx;h=8a1334d67ff126b338bd39c10d67a461bcd429be;hb=refs%2Ftags%2Fv3.0.0rc2;hp=c8c8412395ad9fa78985519fba7f62be94237abf;hpb=e29efc315df33d546237e270470916e26df391d6;p=osm%2FUI.git diff --git a/skyquake/plugins/launchpad/src/nsListPanel/nsListPanel.jsx b/skyquake/plugins/launchpad/src/nsListPanel/nsListPanel.jsx index c8c841239..8a1334d67 100644 --- a/skyquake/plugins/launchpad/src/nsListPanel/nsListPanel.jsx +++ b/skyquake/plugins/launchpad/src/nsListPanel/nsListPanel.jsx @@ -6,7 +6,9 @@ import DashboardCard from 'widgets/dashboard_card/dashboard_card.jsx'; import LaunchpadFleetActions from'../launchpadFleetActions'; import LaunchpadFleetStore from '../launchpadFleetStore'; import UpTime from 'widgets/uptime/uptime.jsx'; - +import {SkyquakeRBAC, isRBACValid} from 'widgets/skyquake_rbac/skyquakeRBAC.jsx'; +import ROLES from 'utils/roleConstants.js'; +const PROJECT_ROLES = ROLES.PROJECT; /* * TODO: Handle when page is loading. See recordView for ref */ @@ -326,11 +328,48 @@ export default class NsListPanel extends React.Component { const {nsrs, openedNsrIDs, emptyRows, isVisible, ...props} = this.props; const fieldKeys = FIELD_KEYS; let glyphValue = (isVisible) ? "chevron-left" : "chevron-right"; + + let totalNSRs = nsrs && nsrs.length; + let runningNSRs = 0; + let failedNSRs = 0; + let scalingOutNSRs = 0; + let scalingInNSRs = 0; + let initializingNSRs = 0; + + nsrs && nsrs.map((nsr) => { + nsr['operational-status'] == 'running' && runningNSRs++; + nsr['operational-status'] == 'failed' && failedNSRs++; + nsr['operational-status'] == 'scaling-out' && scalingOutNSRs++; + nsr['operational-status'] == 'scaling-in' && scalingInNSRs++; + ( + nsr['operational-status'] == 'init' || + nsr['operational-status'] == 'vl-init-phase' || + nsr['operational-status'] == 'vnf-init-phase' + ) && initializingNSRs++; + }); + + if (isVisible) { + + let title = ( +
+ NETWORK SERVICES +
+ Total: {totalNSRs} + Running: {runningNSRs} + Failed: {failedNSRs} + Scaling Out: {scalingOutNSRs} + Scaling In: {scalingInNSRs} + Initializing: {initializingNSRs} +
+
+ ); + + return ( - {this.panelToolbar()} + title={title}> + {isRBACValid(this.context.userProfile, [PROJECT_ROLES.LCM_ADMIN, PROJECT_ROLES.PROJECT_ADMIN]) ? this.panelToolbar() : null}