-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from zvercodebender/SSH_on_Windows
Update web site
- Loading branch information
Showing
4 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"> | ||
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script> | ||
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> | ||
<script src="js/authentication.js"></script> | ||
<script src="js/xld-tasks.js"></script> | ||
</head> | ||
<body> | ||
|
||
<!-- =============================================== --> | ||
<div data-role="page" id="login"> | ||
<div data-role="header"> | ||
<h1>Welcome To XL Deploy Task Monitor</h1> | ||
</div> | ||
<div data-role="main" class="ui-content"> | ||
<p>login form</p> | ||
<form method="post" id="loginForm"> | ||
<label for="myUsername">Username:</label> | ||
<input name="myUsername" id="myUsername" value="" type="text"> | ||
<label for="myPassword">Password:</label> | ||
<input name="myPassword" id="myPassword" value="" type="password"> | ||
</form> | ||
<button class="ui-btn ui-corner-all" onClick="authenticate();">Login</button> | ||
<a href="#home" class="ui-btn ui-corner-all">Task List</a> | ||
</div> | ||
</div> | ||
<!-- =============================================== --> | ||
<div data-role="page" id="home"> | ||
<div data-role="header"> | ||
<h1>Welcome To XL Deploy Task Monitor</h1> | ||
</div> | ||
|
||
<div data-role="main" class="ui-content"> | ||
<div id="taskList" data-role="collapsibleset" "data-content-theme="a" data-iconpos='right'> | ||
</div> | ||
<button onClick='getAllTasks();' class="ui-btn">Load Details</button> | ||
</div> | ||
|
||
</div> | ||
<!-- =============================================== --> | ||
<script> | ||
$(document).ready(function(){ | ||
}); | ||
</script> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var username="admin"; | ||
var password="katy4792"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
//$.getScript("js/authentication.js"); | ||
|
||
var myUsername=""; | ||
var myPassword=""; | ||
|
||
function getFormData(dom_query) { | ||
var out = {}; | ||
var s_data = $(dom_query).serializeArray(); | ||
//transform into simple data/value object | ||
for(var i = 0; i<s_data.length; i++) { | ||
var record = s_data[i]; | ||
out[record.name] = record.value; | ||
} | ||
return out; | ||
} | ||
|
||
function authenticate() { | ||
obj = getFormData('#loginForm'); | ||
myUsername = obj.myUsername; | ||
myPassword = obj.myPassword; | ||
console.log( "Username: " + myUsername ); | ||
console.log( "Password: " + myPassword ); | ||
isOK = validateUser( myUsername, myPassword ); | ||
if( isOK == 1 ) { | ||
$.mobile.changePage($("#home"),"slide"); | ||
getAllTasks(); | ||
} | ||
console.log( "isOK: " + isOK ); | ||
} | ||
|
||
function validateUser( u, p ) { | ||
URL="/deployit/security/user/" + u; | ||
results = 0; | ||
$.ajax({ | ||
type: "GET", | ||
url: URL, | ||
username: u, | ||
password: p, | ||
dataType: "xml", | ||
async: false, | ||
success: function ( data, status, jqXHR ) { | ||
results = 1; | ||
} | ||
}); | ||
return results; | ||
} | ||
|
||
function getAllTasks() { | ||
if( validateUser(myUsername, myPassword) == 1 ) { | ||
URL="/deployit/tasts/v2/current/all"; | ||
$.ajax({ | ||
type: "GET", | ||
url: "/deployit/tasks/v2/current/all", | ||
username: username, | ||
password: password, | ||
dataType: "json", | ||
async: false, | ||
success: function ( data, status, jqXHR ) { | ||
html=""; | ||
for( i = 0; i < data.length; i++ ) { | ||
if( data[i].state != "XX EXECUTED" && data[i].state != "XX FAILED" ) { | ||
html=html + "<div data-role=\"collapsible\" data-theme=\"a\">"; | ||
html=html + "<h4>" + data[i].state + " - "; | ||
html=html + data[i].description + "</h4>"; | ||
var steps = data[i].block.steps; | ||
for( j=0; j < steps.length; j++ ) { | ||
html=html + "<div data-role=\"collapsible\" data-theme=\"b\"><h2>" + steps[j].state; | ||
html=html + " - " + steps[j].description + "</h2>"; | ||
html=html + "<code>" + steps[j].log + "</code>"; | ||
html=html + "</div>"; | ||
} | ||
html=html + "</div>"; | ||
} | ||
} | ||
$("#taskList").html( html ).collapsibleset("refresh"); | ||
} | ||
}); | ||
} else { | ||
$.mobile.changePage($("#login"),"slide"); | ||
} | ||
} | ||
|