Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
Autorefresh in the GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvinus committed Apr 7, 2011
1 parent aeb5c54 commit eee8522
Show file tree
Hide file tree
Showing 2 changed files with 242 additions and 7 deletions.
27 changes: 21 additions & 6 deletions gui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
</head>
<body style="background-color:#F0F0F0">

<div style="float:right;padding:10px">
Refresh interval <input type='text' size=4 id='refreshinterval' value='60'>s
</div>

<h3>FSDFS global status</h3>
<table>
Expand All @@ -34,6 +37,8 @@ <h3>Nodes status</h3>
<table id="nodes"></table>


<br/><br/>
Pro tip : Did you know you can load this page with index.html?master=XXX&amp;secret=YYY to avoid the prompts?


<script>
Expand Down Expand Up @@ -249,7 +254,8 @@ <h3>Nodes status</h3>
dataType:"text json",
cache:false,
success:function(data, textStatus, jqXHR) {
console.log(data, textStatus, jqXHR);

$('#nodes').jqGrid('clearGridData');

var i=0;
$.each(data.nodes,function(i,elt) {
Expand All @@ -276,22 +282,31 @@ <h3>Nodes status</h3>
height: 600,
colNames:['Node','# files', 'size','Uptime', 'Last Update','Free disk','maxKn'],
colModel:[
{name:'node',index:'node', width:200},
{name:'node',index:'node', width:230},
{name:'count',index:'count', width:110, sorttype:"float"},
{name:'size',index:'size', width:110, sorttype:"float"},
{name:'size',index:'size', width:180, sorttype:"float"},
{name:'uptime',index:'uptime', width:90, sorttype:"float"},
{name:'lastUpdate',index:'lastUpdate', width:110, sorttype:"float"},
{name:'df',index:'df', width:160, sorttype:"float"},
{name:'maxKn',index:'maxKn', width:500, sorttype:"float"}
{name:'df',index:'df', width:180, sorttype:"float"},
{name:'maxKn',index:'maxKn', width:400, sorttype:"float"}

],
multiselect: true,
caption: "FSDFS nodes"
});


var globalstatus;
globalstatus = function() {

query("GLOBALSTATUS",{});

setTimeout(function() {
globalstatus();
},parseInt($("#refreshinterval")[0].value)*1000);
}

query("GLOBALSTATUS",{});
globalstatus();

</script>
</body>
Expand Down
Loading

0 comments on commit eee8522

Please sign in to comment.