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
17 interpolate: ["<!--", "-->"]
\r
20 var vm = avalon.define({
\r
21 $id: "tmController",
\r
22 $tableId : "ict_template_table",
\r
23 $templateTableFields : {// table columns
\r
25 {"mData": "serviceTemplateId", name: "ID", "bVisible": false},
\r
26 {"mData": "templateName",name: $.i18n.prop("nfv-template-iui-field-templatename"),"fnRender": tmUtil.nameRender},
\r
27 //{"mData": "templateName", name: $.i18n.prop("nfv-template-iui-field-templatename-topo"), "fnRender" : tmUtil.topoRender},
\r
28 //{"mData": "templateName", name: $.i18n.prop("nfv-template-iui-field-templatename-nodes"), "fnRender" : tmUtil.nodesRender},
\r
29 {"mData": "vendor", name: $.i18n.prop("nfv-template-iui-field-vendor")},
\r
30 {"mData": "version", name: $.i18n.prop("nfv-template-iui-field-version")},
\r
31 {"mData":"csarId", name: "packageID","bVisible": false},
\r
32 {"mData": "type", name: $.i18n.prop("nfv-template-iui-field-type")},
\r
36 "sProcessing": "<img src='../common/thirdparty/data-tables/images/loading-spinner-grey.gif'/><span> "
\r
37 +$.i18n.prop("nfv-nso-iui-table-sProcess")+"</span>",
\r
38 "sLengthMenu": $.i18n.prop("nfv-nso-iui-table-sLengthMenu"),
\r
39 "sZeroRecords": $.i18n.prop("nfv-nso-iui-table-sZeroRecords"),
\r
40 "sInfo": "<span class='seperator'> </span>" + $.i18n.prop("nfv-nso-iui-table-sInfo"),
\r
41 "sInfoEmpty": $.i18n.prop("nfv-nso-iui-table-sInfoEmpty"),
\r
42 "sGroupActions": $.i18n.prop("nfv-nso-iui-table-sGroupActions"),
\r
43 "sAjaxRequestGeneralError":$.i18n.prop("nfv-nso-iui-table-sAjaxRequestGeneralError"),
\r
44 "sEmptyTable": $.i18n.prop("nfv-nso-iui-table-sEmptyTable"),
\r
46 "sPrevious": $.i18n.prop("nfv-nso-iui-table-sPrevious"),
\r
47 "sNext": $.i18n.prop("nfv-nso-iui-table-sNext"),
\r
48 "sPage": $.i18n.prop("nfv-nso-iui-table-sPage"),
\r
49 "sPageOf": $.i18n.prop("nfv-nso-iui-table-sPageOf")
\r
53 queryTemplateInfoUrl : "/openoapi/catalog/v1/servicetemplates"
\r
55 $getTemplateCond: function() {
\r
59 $initTable: function() {
\r
61 setting.language = vm.$language;
\r
62 setting.paginate = true;
\r
63 setting.info = true;
\r
64 setting.columns = vm.$templateTableFields.table;
\r
65 setting.restUrl = vm.$restUrl.queryTemplateInfoUrl;
\r
66 setting.tableId = vm.$tableId;
\r
67 serverPageTable.initDataTable(setting, vm.$getTemplateCond(),
\r
68 vm.$tableId + '_div');
\r
70 $openDetail : function(templateId, rowId) {
\r
71 var oSelect = $("tbody tr select").eq(rowId);
\r
73 if(oSelect.length) {
\r
74 oSelect.find("option:selected").val();
\r
76 window.open("./templateDetail.html?templateId="+templateId+"&flavor="+flavor,"_self");
\r
78 $openTopoDetail : function(templateId, rowId) {
\r
79 var oSelect = $("tbody tr select").eq(rowId);
\r
81 if(oSelect.length) {
\r
82 oSelect.find("option:selected").val();
\r
84 window.open("./topologyDetail.html?templateId="+templateId+"&flavor="+flavor,"_self");
\r
86 $openNodesDetail : function(templateId, rowId) {
\r
87 var oSelect = $("tbody tr select").eq(rowId);
\r
89 if(oSelect.length) {
\r
90 oSelect.find("option:selected").val();
\r
92 window.open("./nodesDetail.html?templateId="+templateId+"&flavor="+flavor,"_self");
\r
98 var refreshByCond = function() {
\r