overte/scripts/system/html/users.html
2017-01-19 13:11:35 -08:00

73 lines
No EOL
2.2 KiB
HTML

<!--
// users.html
//
// Created by Faye Li on 18 Jan 2017
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
-->
<html>
<head>
<title>Users Online</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
<style>
body {
margin: 0;
width: 100%;
font-family: 'Raleway', sans-serif;
color: white;
background: linear-gradient(#2b2b2b, #0f212e);
}
.top-bar {
width: 100%;
height: 90px;
background: linear-gradient(#2b2b2b, #1e1e1e);
}
.top-bar div {
padding-left: 30px;
padding-right: 30px;
line-height: 90px;
color: white;
white-space: nowrap;
}
.main {
padding: 30px;
}
</style>
</head>
<body>
<div class="top-bar">
<div>Users Online</div>
</div>
<div class="main">
<button type="button" onclick="pollUsers()">Poll Users</button>
<div id="dev-div"></div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
var METAVERSE_API_URL = "https://metaverse.highfidelity.com/api/v1/users?status=online";
function pollUsers() {
$("#dev-div").html("polling users");
$.ajax({
url: METAVERSE_API_URL,
success: function(response) {
$("#dev-div").html(JSON.stringify(response.data));
console.log(response);
}
});
}
$(document).ready(function() {
$("#dev-div").html("ready");
});
</script>
</body>
</html>