aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html88
-rw-r--r--src/main/resources/application.properties2
2 files changed, 52 insertions, 38 deletions
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html
index 25cc9a02..5a460030 100644
--- a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html
+++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html
@@ -289,12 +289,11 @@ label {
</div>
<div class="col-sm-8">
<label for="guardPolicyType" class="col-sm-4 control-label">
- Guard Policy Type</label>
- <select class="form-control"
+ Guard Policy Type</label> <select class="form-control"
name="guardPolicyType" id="guardPolicyType"
onchange="changeGuardPolicyType();">
- <option value="MinMax">MinMax</option>
- <option value="FrequencyLimiter">FrequencyLimiter</option>
+ <option value="GUARD_MIN_MAX">MinMax</option>
+ <option value="GUARD_YAML">FrequencyLimiter</option>
</select>
</div>
<label for="guardTargets" class="col-sm-4 control-label">Guard
@@ -362,36 +361,51 @@ label {
</div>
<script>
-
- function initTargetResourceId() {
- // Set all the Resource Invariant UUID in the target resource ID list (+Empty and other)
- Object.keys(vf_Services["shared"]["byVf"]).forEach(function(key){
- $('#targetResourceId').append($('<option></option>').val(key).html(key));
- });
- }
-
- function changeTargetResourceIdOther() {
- if ($("#targetResourceId").val()==="Other:") {
- $("#targetResourceIdOther").show();
- } else {
- $("#targetResourceIdOther").hide();
- $("#targetResourceIdOther").val("");
+ function getAllFormId() {
+ return Array.from(document.getElementsByClassName("formId"));
}
- }
-
- function changeGuardPolicyType() {
- console.log("executing GuardPolicyType")
- console.log("GuardPolicyType value:"+$("#guardPolicyType").val())
- if ($("#guardPolicyType").val()==="MinMax") {
- console.log("executing GuardPolicyType")
- $("#minMaxGuardPolicyDiv").show();
- $("#frequencyLimiterGuardPolicyDiv").hide();
- } else if ($("#guardPolicyType").val()==="FrequencyLimiter") {
- console.log("executing GuardPolicyType")
- $("#minMaxGuardPolicyDiv").hide();
- $("#frequencyLimiterGuardPolicyDiv").show();
+
+ function searchActiveFormId() {
+ var formArray = getAllFormId();
+ for (var i=0, max=formArray.length; i < max; i++) {
+
+ console.log("Search active FormId, current element "+formArray[i].id);
+ if (formArray[i].style.display !== "none") {
+ console.log("Active form is:"+formArray[i].id);
+ return formArray[i];
+ }
+ }
+ console.log("No active formId found !");
+ }
+
+ function initTargetResourceId() {
+ // Set all the Resource Invariant UUID in the target resource ID list (+Empty and other)
+ Object.keys(vf_Services["shared"]["byVf"]).forEach(function(key) {
+ $("#targetResourceId").append($('<option></option>').val(key).html(key));
+ });
+
+ }
+
+ function changeTargetResourceIdOther() {
+ var formItemActive = searchActiveFormId();
+ if ($("#"+formItemActive.id+" #targetResourceId").val()==="Other:") {
+ $("#"+formItemActive.id+" #targetResourceIdOther").show();
+ } else {
+ $("#"+formItemActive.id+" #targetResourceIdOther").hide();
+ $("#"+formItemActive.id+" #targetResourceIdOther").val("");
+ }
+ }
+
+ function changeGuardPolicyType() {
+ var formItemActive = searchActiveFormId();
+ if ($("#"+formItemActive.id+" #guardPolicyType").val()==="GUARD_MIN_MAX") {
+ $("#"+formItemActive.id+" #minMaxGuardPolicyDiv").show();
+ $("#"+formItemActive.id+" #frequencyLimiterGuardPolicyDiv").hide();
+ } else if ($("#"+formItemActive.id+" #guardPolicyType").val()==="GUARD_YAML") {
+ $("#"+formItemActive.id+" #minMaxGuardPolicyDiv").hide();
+ $("#"+formItemActive.id+" #frequencyLimiterGuardPolicyDiv").show();
+ }
}
- }
//Basically this method will add a new form. All forms share the same class. When you want one form to show(active form) the other forms get the
// css attribute display:none
$("#add_one_more").click(function(event) {
@@ -451,10 +465,10 @@ label {
}
if(el[i][j].name==="targetResourceIdOther" && el[i][j].value.toString()!=='') {
// Add the entry and set it
- $('#targetResourceId').append($('<option></option>').val($('#targetResourceIdOther').val()).html($('#targetResourceIdOther').val()));
- $('#targetResourceId').val($('#targetResourceIdOther').val());
+ $("#formId" + num + " #targetResourceId").append($('<option></option>').val($("#formId" + num + " #targetResourceIdOther").val()).html($("#formId" + num + " #targetResourceIdOther").val()));
+ $("#formId" + num + " #targetResourceId").val($("#formId" + num + " #targetResourceIdOther").val());
}
-
+ changeGuardPolicyType();
}
}
}
@@ -497,7 +511,7 @@ label {
});
$('input[value="multiselect-all"]').prop('disabled', true).parent('li').addClass('disabled');
}
- changeGuardPolicyType();
+
}
function addSelectListen(count) {
@@ -904,7 +918,7 @@ label {
initTargetResourceId();
//load metrics dropdown
- if (elementMap["global"]){
+ if (elementMap["global"]) {
for (var i = 0; i < (elementMap["global"].length); i++){
if ((elementMap["global"][i]["name"]) == "actionSet"){
var asSel = elementMap["global"][i]["value"];
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 0ecf0199..263c09d3 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -237,7 +237,7 @@ clamp.config.cadi.keyFile=classpath:/clds/aaf/org.onap.clamp.keyfile
clamp.config.cadi.cadiLoglevel=DEBUG
clamp.config.cadi.cadiLatitude=37.78187
clamp.config.cadi.cadiLongitude=-122.26147
-clamp.config.cadi.aafLocateUrl=https://onap-aaf:8095
+clamp.config.cadi.aafLocateUrl=https://aaf.api.simpledemo.onap.org:8095
clamp.config.cadi.cadiKeystorePassword=enc:V_kq_EwDNb4itWp_lYfDGXIWJzemHGkhkZOxAQI9IHs
clamp.config.cadi.cadiTruststorePassword=enc:Mj0YQqNCUKbKq2lPp1kTFQWeqLxaBXKNwd5F1yB1ukf
#clamp.config.cadi.oauthTokenUrl=https://AAF_LOCATE_URL/AAF_NS.token:2.0/token