Started work on global map

This commit is contained in:
Ylian Saint-Hilaire 2017-08-28 15:57:25 -07:00
parent 41125c66ee
commit 95f88d1125
2 changed files with 135 additions and 114 deletions

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.0.6-p",
"version": "0.0.6-q",
"keywords": [
"Remote Management",
"Intel AMT",

View File

@ -102,9 +102,8 @@
<div id=p1 style=display:none>
<h1>My Devices</h1>
<div style=width:100%;height:24px;background-color:#d3d9d6>
<div class=style7 style=width:84px;height:100%;float:left>&nbsp;</div>
<div class=h1 style=height:100%;float:left>&nbsp;</div>
<div class=style14 style=height:100%;float:left>
<div id=devListToolbar class=style14 style=height:100%;float:left>
&nbsp;&nbsp;<input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All" />&nbsp;
<input type="button" id="GroupActionButton" disabled="disabled" value="Group Action" onclick="groupActionFunction();" />&nbsp;
<input id="SearchInput" type="text" style=width:120px placeholder=Search onchange="onSearchInputChanged()" onkeyup="onSearchInputChanged()" autocomplete=off onfocus="onSearchFocus(1)" onblur="onSearchFocus(0)" />&nbsp;
@ -112,19 +111,23 @@
</div>
<div class="auto-style1" style="height: 100%; float: right">
<div style="height:100%;width:4px;float:right;background-color:#ffffff"></div>
<div class="h2" style="height: 100%; float: right;">&nbsp;</div>
<div style="float: right">
<div class=h2 style="height:100%;float:right">&nbsp;</div>
<div style=float:right>
View
<select id=viewselect onchange=onDeviceViewChange()>
<option value=1>3 wide</option>
<option value=2>List</option>
<option value=3>Map</option>
</select>
</div>
<div style=float:right id=devListToolbarSort>
Sort
<select id=sortselect onchange=onSortSelectChange()>
<option>Mesh</option>
<option>Power</option>
<option>Device</option>
</select>
&nbsp;View
<select id=viewselect onchange=onDeviceViewChange()>
<option value=1>3 wide</option>
<option value=2>List</option>
</select>
&nbsp;
</div>
</div>
</div>
@ -142,6 +145,7 @@
<p></p>
</div>
<div id="xdevices" style="max-height:calc(100vh - 228px);overflow-y:auto;-webkit-overflow-scrolling:touch"></div>
<div id="xdevicesmap" style="height:500px;width:100%;overflow:hidden"></div>
</div>
<div id=p2 style=display:none>
<h1>My Account</h1>
@ -596,6 +600,7 @@
var features = {{{features}}};
var serverPublicNamePort = "{{{serverDnsName}}}:{{{serverPublicPort}}}";
var amtScanResults = null;
var xxmap = null;
function startup() {
// Guard against other site's top frames (web bugs).
@ -657,6 +662,13 @@
var x = '';
for (var c = 1; c < 27; c++) x += "<option value='" + c + "'>Ctrl-" + String.fromCharCode(64 + c) + " (" + c + ")</option>";
QH('specialkeylist', x);
// Setup the map
xxmap = new ol.Map({
target: 'xdevicesmap',
layers: [ new ol.layer.Tile({ source: new ol.source.OSM() }) ],
view: new ol.View({ center: ol.proj.fromLonLat([0, 0]), zoom: 1.8, minZoom: 1.8 })
});
}
function getNodeFromId(id) {
@ -1134,9 +1146,17 @@
var deviceHeaderId = 0;
var deviceHeaderCount;
var deviceHeaders = {};
function updateDevices() {
var r = "", c = 0, current = null, count = 0, displayedMeshes = {}, view = Q('viewselect').value;
QV('xdevices', view < 3);
QV('xdevicesmap', view == 3);
QV('devListToolbar', view < 3);
QV('devListToolbarSort', view < 3);
if (view == 3) {
setTimeout( function() { xxmap.updateSize();}, 200);
// TODO
} else {
// 3 wide or list view
deviceHeaderId = 0;
deviceHeaderCount = {};
deviceHeaderTotal = 0;
@ -1248,6 +1268,7 @@
for (var i in deviceHeadersTitles) { Q(i).title = deviceHeadersTitles[i]; }
p1updateInfo();
}
}
function getMeshActions(mesh, meshrights) {
if ((meshrights & 4) == 0) return '';