Skip to content

Instantly share code, notes, and snippets.

@tasaif
Created June 12, 2019 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tasaif/60785250b59fbf3a9b6faa1a1b08fe8f to your computer and use it in GitHub Desktop.
Save tasaif/60785250b59fbf3a9b6faa1a1b08fe8f to your computer and use it in GitHub Desktop.
parameter "uifolder"="{(data folder of client) as string & "/__UISupport/Verification"}"
parameter "uifile"="{(data folder of client) as string & "/__UISupport/Verification/_dashboard.html"}"
folder create "{parameter "uifolder"}"
delete file "{parameter "uifile"}"
createfile until enddelimiter
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<html>
<head>
<style>
#ui-console {
text-align: center;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(function(){
new_refresh_button = function(){
$retval = $("<div id='ui-console'><button>Refresh</button></div>");
$retval.on("click", function(){
refresh();
});
return $retval;
}
refresh = function(){
$body = $("body");
$body.html("");
var url = "https://webpage.com?computer_id=<?relevance computer id ?>";
$.ajax(url, {
success: function(data, textStatus, jqXHR){
$new_page = $(data);
for(var i=0; i<$new_page.length; i++){
$obj = $new_page[i];
$body.append($obj); /* Helps alleviate (but not elimate) a race condition where resources begin loading before the other is done */
}
$body.append(new_refresh_button());
}
})
}
refresh();
});
</script>
</head>
<body>
</body>
</html>
enddelimiter
copy __createfile "{parameter "uifile"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment