Skip to content

Commit

Permalink
Add simple status page to portal that displays Usergrid API /status.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelarusso committed Nov 10, 2015
1 parent 2b1f761 commit bf5ef15
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
5 changes: 3 additions & 2 deletions portal/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ module.exports = function(grunt) {
'!css/main.min.css',
'!js/libs/',
'!js/generated/*.js',
'!js/generated-templates/*.js'
'!js/generated-templates/*.js',
'getStatus.js'
],
tasks: ['build-dev']
},
Expand Down Expand Up @@ -302,7 +303,7 @@ module.exports = function(grunt) {
// includes files within path
{
expand: true,
src: ['*.html', 'config.js', '*.ico', 'helpJson.json'],
src: ['*.html', 'config.js', '*.ico', 'helpJson.json', 'getStatus.js'],
dest: distPath,
filter: 'isFile'
}, {
Expand Down
38 changes: 38 additions & 0 deletions portal/getStatus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/

var url = Usergrid.overrideUrl + '/status';

var getStatus = function(){
var http = new XMLHttpRequest();

http.onload= function(){
if (http.readyState==4 || http.readyState=="complete")
{
console.log('response: \n'+http.responseText);
document.getElementById("statusResponse")
.innerHTML=http.responseText;
}
};


http.open("GET",url, true);
http.send();

};
35 changes: 35 additions & 0 deletions portal/status.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Status Page</title>
</head>
<body>

<script src="pre-config.js"></script>
<script src="config.js"></script>
<script src="getStatus.js"></script>

<script> getStatus(); </script>
<pre><div id="statusResponse"></div></pre>

</body>
</html>

0 comments on commit bf5ef15

Please sign in to comment.