Adding deploy geo analytics button into platform configuration

revert-70aa11f8
Rasika Perera 8 years ago
parent 0cea35647f
commit 3fd2c6b705

@ -92,6 +92,18 @@
<button id="save-general-btn" class="wr-btn">Save</button> <button id="save-general-btn" class="wr-btn">Save</button>
</div> </div>
</div> </div>
<div id="general-config-heading" role="tab">
<h2 class="sub-title panel-title">
Geo Analytics
</h2>
</div>
<div class="panel-collapse panel-body" role="tabpanel">
<div class="wr-input-control">
<button class="wr-btn" onclick="artifactGeoUpload();">
Deploy Geo Analytics Artifacts
</button>
</div>
</div>
</div> </div>
</div> </div>
<!-- general--> <!-- general-->
@ -130,6 +142,26 @@
You not authorized to enter General and Platform Specific Server Setting Management Section. You not authorized to enter General and Platform Specific Server Setting Management Section.
<br> <br>
{{/if}} {{/if}}
<div id="geo-analytics-response-template" style="display: none">
<div class="content">
<div class="row">
<div class="col-lg-5 col-md-6 col-centered">
<h3>
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i id="status-icon" class="fw fw-error fw-stack-1x"></i>
</span>
<br>
</h3>
<h4>
<span id="title"></span>
<br>
</h4>
<span id="description"></span>
</div>
</div>
</div>
</div>
{{/zone}} {{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
{{js "js/platform-configuration.js"}} {{js "js/platform-configuration.js"}}

@ -127,3 +127,30 @@ var showAdvanceOperation = function (operation, button) {
$(hiddenOperation + '[data-operation="' + operation + '"]').show(); $(hiddenOperation + '[data-operation="' + operation + '"]').show();
$(hiddenOperation + '[data-operation="' + operation + '"]').siblings().hide(); $(hiddenOperation + '[data-operation="' + operation + '"]').siblings().hide();
}; };
var artifactGeoUpload = function () {
var contentType = "application/json";
var backendEndBasePath = "/api/device-mgt/v1.0";
var urix = backendEndBasePath + "/admin/devicetype/deploy/analytics";
var defaultStatusClasses = "fw fw-stack-1x";
var content = $("#geo-analytics-response-template").find(".content");
var title = content.find("#title");
var statusIcon = content.find("#status-icon");
var data = {};
invokerUtil.post(urix, data, function (data) {
title.html("Deploying statistic artifacts. Please wait...");
statusIcon.attr("class", defaultStatusClasses + " fw-check");
$(modalPopupContent).html(content.html());
showPopup();
setTimeout(function () {
hidePopup();
location.reload(true);
}, 5000);
}, function (jqXHR) {
title.html("Failed to deploy artifacts, Please contact administrator.");
statusIcon.attr("class", defaultStatusClasses + " fw-error");
$(modalPopupContent).html(content.html());
showPopup();
}, contentType);
};

Loading…
Cancel
Save