X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=skyquake%2Fplugins%2Flaunchpad%2Fsrc%2FrecordViewer%2FrecordCard.jsx;h=449177634bdb398b367746816e34561ea528e439;hb=4942bd7d5bb83c05b66c0876d2e020041b4c1b63;hp=2b572e932d6aff972d83f731567c1ff630094433;hpb=ad321ed2e73c48cd35812dfd4c64d54e84704e30;p=osm%2FUI.git
diff --git a/skyquake/plugins/launchpad/src/recordViewer/recordCard.jsx b/skyquake/plugins/launchpad/src/recordViewer/recordCard.jsx
index 2b572e932..449177634 100644
--- a/skyquake/plugins/launchpad/src/recordViewer/recordCard.jsx
+++ b/skyquake/plugins/launchpad/src/recordViewer/recordCard.jsx
@@ -33,6 +33,10 @@ import JobListCard from '../launchpad_card/jobListCard.jsx';
import NSVirtualLinks from '../virtual_links/nsVirtualLinks.jsx';
import LaunchpadFleetStore from '../launchpadFleetStore.js';
+import Prism from 'prismjs';
+import 'prismjs/themes/prism.css';
+
+
export default class RecordCard extends React.Component {
constructor(props) {
super(props)
@@ -66,7 +70,8 @@ export default class RecordCard extends React.Component {
let displayNSVirtualLinks = false;
let nsVirtualLinksProps = {};
let nsVirtualLinksComponent = null;
-
+ let displayVolumesTab = false;
+ let volumesHTML = [];
let tabList = [];
let tabPanels = [];
@@ -90,16 +95,18 @@ export default class RecordCard extends React.Component {
{
//Sort for recent on top
- this.props.jobData.sort(function(a,b){
+ this.props.jobData
+ .sort(function(a,b){
return parseInt(b['job-id']) - parseInt(a['job-id']);
- }).map(function(job){
+ })
+ .map(function(job){
//Return only vnfr configs
if(job["triggered-by"] == 'vnf-primitive') {
return job.vnfr.map(function(v){
//That match the currently selected job id
if(v.id == cardData.id) {
return v.primitive.map(function(p, i) {
- return
+ return
})
}
})
@@ -125,6 +132,41 @@ export default class RecordCard extends React.Component {
)
notice =
* If a separate browser window does not open, please check if the popup was blocked and allow it.
+ if(vdur.hasOwnProperty('volumes') && (vdur.volumes.length > 0)) {
+ displayVolumesTab = true;
+ vdur.volumes.map((volume, vi) => {
+ // let html = Prism.highlight(JSON.stringify(volume), Prism.languages.javascript, 'javascript');
+ // volumesHTML.push(
+ //
+ //
+ //
+ function buildProperties(obj) {
+ let p = [];
+ _.forEach(obj, function(v, k) {
+ p.push(
+
+
{k}
+
{v.constructor.name != 'Object' ? v : buildProperties(v)}
+
+ )
+ });
+ return p;
+ }
+ volumesHTML.push(
+
+
+ VOLUME
+
+
+ {
+ buildProperties(volume)
+ }
+
+
+ )
+ })
+ }
});
consoleUrlsComponent = (
@@ -157,16 +199,16 @@ export default class RecordCard extends React.Component {
{sortedJobs.map(function(job, i){
if(job["triggered-by"] == 'ns-primitive') {
- return
+ return
}
})
.concat(sortedJobs.map(function(job) {
if(!job.hasOwnProperty('job-name') && (job["triggered-by"] == 'ns-primitive')) {
- return job.vnfr.map(function(v){
+ return job.vnfr.map(function(v, h){
//That match the currently selected job id
if(v.id == cardData.id) {
return v.primitive.map(function(p, i) {
- return
+ return
})
}
})
@@ -341,6 +383,21 @@ export default class RecordCard extends React.Component {
)
}
+ if (displayVolumesTab) {
+
+ tabList.push(
+
Volumes
+ );
+
+ tabPanels.push(
+
+ {volumesHTML}
+
+
+
+ )
+ }
+
html = (