mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 14:11:21 +00:00
Style improvements, moved connection-related JavaScript code to own file.
This commit is contained in:
@@ -66,8 +66,8 @@
|
|||||||
<!-- Connection list UI -->
|
<!-- Connection list UI -->
|
||||||
<div id="connection-list-ui" style="display: none">
|
<div id="connection-list-ui" style="display: none">
|
||||||
|
|
||||||
<div id="logout">
|
<div id="logout-panel">
|
||||||
<a href="logout">Logout</a>
|
<button id="logout">Logout</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1>
|
<h1>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
<table class="connections">
|
<table class="connections">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="protocol">Protocol</th>
|
<th class="protocol"> </th>
|
||||||
<th class="name">Name</th>
|
<th class="name">Name</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -92,40 +92,11 @@
|
|||||||
Guacamole ${project.version}
|
Guacamole ${project.version}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="scripts/connections.js"></script>
|
||||||
|
|
||||||
<!-- Init -->
|
<!-- Init -->
|
||||||
<script type="text/javascript"> /* <![CDATA[ */
|
<script type="text/javascript"> /* <![CDATA[ */
|
||||||
|
|
||||||
function Config(protocol, id) {
|
|
||||||
this.protocol = protocol;
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getConfigList() {
|
|
||||||
|
|
||||||
// Get config list
|
|
||||||
var xhr = new XMLHttpRequest();
|
|
||||||
xhr.open("GET", "configs", false);
|
|
||||||
xhr.send(null);
|
|
||||||
|
|
||||||
// If fail, throw error
|
|
||||||
if (xhr.status != 200)
|
|
||||||
throw new Error(xhr.statusText);
|
|
||||||
|
|
||||||
// Otherwise, get list
|
|
||||||
var configs = new Array();
|
|
||||||
|
|
||||||
var configElements = xhr.responseXML.getElementsByTagName("config");
|
|
||||||
for (var i=0; i<configElements.length; i++) {
|
|
||||||
configs.push(new Config(
|
|
||||||
configElements[i].getAttribute("protocol"),
|
|
||||||
configElements[i].getAttribute("id")
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
return configs;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetUI() {
|
function resetUI() {
|
||||||
|
|
||||||
var configs;
|
var configs;
|
||||||
@@ -192,6 +163,11 @@
|
|||||||
var loginForm = document.getElementById("login-form");
|
var loginForm = document.getElementById("login-form");
|
||||||
var loginUI = document.getElementById("login-ui");
|
var loginUI = document.getElementById("login-ui");
|
||||||
var connectionListUI = document.getElementById("connection-list-ui");
|
var connectionListUI = document.getElementById("connection-list-ui");
|
||||||
|
var logout = document.getElementById("logout");
|
||||||
|
|
||||||
|
logout.onclick = function() {
|
||||||
|
window.location.href = "logout";
|
||||||
|
};
|
||||||
|
|
||||||
// TODO: Get connection list
|
// TODO: Get connection list
|
||||||
// On no-auth fail, show login UI
|
// On no-auth fail, show login UI
|
||||||
|
32
guacamole/src/main/webapp/scripts/connections.js
Normal file
32
guacamole/src/main/webapp/scripts/connections.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
|
||||||
|
function Config(protocol, id) {
|
||||||
|
this.protocol = protocol;
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getConfigList() {
|
||||||
|
|
||||||
|
// Get config list
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("GET", "configs", false);
|
||||||
|
xhr.send(null);
|
||||||
|
|
||||||
|
// If fail, throw error
|
||||||
|
if (xhr.status != 200)
|
||||||
|
throw new Error(xhr.statusText);
|
||||||
|
|
||||||
|
// Otherwise, get list
|
||||||
|
var configs = new Array();
|
||||||
|
|
||||||
|
var configElements = xhr.responseXML.getElementsByTagName("config");
|
||||||
|
for (var i=0; i<configElements.length; i++) {
|
||||||
|
configs.push(new Config(
|
||||||
|
configElements[i].getAttribute("protocol"),
|
||||||
|
configElements[i].getAttribute("id")
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
return configs;
|
||||||
|
|
||||||
|
}
|
@@ -177,6 +177,7 @@ div#connection-list-ui table tbody tr {
|
|||||||
div#connection-list-ui table td {
|
div#connection-list-ui table td {
|
||||||
padding: 0.25em;
|
padding: 0.25em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#connection-list-ui table td.name {
|
div#connection-list-ui table td.name {
|
||||||
@@ -205,8 +206,19 @@ div#connection-list-ui img {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#logout {
|
div#logout-panel {
|
||||||
padding: 0.5em;
|
padding: 0.25em;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div#connection-list-ui a[href] {
|
||||||
|
text-decoration: none;
|
||||||
|
color: black;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#connection-list-ui a[href]:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user