2 * Copyright 2016-2017 ZTE Corporation.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
16 var tmDetailUtil = {};
\r
17 tmDetailUtil.timer = null;
\r
19 tmDetailUtil.nameRender = function(obj) {
\r
20 return '<a href="#" onclick="vm.nodesDetail.$showDetails('
\r
21 + '\'block\',\'' + obj.aData.id + '\', \'' + obj.aData.name + '\',\'' + vm.nodesTab.nodesList.tempId + '\')">' + obj.aData.name + '</a>';
\r
24 tmDetailUtil.inputsRender = function(obj) {
\r
25 var inputs = obj.aData.inputs;
\r
27 //if(inputs && inputs.length) {
\r
28 // var optionHtml = "";
\r
29 // for(var i=0;i<inputs.length;i++) {
\r
30 // optionHtml += '<option>' + inputs[i].name + '</option>';
\r
32 // result = '<select>' + optionHtml + '</select>';
\r
34 result = JSON.stringify(inputs);
\r
38 tmDetailUtil.outputsRender = function(obj) {
\r
39 var outputs = obj.aData.outputs;
\r
41 //if(inputs && inputs.length) {
\r
42 // var optionHtml = "";
\r
43 // for(var i=0;i<inputs.length;i++) {
\r
44 // optionHtml += '<option>' + inputs[i].name + '</option>';
\r
46 // result = '<select>' + optionHtml + '</select>';
\r
48 result = JSON.stringify(outputs);
\r
52 tmDetailUtil.initSteps = function() {
\r
55 url : vm.executionTab.$queryEventsInfoUrl,
\r
57 success : function(data) {
\r
58 console.log("initSteps");
\r
60 var step = $(".step");
\r
61 if (step.getStep().length == 0) {
\r
62 vm.executionTab.steps = [{title : "start"}, {title : "install VM"}, {title : "execute"}, {title : "complete"}];
\r
66 steps : vm.executionTab.steps
\r