123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <!DOCTYPE html>
- <html ng-app="App">
- <head>
- <title>System Info</title>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=no">
- <link rel="stylesheet" href="../../script/semantic/semantic.min.css">
- <script type="text/javascript" src="../../script/jquery.min.js"></script>
- <script type="text/javascript" src="../../script/semantic/semantic.min.js"></script>
- </head>
- <body>
- <div class="ui vertical masthead left aligned segment">
- <div class="ui container">
- <div>
- <h1 id="modelname"></h1>
- </div>
- <div>
- <div style="display:inline-block;" id="build"></div>
- <div style="float:right !important;" id="manufacturer"></div>
- </div>
-
- </div>
- </div>
- <div class="ui container">
- <br>
- <h3 class="ui header">Specifications</h3>
- <div class="ui grid">
- <div class="six wide column">
- Model :
- </div>
- <div class="ten wide column" id="model">
- Loading...
- </div>
- <div class="six wide column">
- Frequency :
- </div>
- <div class="ten wide column" id="freq">
- Loading...
- </div>
- <div class="six wide column">
- Instruction :
- </div>
- <div class="ten wide column" id="instruction">
- Loading...
- </div>
- <div class="six wide column">
- Hardware :
- </div>
- <div class="ten wide column" id="hardware">
- Loading...
- </div>
- <div class="six wide column">
- Revision :
- </div>
- <div class="ten wide column" id="revision">
- Loading...
- </div>
- <div class="six wide column">
- Memory :
- </div>
- <div class="ten wide column" id="ram">
- Loading...
- </div>
- <div class="six wide column">
- NIC :
- </div>
- <div class="ten wide column" id="nic">
- Loading...
- </div>
- <div class="six wide column">
- Drive :
- </div>
- <div class="ten wide column" id="drive">
- Loading...
- </div>
- <div class="six wide column">
- USB :
- </div>
- <div class="ten wide column" id="usb">
- Loading...
- </div>
- </div>
- <br>
- <h3 class="ui header">Operation Time</h3>
- <div class="ui grid">
- <div class="six wide column">
- Boot Time:
- </div>
- <div class="ten wide column" id="startup">
- Loading...
- </div>
- <div class="six wide column">
- Up Time :
- </div>
- <div class="ten wide column" id="operation">
- Loading...
- </div>
- </div>
- </div>
- <div class="ui divider"></div>
- <img class="ui small image" id="icon"></img>
- <br>
- </body>
- <script>
- $(document).ready(function() {
- initSystemInfo();
- });
- function initSystemInfo() {
- $.getJSON("../../system/info/getArOZInfo?icon=true", function(data) {
- $("#modelname").html(data["DeviceModel"]);
- $("#icon").attr("src", "data:image/png;base64," + data["VendorIcon"]);
- $("#build").html(data["BuildVersion"]);
- $("#manufacturer").html(data["DeviceVendor"]);
- });
- $.getJSON("../../system/info/getCPUinfo", function(data) {
- $("#model").html(data["Model"]);
- $("#freq").html(data["Freq"] + "MHz");
- $("#instruction").html(data["Instruction"]);
- $("#hardware").html(data["Hardware"]);
- $("#revision").html(data["Revision"]);
- });
- $.get("../../system/info/getRAMinfo", function(data) {
- $("#ram").html(humanFileSize(data, false));
- });
- $.getJSON("../../system/info/ifconfig", function(data) {
- $("#nic").html("");
- $(data).each(function(index, item) {
- $("#nic").append(item + "<br>");
- });
- });
- $.getJSON("../../system/info/getDriveStat", function(data) {
- $("#drive").html("");
- $(data).each(function(index, item) {
- $("#drive").append(item["DriveLetter"] + " (" + item["FileSystem"] + ") " + humanFileSize(item["FreeSpace"], true) + "<br>");
- });
- });
- $.getJSON("../../system/info/usbPorts", function(data) {
- $("#usb").html("");
- $(data).each(function(index, item) {
- $("#usb").append(item + "<br>");
- });
- });
- $.getJSON("../../system/info/getRuntimeInfo", function(data){
- $("#startup").text(ao_module_utils.timeConverter(data.StartupTime));
- $("#operation").text(ao_module_utils.durationConverter(data.ContinuesRuntime));
- $("#operation").attr("startunix", data.StartupTime);
- accumulateOperationTime();
- });
- }
- function accumulateOperationTime(){
- setTimeout(function(){
- if ($("#operation").length > 0){
- var startUnix = $("#operation").attr("startunix");
- startUnix = parseInt(startUnix);
- var newOprTime = parseInt(Date.now()/1000) - startUnix
- $("#operation").text(ao_module_utils.durationConverter(newOprTime));
- accumulateOperationTime();
- }
- }, 1000);
- }
- //https://stackoverflow.com/questions/10420352/converting-file-size-in-bytes-to-human-readable-string/10420404
- function humanFileSize(bytes, si) {
- var thresh = si ? 1000 : 1024;
- if (Math.abs(bytes) < thresh) {
- return bytes + ' B';
- }
- var units = si ? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] : ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
- var u = -1;
- do {
- bytes /= thresh;
- ++u;
- } while (Math.abs(bytes) >= thresh && u < units.length - 1);
- return bytes.toFixed(1) + ' ' + units[u];
- }
- </script>
- </html>
|