2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
25 function enableActionMenu(status) {
26 var actionMap = '{"DESIGN": ["Submit","Delete"],"RUNNING": ["Stop","UnDeploy"],"SUBMITTED": ["Submit","Delete","Deploy"],"DEPLOYED": ["UnDeploy","Stop"],"UNDEPLOY": ["Deploy","Submit","Restart","Delete"],"STOPPED":["UnDeploy","Restart"]}';
27 var actionMapJson = JSON.parse(actionMap);
28 var actionArr = actionMapJson[status];
29 disableAllActionMenu();
30 if (actionArr != null && actionArr.length > 0) {
31 for (var i=0; i < actionArr.length; i++) {
32 document.getElementById(actionArr[i]).classList
38 function disableAllActionMenu() {
39 var allActions = ["Submit","Stop","Restart","Delete","Deploy","UnDeploy"];
40 for (var i=0; i < allActions.length; i++) {
41 document.getElementById(allActions[i]).classList
46 function enableAllActionMenu() {
47 var allActions = ["Submit","Stop","Restart","Delete","Deploy","UnDeploy"];
48 for (var i=0; i < allActions.length; i++) {
49 document.getElementById(allActions[i]).classList
54 function enableDefaultMenu() {
55 document.getElementById('Open CL').classList.remove('ThisLink');
56 document.getElementById('Wiki').classList.remove('ThisLink');
57 document.getElementById('Contact Us').classList.remove('ThisLink');
59 // enable model options
60 document.getElementById('Properties CL').classList
62 document.getElementById('Close Model').classList
65 document.getElementById('Properties CL').classList
67 document.getElementById('Revert Model Changes').classList
69 document.getElementById('Close Model').classList
71 document.getElementById('Refresh Status').classList