Skip to content
Snippets Groups Projects
Commit a917ece3 authored by Marco Malavolti's avatar Marco Malavolti
Browse files

Enriched GUI with parameters

parent a9eb4450
No related branches found
No related tags found
No related merge requests found
// Global URL // Needed to draw the ECCS2 DataTable
//var url = "/eccs2/api/eccsresults?eccsdt=1";
var url = "/eccs2/api/eccsresults?eccsdt=1&date=" + document.getElementById("myDate").value;
var table; var table;
var url = "/eccs2/api/eccsresults?eccsdt=1";
// PHP Variables retrieved from eccs2.php
// idp (entityID of the IdP)
// date (date time of the check)
// reg_auth (the IdP RegistrationAuthority)
// status (the ECCS2 IdP Status)
if (date) {
url = url.concat("&date=" + date);
}
if (reg_auth) {
url = url.concat("&reg_auth=" + reg_auth);
}
if (idp) {
url = url.concat("&idp=" + idp);
}
if (status) {
url = url.concat("&status=" + status);
}
function getPastResults() {
url = "/eccs2/api/eccsresults?eccsdt=1&date=" + document.getElementById("myDate").value;
table.ajax.url( url ).load();
var getUrl = window.location;
var baseUrl = getUrl .protocol + "//" + getUrl.host + "/" + getUrl.pathname.split('/')[1];
document.location.href = baseUrl;
}
// use URL constructor and return hostname // use URL constructor and return hostname
function getHostname(url) { function getHostname(url) {
...@@ -59,11 +87,6 @@ function format ( d ) { ...@@ -59,11 +87,6 @@ function format ( d ) {
'</table>'; '</table>';
} }
function getPastResults() {
url = "/eccs2/api/eccsresults?eccsdt=1&date=" + document.getElementById("myDate").value;
table.ajax.url( url ).load();
}
$(document).ready(function() { $(document).ready(function() {
// Setup - add a text input to each footer cell // Setup - add a text input to each footer cell
$('#eccstable thead tr').clone(true).appendTo( '#eccstable thead' ); $('#eccstable thead tr').clone(true).appendTo( '#eccstable thead' );
...@@ -87,7 +110,7 @@ $(document).ready(function() { ...@@ -87,7 +110,7 @@ $(document).ready(function() {
"url": url, "url": url,
"dataSrc": "" "dataSrc": ""
}, },
"lengthMenu": [[10, 20, 30, 40, 50, 100, -1], [10, 20, 30, 40, 50, 100, "All"]], "lengthMenu": [[10, 30, 50, 100, -1], [10, 30, 50, 100, "All"]],
"autoWidth": false, "autoWidth": false,
"dom": '<"top"lip>rt<"bottom"><"clear">', "dom": '<"top"lip>rt<"bottom"><"clear">',
"columns": [ "columns": [
......
...@@ -8,8 +8,15 @@ $firstDate = str_replace($str2strip, "", $firstFile); ...@@ -8,8 +8,15 @@ $firstDate = str_replace($str2strip, "", $firstFile);
$files = scandir($directory, SCANDIR_SORT_DESCENDING); $files = scandir($directory, SCANDIR_SORT_DESCENDING);
$lastFile = $files[0]; $lastFile = $files[0];
$lastDate = str_replace($str2strip, "", $lastFile); $lastDate = str_replace($str2strip, "", $lastFile);
$data = array();
$data['firstDate'] = $firstDate;
$data['lastDate'] = $lastDate;
$data['idp'] = htmlspecialchars($_GET["idp"]);
$data['reg_auth'] = htmlspecialchars($_GET["reg_auth"]);
$data['date'] = htmlspecialchars($_GET["date"]);
$data['status'] = htmlspecialchars($_GET["status"]);
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
...@@ -29,8 +36,8 @@ $lastDate = str_replace($str2strip, "", $lastFile); ...@@ -29,8 +36,8 @@ $lastDate = str_replace($str2strip, "", $lastFile);
<input type="checkbox" name="status" value="ERROR">ERROR</input> <input type="checkbox" name="status" value="ERROR">ERROR</input>
<input type="checkbox" name="status" value="OK">OK</input> <input type="checkbox" name="status" value="OK">OK</input>
<input type="checkbox" name="status" value="DISABLED">DISABLED</input> <input type="checkbox" name="status" value="DISABLED">DISABLED</input>
<button style="float:right;" onclick="getPastResults()">Go</button> <button id="goButton" onclick="getPastResults()">Go</button>
<input style="float:right;" type="date" id="myDate" min="<?php echo $firstDate ?>" max="<?php echo $lastDate ?>" value="<?php echo $lastDate ?>"/> <input id="myDate" type="date" id="myDate" min="<?php echo $data['firstDate'] ?>" max="<?php echo $data['lastDate'] ?>" value="<?php echo $data['lastDate'] ?>"/>
</div> </div>
<hr> <hr>
<button id="btn-show-all-children" type="button">Expand All</button> <button id="btn-show-all-children" type="button">Expand All</button>
...@@ -50,6 +57,12 @@ $lastDate = str_replace($str2strip, "", $lastFile); ...@@ -50,6 +57,12 @@ $lastDate = str_replace($str2strip, "", $lastFile);
</thead> </thead>
</table> </table>
</div> </div>
<script type="text/javascript">
var date = "<?php echo $data['date'] ?>";
var reg_auth = "<?php echo $data['reg_auth'] ?>";
var idp = "<?php echo $data['idp'] ?>";
var status = "<?php echo $data['status'] ?>";
</script>
<script type="text/javascript" src="script.js" /></script> <script type="text/javascript" src="script.js" /></script>
</body> </body>
</html> </html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment