1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <meta charset="utf-8" />
5
    <title>Wialon Playground - Execute custom report</title>
6
    <script type="text/javascript" src="//code.jquery.com/jquery-latest.min.js"></script>
7
    <script type="text/javascript" src="//hst-api.wialon.com/wsdk/script/wialon.js"></script>
8
</head>
9
<body>
10
11
<table>
12
    <tr>
13
        <td>Select resource and table:</td>
HTML
5
 
1
td, th{ border: 1px solid #c6c6c6; }
2
.wrap{ max-height:150px; overflow-y: auto; }
3
.odd, th{ background:#EEE; border: 1px solid #c6c6c6; }
4
ul{ list-style: none; margin:0px; padding:0px; display:block;overflow-y: auto; max-height: 200px;width: 300px}
5
label{ cursor:pointer; }
CSS
209
 
1
// Print message to log
2
3
function msg(text) {
4
    $("#log").prepend(text + "<br/>");
5
}
6
7
function init() { // Execute after login succeed
8
    // specify what kind of data should be returned
9
    var res_flags = wialon.item.Item.dataFlag.base | wialon.item.Resource.dataFlag.reports;
10
    var unit_flags = wialon.item.Item.dataFlag.base;
11
12
    var sess = wialon.core.Session.getInstance(); // get instance of current Session
13
    sess.loadLibrary("resourceReports"); // load Reports Library
14
    sess.updateDataFlags( // load items to current session
15
        [
16
            { // 'avl_resource's specification
17
                type: "type",
JS
Result
Source code of example Close ✕
1
 
1
/*source*/