UXSimStatus Aternatif

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m
m
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 
{{Quicklinks}}
 
{{Quicklinks}}
Si vous rencontrez des problèmes de "cross-origin", vous pouvez essayer cette version alternative:
+
If you're having cross-origin issues, you can try this alternate version:
 
<source lang="html4strict">
 
<source lang="html4strict">
 
<!doctype html>
 
<!doctype html>
Line 75: Line 75:
 
</html>
 
</html>
 
</source>
 
</source>
Retourner vers [[UXSimStatus]].
+
Return to [[UXSimStatus]].

Latest revision as of 12:32, 11 October 2018

If you're having cross-origin issues, you can try this alternate version:

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>jsonSimStats</title>
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
    <script src="https://www.gstatic.com/charts/loader.js"></script>
</head>
<body>
<script>
SimFPS = 0;
PhyFPS = 0;
Memory = 0;
RootAg = 0;
ChldAg = 0;
Uptime = "";
Version = "";
var url = "http://<IP_OR_DOMAIN>:<PORT>/jsonSimStats/?callback=?";
 
setInterval(function() {$.getJSON(url, function(data) {
    SimFPS = Math.round(data.SimFPS);
    PhyFPS = Math.round(data.PhyFPS);
    Memory = Math.round(data.Memory);
    ChldAg = data.ChldAg;
    RootAg = data.RootAg;
    Uptime = data.Uptime;
    Version = data.Version;
    drawChart();
    setTags();
})}, 3000);
 
google.charts.load('current', {'packages': ['gauge']});
 
function drawChart() {
    var cdata = new google.visualization.DataTable();
    cdata.addColumn('string', 'Label');
    cdata.addColumn('number', 'Value');
    cdata.addRows(3);
    cdata.setValue(0, 0, 'SimFPS');
    cdata.setValue(0, 1, SimFPS);
    cdata.setValue(1, 0, 'PhyFPS');
    cdata.setValue(1, 1, PhyFPS);
    cdata.setValue(2, 0, 'Memory');
    cdata.setValue(2, 1, Memory);
    var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
    var options = {width: 400, height: 120, redFrom: 90, redTo: 100, yellowFrom:75, yellowTo: 90, minorTicks: 5};
    chart.draw(cdata, options);
}
 
function setTags() {
    $("#par-version").text("Version: " + Version);
    $("#par-ragent").text("Root Agent: " + RootAg);
    $("#par-uptime").text("Uptime: "  + Uptime);
    $("#par-cagent").text("Child Agent: " + ChldAg);
}
</script>
</head>
 <body>
= jsonSimStats =
<table>
    <tr>
        <td><div id="par-version">Version:</div></td>
        <td><div id="par-ragent">Root Agent:</div></td>
    </tr>
    <tr>
        <td><div id="par-uptime">Uptime:</div></td>
        <td><div id="par-cagent">Child Agent:</div></td>
    </tr>
</table>
<div id="chart_div"></div>
</body>
</html>

Return to UXSimStatus.

Personal tools
General
About This Wiki