Skip to content

Commit e68f3e7

Browse files
author
Rick Broker
committed
Merge pull request #2 from zvercodebender/SSH_on_Windows
Update web site
2 parents a4920c8 + cad9664 commit e68f3e7

File tree

4 files changed

+135
-0
lines changed

4 files changed

+135
-0
lines changed

xld-tasklist/README.md

Whitespace-only changes.

xld-tasklist/src/html/index.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta name="viewport" content="width=device-width, initial-scale=1">
5+
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
6+
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
7+
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
8+
<script src="js/authentication.js"></script>
9+
<script src="js/xld-tasks.js"></script>
10+
</head>
11+
<body>
12+
13+
<!-- =============================================== -->
14+
<div data-role="page" id="login">
15+
<div data-role="header">
16+
<h1>Welcome To XL Deploy Task Monitor</h1>
17+
</div>
18+
<div data-role="main" class="ui-content">
19+
<p>login form</p>
20+
<form method="post" id="loginForm">
21+
<label for="myUsername">Username:</label>
22+
<input name="myUsername" id="myUsername" value="" type="text">
23+
<label for="myPassword">Password:</label>
24+
<input name="myPassword" id="myPassword" value="" type="password">
25+
</form>
26+
<button class="ui-btn ui-corner-all" onClick="authenticate();">Login</button>
27+
<a href="#home" class="ui-btn ui-corner-all">Task List</a>
28+
</div>
29+
</div>
30+
<!-- =============================================== -->
31+
<div data-role="page" id="home">
32+
<div data-role="header">
33+
<h1>Welcome To XL Deploy Task Monitor</h1>
34+
</div>
35+
36+
<div data-role="main" class="ui-content">
37+
<div id="taskList" data-role="collapsibleset" "data-content-theme="a" data-iconpos='right'>
38+
</div>
39+
<button onClick='getAllTasks();' class="ui-btn">Load Details</button>
40+
</div>
41+
42+
</div>
43+
<!-- =============================================== -->
44+
<script>
45+
$(document).ready(function(){
46+
});
47+
</script>
48+
</body>
49+
</html>
50+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var username="admin";
2+
var password="katy4792";
3+
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
//$.getScript("js/authentication.js");
2+
3+
var myUsername="";
4+
var myPassword="";
5+
6+
function getFormData(dom_query) {
7+
var out = {};
8+
var s_data = $(dom_query).serializeArray();
9+
//transform into simple data/value object
10+
for(var i = 0; i<s_data.length; i++) {
11+
var record = s_data[i];
12+
out[record.name] = record.value;
13+
}
14+
return out;
15+
}
16+
17+
function authenticate() {
18+
obj = getFormData('#loginForm');
19+
myUsername = obj.myUsername;
20+
myPassword = obj.myPassword;
21+
console.log( "Username: " + myUsername );
22+
console.log( "Password: " + myPassword );
23+
isOK = validateUser( myUsername, myPassword );
24+
if( isOK == 1 ) {
25+
$.mobile.changePage($("#home"),"slide");
26+
getAllTasks();
27+
}
28+
console.log( "isOK: " + isOK );
29+
}
30+
31+
function validateUser( u, p ) {
32+
URL="/deployit/security/user/" + u;
33+
results = 0;
34+
$.ajax({
35+
type: "GET",
36+
url: URL,
37+
username: u,
38+
password: p,
39+
dataType: "xml",
40+
async: false,
41+
success: function ( data, status, jqXHR ) {
42+
results = 1;
43+
}
44+
});
45+
return results;
46+
}
47+
48+
function getAllTasks() {
49+
if( validateUser(myUsername, myPassword) == 1 ) {
50+
URL="/deployit/tasts/v2/current/all";
51+
$.ajax({
52+
type: "GET",
53+
url: "/deployit/tasks/v2/current/all",
54+
username: username,
55+
password: password,
56+
dataType: "json",
57+
async: false,
58+
success: function ( data, status, jqXHR ) {
59+
html="";
60+
for( i = 0; i < data.length; i++ ) {
61+
if( data[i].state != "XX EXECUTED" && data[i].state != "XX FAILED" ) {
62+
html=html + "<div data-role=\"collapsible\" data-theme=\"a\">";
63+
html=html + "<h4>" + data[i].state + " - ";
64+
html=html + data[i].description + "</h4>";
65+
var steps = data[i].block.steps;
66+
for( j=0; j < steps.length; j++ ) {
67+
html=html + "<div data-role=\"collapsible\" data-theme=\"b\"><h2>" + steps[j].state;
68+
html=html + " - " + steps[j].description + "</h2>";
69+
html=html + "<code>" + steps[j].log + "</code>";
70+
html=html + "</div>";
71+
}
72+
html=html + "</div>";
73+
}
74+
}
75+
$("#taskList").html( html ).collapsibleset("refresh");
76+
}
77+
});
78+
} else {
79+
$.mobile.changePage($("#login"),"slide");
80+
}
81+
}
82+

0 commit comments

Comments
 (0)