2 * Copyright 2016-2017 ZTE Corporation.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 interpolate: ["<!--", "-->"]
20 var vm = avalon.define({
22 $tableId : "ict_template_table",
23 $templateTableFields : {// table columns
25 {"mData": "serviceTemplateId", name: "ID", "bVisible": false},
26 {"mData": "templateName",name: $.i18n.prop("nfv-template-iui-field-templatename"),"fnRender": tmUtil.nameRender},
27 //{"mData": "templateName", name: $.i18n.prop("nfv-template-iui-field-templatename-topo"), "fnRender" : tmUtil.topoRender},
28 //{"mData": "templateName", name: $.i18n.prop("nfv-template-iui-field-templatename-nodes"), "fnRender" : tmUtil.nodesRender},
29 {"mData": "vendor", name: $.i18n.prop("nfv-template-iui-field-vendor")},
30 {"mData": "version", name: $.i18n.prop("nfv-template-iui-field-version")},
31 {"mData":"csarId", name: "packageID","bVisible": false},
32 {"mData": "type", name: $.i18n.prop("nfv-template-iui-field-type")},
36 "sProcessing": "<img src='../common/thirdparty/data-tables/images/loading-spinner-grey.gif'/><span> "
37 +$.i18n.prop("nfv-nso-iui-table-sProcess")+"</span>",
38 "sLengthMenu": $.i18n.prop("nfv-nso-iui-table-sLengthMenu"),
39 "sZeroRecords": $.i18n.prop("nfv-nso-iui-table-sZeroRecords"),
40 "sInfo": "<span class='seperator'> </span>" + $.i18n.prop("nfv-nso-iui-table-sInfo"),
41 "sInfoEmpty": $.i18n.prop("nfv-nso-iui-table-sInfoEmpty"),
42 "sGroupActions": $.i18n.prop("nfv-nso-iui-table-sGroupActions"),
43 "sAjaxRequestGeneralError":$.i18n.prop("nfv-nso-iui-table-sAjaxRequestGeneralError"),
44 "sEmptyTable": $.i18n.prop("nfv-nso-iui-table-sEmptyTable"),
46 "sPrevious": $.i18n.prop("nfv-nso-iui-table-sPrevious"),
47 "sNext": $.i18n.prop("nfv-nso-iui-table-sNext"),
48 "sPage": $.i18n.prop("nfv-nso-iui-table-sPage"),
49 "sPageOf": $.i18n.prop("nfv-nso-iui-table-sPageOf")
53 queryTemplateInfoUrl : "/openoapi/catalog/v1/servicetemplates"
55 $getTemplateCond: function() {
59 $initTable: function() {
61 setting.language = vm.$language;
62 setting.paginate = true;
64 setting.columns = vm.$templateTableFields.table;
65 setting.restUrl = vm.$restUrl.queryTemplateInfoUrl;
66 setting.tableId = vm.$tableId;
67 serverPageTable.initDataTable(setting, vm.$getTemplateCond(),
68 vm.$tableId + '_div');
70 $openDetail : function(templateId, rowId) {
71 var oSelect = $("tbody tr select").eq(rowId);
74 oSelect.find("option:selected").val();
76 window.open("./templateDetail.html?templateId="+templateId+"&flavor="+flavor,"_self");
78 $openTopoDetail : function(templateId, rowId) {
79 var oSelect = $("tbody tr select").eq(rowId);
82 oSelect.find("option:selected").val();
84 window.open("./topologyDetail.html?templateId="+templateId+"&flavor="+flavor,"_self");
86 $openNodesDetail : function(templateId, rowId) {
87 var oSelect = $("tbody tr select").eq(rowId);
90 oSelect.find("option:selected").val();
92 window.open("./nodesDetail.html?templateId="+templateId+"&flavor="+flavor,"_self");
98 var refreshByCond = function() {