mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
adding ui params option to operations
This commit is contained in:
parent
e65f0b1afa
commit
c9e533dd2a
@ -79,6 +79,11 @@
|
|||||||
<input type="{{type}}" id="{{name}}" placeholder="{{name}}" class="form-control" data-param-type="query" value="{{value}}" />
|
<input type="{{type}}" id="{{name}}" placeholder="{{name}}" class="form-control" data-param-type="query" value="{{value}}" />
|
||||||
<br />
|
<br />
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
{{#each uiParams}}
|
||||||
|
<input type="{{type}}" id="{{id}}" name="{{name}}" data-param-type="form" value="{{value}}" />
|
||||||
|
<label>{{label}}</label>
|
||||||
|
<br />
|
||||||
|
{{/each}}
|
||||||
<button id="btnSend" type="button" onclick="submitForm('form-{{operation}}')" class="btn btn-default"> Send
|
<button id="btnSend" type="button" onclick="submitForm('form-{{operation}}')" class="btn btn-default"> Send
|
||||||
to Device </button>
|
to Device </button>
|
||||||
<label id="lblSending" class="wr-input-label hidden"><i
|
<label id="lblSending" class="wr-input-label hidden"><i
|
||||||
|
|||||||
@ -42,14 +42,18 @@ function submitForm(formId) {
|
|||||||
uriencodedQueryStr += prefix + input.attr("id") + "=" + input.val();
|
uriencodedQueryStr += prefix + input.attr("id") + "=" + input.val();
|
||||||
} else if (input.data("param-type") == "form") {
|
} else if (input.data("param-type") == "form") {
|
||||||
var prefix = (uriencodedFormStr == "") ? "" : "&";
|
var prefix = (uriencodedFormStr == "") ? "" : "&";
|
||||||
uriencodedFormStr += prefix + input.attr("id") + "=" + input.val();
|
if (input.attr("type") == "checkbox" || input.attr("type") == "radio"){
|
||||||
//payload[input.attr("id")] = input.val();
|
if (input.is(':checked')){
|
||||||
|
uriencodedFormStr += prefix + input.attr("name") + "=" + input.val();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
uriencodedFormStr += prefix + input.attr("id") + "=" + input.val();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
uri += uriencodedQueryStr;
|
uri += uriencodedQueryStr;
|
||||||
var httpMethod = form.attr("method").toUpperCase();
|
var httpMethod = form.attr("method").toUpperCase();
|
||||||
var contentType = form.attr("enctype");
|
var contentType = form.attr("enctype");
|
||||||
console.log(payload);
|
|
||||||
var featurePayload = form.attr("data-payload");
|
var featurePayload = form.attr("data-payload");
|
||||||
if (featurePayload) {
|
if (featurePayload) {
|
||||||
contentType = "application/json";
|
contentType = "application/json";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user