-Update with latest iteration of experimentation
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2335 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
e11a84c8e9
commit
192d4aab71
4
xCAT-web-exp/contents.js
Normal file
4
xCAT-web-exp/contents.js
Normal file
@ -0,0 +1,4 @@
|
||||
$(document).ready(function(){
|
||||
$("#alltabs > ul").tabs({spinner: ''});
|
||||
$("#nodetabs > ul").tabs({spinner: ''});
|
||||
});
|
11
xCAT-web-exp/eventlog.html
Normal file
11
xCAT-web-exp/eventlog.html
Normal file
@ -0,0 +1,11 @@
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#eventlogbutton").click(function() {
|
||||
$("#mydisp").text("Would have queried eventlog from "+noderange);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<body>
|
||||
<div id="mydisp"></div>
|
||||
<button id="eventlogbutton">Get Eventlog</button>
|
||||
</body>
|
@ -2,177 +2,51 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>xCAT WebUI</title>
|
||||
<link rel="stylesheet" type="text/css" href="colorscheme.css" />
|
||||
<style type="text/css">
|
||||
span.logstatus {
|
||||
margin-left: 5.5em;
|
||||
}
|
||||
label {
|
||||
text-align: right;
|
||||
width: 5em;
|
||||
float: left;
|
||||
margin-right: 0.5em;
|
||||
display: block;
|
||||
}
|
||||
*#nrtree {
|
||||
width:20%;
|
||||
}
|
||||
*#logout {
|
||||
position:absolute;
|
||||
top:0;
|
||||
right:0;
|
||||
margin-left:1em;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.xcatbutton button {
|
||||
margin: .5em .5em .5em 8px;
|
||||
color: #555555;
|
||||
background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
|
||||
font-size: 0.7em;
|
||||
border: 1px solid #d3d3d3;
|
||||
cursor: pointer;
|
||||
padding: .2em .6em .3em .6em;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
.xcatbutton button:hover {
|
||||
color: #212121;
|
||||
background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
|
||||
border: 1px solid #999999;
|
||||
}
|
||||
.xcatbutton button:active {
|
||||
color: #222222;
|
||||
background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
</style>
|
||||
<link rel="stylesheet" type="text/css" href="theme.css" />
|
||||
<link rel="stylesheet" type="text/css" href="xcatwebui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="tree_component.css" />
|
||||
<script type="text/javascript" src="css.js"></script>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="jquery.listen.js"></script>
|
||||
<script type="text/javascript" src="tree_component.js"></script>
|
||||
<script type="text/javascript" src="jquery.ui.js"></script>
|
||||
<script type="text/javascript">
|
||||
var logdialog;
|
||||
var nrtree;
|
||||
function openlogdialog (data, textstatus) { //open the log in dialog if not logged in
|
||||
if (data.authenticated == "no") {
|
||||
logdialog.dialog("open");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function logincallback (data, textstatus) {
|
||||
$("#password").val(""); //clear the password field regardless of what happens
|
||||
if (data.authenticated == "yes") {
|
||||
$("#logstatus").text("Logged in successfully");
|
||||
nrtree.refresh(); // Fix tree potentiall broken through attempts to operate without auth
|
||||
logdialog.dialog("close");
|
||||
} else {
|
||||
$("#logstatus").text("Authentication failure");
|
||||
$("#logstatus").css("color","#ff0000");
|
||||
}
|
||||
}
|
||||
function logout () {
|
||||
$.post("log.php",{logout:1})
|
||||
$("#logstatus").html("");
|
||||
logdialog.dialog("open");
|
||||
}
|
||||
|
||||
function login() {
|
||||
$("#logstatus").css("color","#000000");
|
||||
$("#logstatus").html('Authenticating...<img src="images/throbber.gif"/>');
|
||||
var passwd=$("#password").val();
|
||||
$.post("log.php",{
|
||||
username: $("#username").val(),
|
||||
password: passwd
|
||||
},logincallback,"json");
|
||||
}
|
||||
function updatenoderange() {
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
nrtree = new tree_component(); // -Tree begin
|
||||
nrtree.init($("#nrtree"),{
|
||||
rules: {
|
||||
multiple: "Ctrl"
|
||||
},
|
||||
ui: {
|
||||
animation: 250
|
||||
},
|
||||
callback : {
|
||||
onchange : updatenoderange
|
||||
},
|
||||
data : {
|
||||
type : "json",
|
||||
async : "true",
|
||||
url: "noderangesource.php"
|
||||
}
|
||||
}); //Tree finish
|
||||
|
||||
logdialog=$("#logdialog").dialog({
|
||||
modal: true,
|
||||
closeOnEscape: false,
|
||||
overlay: {
|
||||
backgroundColor: "#000",
|
||||
opacity: 0.75
|
||||
|
||||
},
|
||||
height: 200,
|
||||
width: 350,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Log In": login
|
||||
},
|
||||
open: function(type, dialog) {
|
||||
if (document.location.protocol == "http:") {
|
||||
$("#logstatus").html("Unencrypted Session!");
|
||||
$("#logstatus").css("color","#ff0000");
|
||||
}
|
||||
if ($("#username").val() == "") {
|
||||
$("#username").focus();
|
||||
} else {
|
||||
$("#password").focus();
|
||||
}
|
||||
},
|
||||
close: function(type, dialog) {
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#username").keydown(function(event) {
|
||||
if (event.keyCode==13) {
|
||||
$("#password").focus();
|
||||
}
|
||||
});
|
||||
$("#password").keydown(function(event) {
|
||||
if (event.keyCode==13) {
|
||||
login();
|
||||
}
|
||||
});
|
||||
$("#login").click(function(event) {
|
||||
login();
|
||||
});
|
||||
$("#logout").click(function(event) {
|
||||
logout();
|
||||
});
|
||||
$.post("log.php",{},openlogdialog,"json");
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="xcatauth.js"></script>
|
||||
<script type="text/javascript" src="noderangetree.js"></script>
|
||||
<script type="text/javascript" src="contents.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="nrdisplay">Noderange:</div>
|
||||
<div id="nrtree"></div>
|
||||
<!-- The omnipresent login dialog, waiting to be called forth by javascript -->
|
||||
<div id="logdialog">
|
||||
<form id="loginform" method="post" action="login.php">
|
||||
<label for="username">Username:</label><input id="username" type="text" name="username"><br/>
|
||||
<label for="password">Password:</label><input id="password" type="password" name="password"></form>
|
||||
<span class="logstatus" id="logstatus"><br/></span>
|
||||
</div>
|
||||
<!-- Log out control -->
|
||||
<!-- Log out control -->
|
||||
<!-- The omnipresent login dialog, waiting to be called forth by javascript -->
|
||||
<div id="logdialog">
|
||||
<form id="loginform" method="post" action="login.php">
|
||||
<label for="username">Username:</label><input id="username" type="text" name="username"><br/>
|
||||
<label for="password">Password:</label><input id="password" type="password" name="password"></form>
|
||||
<span class="logstatus" id="logstatus"><br/></span>
|
||||
</div>
|
||||
|
||||
<div id="header">xCAT
|
||||
<div id="logout" class="xcatbutton"><button>Log Out</button></div>
|
||||
</div>
|
||||
<div id="alltabs">
|
||||
<ul>
|
||||
<li><a href="#nodepanels" title="actionpane"><span>Nodes</span></a></li>
|
||||
<li><a href="tables.html" title="actionpane"><span>Tables</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="actionpane"></div>
|
||||
<div id="nodepanels">
|
||||
<!-- To place/constrain the noderange tree -->
|
||||
<div id="nrtree"></div>
|
||||
<div id="nodearea">
|
||||
<div id="nodetabs">
|
||||
<ul>
|
||||
<li><a href="vitals.html" title="nodepane">Sensors</a></li>
|
||||
<li><a href="eventlog.html" title="nodepane">Eventlog</a></li>
|
||||
<li><a href="inventory.html" title="nodepane">Inventory</a><li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="nodepane"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
11
xCAT-web-exp/inventory.html
Normal file
11
xCAT-web-exp/inventory.html
Normal file
@ -0,0 +1,11 @@
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#rinvbutton").click(function() {
|
||||
$("#mydisp").text("Would have queried inv from "+noderange);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<body>
|
||||
<div id="mydisp"></div>
|
||||
<button id="rinvbutton">Get Inventory</button>
|
||||
</body>
|
30
xCAT-web-exp/noderangetree.js
Normal file
30
xCAT-web-exp/noderangetree.js
Normal file
@ -0,0 +1,30 @@
|
||||
var noderange="";
|
||||
function updatenoderange() {
|
||||
myselection=nrtree.selected_arr;
|
||||
noderange="";
|
||||
for (node in myselection) {
|
||||
noderange+=myselection[node][0].id;
|
||||
}
|
||||
noderange=noderange.substring(1);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
nrtree = new tree_component(); // -Tree begin
|
||||
nrtree.init($("#nrtree"),{
|
||||
rules: {
|
||||
multiple: "Ctrl"
|
||||
},
|
||||
ui: {
|
||||
animation: 250
|
||||
},
|
||||
callback : {
|
||||
onchange : updatenoderange
|
||||
},
|
||||
data : {
|
||||
type : "json",
|
||||
async : "true",
|
||||
url: "noderangesource.php"
|
||||
}
|
||||
}); //Tree finish
|
||||
});
|
1
xCAT-web-exp/tables.html
Normal file
1
xCAT-web-exp/tables.html
Normal file
@ -0,0 +1 @@
|
||||
This would be some sort of table oriented pane I suppose...
|
11
xCAT-web-exp/vitals.html
Normal file
11
xCAT-web-exp/vitals.html
Normal file
@ -0,0 +1,11 @@
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#vitality").click(function() {
|
||||
$("#mydisp").text("Would have rvitals against "+noderange);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<body>
|
||||
<div id="mydisp"></div>
|
||||
<button id="vitality">Get Vitals</button>
|
||||
</body>
|
86
xCAT-web-exp/xcatauth.js
Normal file
86
xCAT-web-exp/xcatauth.js
Normal file
@ -0,0 +1,86 @@
|
||||
/* xCAT WebUI authentication handling functions/setup */
|
||||
/* IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html */
|
||||
function openlogdialog (data, textstatus) { //open the log in dialog if not logged in
|
||||
if (data.authenticated == "no") {
|
||||
logdialog.dialog("open");
|
||||
}
|
||||
}
|
||||
|
||||
function onlogin (data, textstatus) {
|
||||
$("#password").val(""); //clear the password field regardless of what happens
|
||||
if (data.authenticated == "yes") {
|
||||
$("#logstatus").text("Logged in successfully");
|
||||
nrtree.refresh(); // Fix tree potentiall broken through attempts to operate without auth
|
||||
logdialog.dialog("close");
|
||||
} else {
|
||||
$("#logstatus").text("Authentication failure");
|
||||
$("#logstatus").css("color","#ff0000");
|
||||
}
|
||||
}
|
||||
|
||||
function logout () {
|
||||
$.post("log.php",{logout:1})
|
||||
$("#logstatus").html("");
|
||||
logdialog.dialog("open");
|
||||
}
|
||||
|
||||
function authenticate() {
|
||||
$("#logstatus").css("color","#000000");
|
||||
$("#logstatus").html('Authenticating...<img src="images/throbber.gif"/>');
|
||||
var passwd=$("#password").val();
|
||||
$.post("log.php",{
|
||||
username: $("#username").val(),
|
||||
password: passwd
|
||||
},onlogin,"json");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
logdialog=$("#logdialog").dialog({
|
||||
modal: true,
|
||||
closeOnEscape: false,
|
||||
closebutton: false,
|
||||
overlay: {
|
||||
backgroundColor: "#000",
|
||||
opacity: 1
|
||||
|
||||
},
|
||||
height: 200,
|
||||
width: 350,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Log In": authenticate
|
||||
},
|
||||
open: function(type, dialog) {
|
||||
if (document.location.protocol == "http:") {
|
||||
$("#logstatus").html("Unencrypted Session!");
|
||||
$("#logstatus").css("color","#ff0000");
|
||||
}
|
||||
if ($("#username").val() == "") {
|
||||
$("#username").focus();
|
||||
} else {
|
||||
$("#password").focus();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
$("#username").keydown(function(event) { //When 'enter' is hit while in username, advance to password
|
||||
if (event.keyCode==13) {
|
||||
$("#password").focus();
|
||||
}
|
||||
});
|
||||
$("#password").keydown(function(event) { //Submit authentication if enter is pressed in password field
|
||||
if (event.keyCode==13) {
|
||||
authenticate();
|
||||
}
|
||||
});
|
||||
|
||||
$("#login").click(function(event) { //Also authenticate when 'log in' button is activated
|
||||
authenticate();
|
||||
});
|
||||
|
||||
$("#logout").click(function(event) { //Bind the button with logout id to our logout function
|
||||
logout();
|
||||
});
|
||||
|
||||
$.post("log.php",{},openlogdialog,"json"); //Determine if authentication dialog is currently needed on load
|
||||
});
|
68
xCAT-web-exp/xcatwebui.css
Normal file
68
xCAT-web-exp/xcatwebui.css
Normal file
@ -0,0 +1,68 @@
|
||||
span.logstatus {
|
||||
margin-left: 5.5em;
|
||||
}
|
||||
label {
|
||||
text-align: right;
|
||||
width: 5em;
|
||||
float: left;
|
||||
margin-right: 0.5em;
|
||||
display: block;
|
||||
}
|
||||
div#header {
|
||||
border-bottom: 1px solid #d3d3d3;
|
||||
vertical-align: middle;
|
||||
top:0;
|
||||
left:0;
|
||||
width:100%;
|
||||
height:1.8em;
|
||||
z-index:2;
|
||||
}
|
||||
|
||||
#nodetabs {
|
||||
float: left;
|
||||
}
|
||||
#nodearea {
|
||||
float: left;
|
||||
right: 0;
|
||||
}
|
||||
#nodepane: {
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
#nrtree {
|
||||
float: left;
|
||||
clear: left;
|
||||
border-right: 1px solid #d3d3d3;
|
||||
border-top: 1px solid #d3d3d3;
|
||||
height:100%;
|
||||
width:9.5em;
|
||||
}
|
||||
#logout {
|
||||
position:absolute;
|
||||
top:0;
|
||||
right:0;
|
||||
margin-left:1em;
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
}
|
||||
.xcatbutton button {
|
||||
margin: .5em .5em .5em 8px;
|
||||
color: #555555;
|
||||
background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
|
||||
font-size: 0.7em;
|
||||
border: 1px solid #d3d3d3;
|
||||
cursor: pointer;
|
||||
padding: .2em .6em .3em .6em;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
.xcatbutton button:hover {
|
||||
color: #212121;
|
||||
background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
|
||||
border: 1px solid #999999;
|
||||
}
|
||||
.xcatbutton button:active {
|
||||
color: #222222;
|
||||
background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user