mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-10-05 09:53:21 +08:00
Add support for setting stacks when creating session (#138)
* Add support for setting stacks when creating session * Add exec endpoint and move dns stuff to another package * Rename command and status code
This commit is contained in:
BIN
www/assets/button.png
Normal file
BIN
www/assets/button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
@@ -11,6 +11,7 @@
|
||||
<h2>We're bypassing the Captcha and redirecting you now..</h2>
|
||||
<form id="welcomeFormBypass" method="POST" action="/">
|
||||
<button id="start" type="submit">Start Session</button>
|
||||
<input id="stack" type="hidden" name="stack" value=""/>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
@@ -21,4 +22,20 @@
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script>
|
||||
|
||||
<script src="/assets/app.js"></script>
|
||||
<script>
|
||||
function getParameterByName(name, url) {
|
||||
if (!url) url = window.location.href;
|
||||
name = name.replace(/[\[\]]/g, "\\$&");
|
||||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
||||
results = regex.exec(url);
|
||||
if (!results) return null;
|
||||
if (!results[2]) return '';
|
||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
var stack = getParameterByName('stack');
|
||||
if (stack) {
|
||||
document.getElementById('stack').value = stack;
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
@@ -14,6 +14,7 @@
|
||||
<form id="welcomeForm" method="POST" action="/">
|
||||
<div id="recaptcha" class="g-recaptcha" data-callback="iAmHuman" data-sitekey="{{.}}"></div>
|
||||
<input type="hidden" name="session-duration" value="4h"/>
|
||||
<input id="stack" type="hidden" name="stack" value=""/>
|
||||
<button id="create" style="display:none;">Create session</button>
|
||||
</form>
|
||||
<img src="/assets/large_h.png" />
|
||||
@@ -23,6 +24,20 @@
|
||||
function iAmHuman(resp) {
|
||||
document.getElementById('welcomeForm').submit();
|
||||
}
|
||||
function getParameterByName(name, url) {
|
||||
if (!url) url = window.location.href;
|
||||
name = name.replace(/[\[\]]/g, "\\$&");
|
||||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
||||
results = regex.exec(url);
|
||||
if (!results) return null;
|
||||
if (!results[2]) return '';
|
||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
var stack = getParameterByName('stack');
|
||||
if (stack) {
|
||||
document.getElementById('stack').value = stack;
|
||||
}
|
||||
if (document.cookie.indexOf('session_id') > -1) {
|
||||
document.getElementById('create').style = "";
|
||||
document.getElementById('recaptcha').style = "display:none;";
|
||||
|
Reference in New Issue
Block a user