mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Merge pull request #637 from Kamidu/cloud-3.1.0
Location and operation bar relate ui fixes for Cloud 3.1.0
This commit is contained in:
commit
622860a5df
@ -337,6 +337,9 @@
|
|||||||
<i class="fw fw-refresh"></i>
|
<i class="fw fw-refresh"></i>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
<div id="map-spinner" class="wr-advance-operations-init hidden">
|
||||||
|
<i class="fw fw-settings fw-spin fw-2x"></i> Fetching the latest location...
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="collapseThree" class="panel-collapse collapse in" role="tabpanel"
|
<div id="collapseThree" class="panel-collapse collapse in" role="tabpanel"
|
||||||
aria-labelledby="device_location">
|
aria-labelledby="device_location">
|
||||||
|
|||||||
@ -32,6 +32,8 @@ function loadLeafletMap(refresh) {
|
|||||||
attribution = "© <a href='https://openstreetmap.org/copyright'>OpenStreetMap</a> contributors";
|
attribution = "© <a href='https://openstreetmap.org/copyright'>OpenStreetMap</a> contributors";
|
||||||
|
|
||||||
if (refresh && !isAnalitics) {
|
if (refresh && !isAnalitics) {
|
||||||
|
|
||||||
|
$("#map-spinner").removeClass("hidden");
|
||||||
var applicationsList = $("#applications-list");
|
var applicationsList = $("#applications-list");
|
||||||
var deviceId = applicationsList.data("device-id");
|
var deviceId = applicationsList.data("device-id");
|
||||||
var deviceType = applicationsList.data("device-type");
|
var deviceType = applicationsList.data("device-type");
|
||||||
@ -43,8 +45,10 @@ function loadLeafletMap(refresh) {
|
|||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.latitude && data.longitude) {
|
if (data.latitude && data.longitude) {
|
||||||
map.removeLayer(marker);
|
map.removeLayer(marker);
|
||||||
marker = L.marker([6.912853, 79.855635], {"opacity": opacVal}).addTo(map).bindPopup("Your device is here");
|
// marker = L.marker([6.912853, 79.855635], {"opacity": opacVal}).addTo(map).bindPopup("Your device is here");
|
||||||
// marker = L.marker([data.latitude, data.longitude], {"opacity": opacVal}).addTo(map).bindPopup("Your device is here");
|
marker = L.marker([data.latitude, data.longitude], {"opacity": opacVal}).addTo(map).bindPopup("Your device is here");
|
||||||
|
map.panTo(new L.LatLng(data.latitude, data.longitude));
|
||||||
|
// map.panTo(new L.LatLng(40.737, -73.923));
|
||||||
marker.on('mouseover', function (e) {
|
marker.on('mouseover', function (e) {
|
||||||
this.openPopup();
|
this.openPopup();
|
||||||
});
|
});
|
||||||
@ -52,14 +56,16 @@ function loadLeafletMap(refresh) {
|
|||||||
this.closePopup();
|
this.closePopup();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
$("#map-spinner").addClass("hidden");
|
||||||
} else {
|
} else {
|
||||||
|
$("#map-spinner").adddClass("hidden");
|
||||||
$("#device-location").hide();
|
$("#device-location").hide();
|
||||||
$("#map-error").show();
|
$("#map-error").show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// error-callback
|
// error-callback
|
||||||
function () {
|
function () {
|
||||||
|
$("#map-spinner").addClass("hidden");
|
||||||
$("#device-location").hide();
|
$("#device-location").hide();
|
||||||
$("#map-error").show();
|
$("#map-error").show();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -65,8 +65,6 @@
|
|||||||
{{description}}
|
{{description}}
|
||||||
<br>
|
<br>
|
||||||
</h4>
|
</h4>
|
||||||
<div style="height:200px" class="hidden" data-toggle="loading" data-loading-inverse="false"
|
|
||||||
data-loading-text="Sending to device"></div>
|
|
||||||
<div id="operation-form">
|
<div id="operation-form">
|
||||||
<form action="{{params.0.uri}}" method="{{params.0.method}}"
|
<form action="{{params.0.uri}}" method="{{params.0.method}}"
|
||||||
style="padding-bottom: 20px;"
|
style="padding-bottom: 20px;"
|
||||||
@ -106,12 +104,13 @@
|
|||||||
{{/equal}}
|
{{/equal}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
<button id="btnSend" type="button" onclick="submitForm('form-{{operation}}')"
|
<button id="btnSend" type="button" onclick="submitForm('form-{{operation}}')"
|
||||||
class="btn btn-default"> Send
|
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
|
||||||
class="fw fw-lifecycle fw-spin fw-2x"></i> Sending..</label>
|
class="fw fw-lifecycle fw-spin fw-2x"></i> Sending..</label>
|
||||||
<label id="lblSent" class="wr-input-label hidden"><i
|
<label id="lblSent" class="wr-input-label hidden"><i
|
||||||
class="fw fw-check fw-2x"></i> Sent</label>
|
class="fw fw-check fw-2x"></i> Sent</label>
|
||||||
|
<i id="lbl-execution" class="fw fw-wso2-logo fw-pulse fw-2x hidden"> Executing Operation </i>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -28,10 +28,8 @@ function operationSelect(selection) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function submitForm(formId) {
|
function submitForm(formId) {
|
||||||
$("#operation-form").addClass("hidden");
|
$("#btnSend").addClass("hidden");
|
||||||
$('[data-toggle="loading"]').removeClass("hidden");
|
$("#lbl-execution").removeClass("hidden");
|
||||||
$('[data-toggle="loading"]').loading('show');
|
|
||||||
|
|
||||||
var form = $("#" + formId);
|
var form = $("#" + formId);
|
||||||
var uri = form.attr("action");
|
var uri = form.attr("action");
|
||||||
var deviceId = form.data("device-id");
|
var deviceId = form.data("device-id");
|
||||||
@ -75,8 +73,8 @@ function submitForm(formId) {
|
|||||||
description.html("");
|
description.html("");
|
||||||
|
|
||||||
var resetLoader = function () {
|
var resetLoader = function () {
|
||||||
$("#operation-form").removeClass("hidden");
|
$("#btnSend").removeClass("hidden");
|
||||||
$('[data-toggle="loading"]').addClass("hidden");
|
$('#lbl-execution').addClass("hidden");
|
||||||
};
|
};
|
||||||
|
|
||||||
var successCallBack = function (response) {
|
var successCallBack = function (response) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user