diff options
Diffstat (limited to 'modules/serversetup/templates')
-rw-r--r-- | modules/serversetup/templates/ipaddress.html | 34 | ||||
-rw-r--r-- | modules/serversetup/templates/ipxe.html | 149 | ||||
-rw-r--r-- | modules/serversetup/templates/ipxe_update.html | 20 |
3 files changed, 203 insertions, 0 deletions
diff --git a/modules/serversetup/templates/ipaddress.html b/modules/serversetup/templates/ipaddress.html new file mode 100644 index 00000000..e4967703 --- /dev/null +++ b/modules/serversetup/templates/ipaddress.html @@ -0,0 +1,34 @@ +<div class="panel panel-default"> + <div class="panel-heading"> + {{lang_bootAddress}} + </div> + <div class="panel-body"> + <p> + {{lang_chooseIP}} + </p> + <form method="post" action="?do=ServerSetup"> + <input type="hidden" name="action" value="ip"> + <input type="hidden" name="token" value="{{token}}"> + <table class="slx-table"> + {{#ips}} + <tr> + <td>{{ip}}</td> + {{#default}} + <td> + <span class="btn btn-success btn-xs"><span class="glyphicon glyphicon-ok"></span> {{lang_active}}</span> + </td> + {{/default}} + {{^default}} + <td> + <button class="btn btn-primary btn-xs" name="ip" value="{{ip}}"><span class="glyphicon glyphicon-flag"></span> {{lang_set}}</button> + </td> + {{/default}} + </tr> + {{/ips}} + </table> + <p> + {{lang_bootHint}} + </p> + </form> + </div> +</div>
\ No newline at end of file diff --git a/modules/serversetup/templates/ipxe.html b/modules/serversetup/templates/ipxe.html new file mode 100644 index 00000000..54d7db16 --- /dev/null +++ b/modules/serversetup/templates/ipxe.html @@ -0,0 +1,149 @@ +<div class="panel panel-default"> + <div class="panel-heading"> + {{lang_mountIpxe}} + </div> + <div class="panel-body"> + <p>{{lang_ipxeInfo}}</p> + <label for="ext">{{lang_extension}}:</label> + <select name="ext" class="form-control"> + <option value="kkpxe">.kkpxe</option> + <option value="usb">.usb</option> + <option value="iso">.iso</option> + </select> + <br> + <form method="post" action="?do=ServerSetup" style="display:inline;"> + <input type="hidden" name="action" value="save-script"> + <input type="hidden" name="token" value="{{token}}"> + + <label for="custom-script">{{lang_customScript}}</label> + <textarea class="form-control" name="custom-script" rows="9" style="resize:none">{{script}}</textarea> + <br> + <input class="btn btn-default btn-sm" type="submit" value="{{lang_saveScript}}" /> + </form> + <form method="post" action="?do=ServerSetup" style="display:inline;"> + <input type="hidden" name="action" value="default-script"> + <input type="hidden" name="token" value="{{token}}"> + <input class="btn btn-default btn-sm" type="submit" value="{{lang_restoreDefault}}" /> + </form> + </div> + <div class="panel-footer"> + <button id="mount-button" onclick="mountIpxe();" class="btn btn-primary" type="button" data-toggle="modal" data-target="#ipxe-modal" data-backdrop="static"> {{lang_compile}} + </button> + </div> +</div> + +<form method="post" action="?do=ServerSetup"> + <input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;"> + <input type="password" name="password_fake" id="password_fake" value="" style="display:none;"> + <input type="hidden" name="action" value="ipxe"> + <input type="hidden" name="token" value="{{token}}"> + <div class="panel panel-default"> + <div class="panel-heading"> + {{lang_bootMenu}} + </div> + <div class="panel-body"> + <p> + {{lang_bootInfo}} + </p> + <br> + + <div class="form-group"> + <strong>{{lang_bootBehavior}}</strong> + <div><label class="radio-inline"><input type="radio" name="defaultentry" value="net" {{active-net}}> bwLehrpool</label></div> + <div><label class="radio-inline"><input type="radio" name="defaultentry" value="hdd" {{active-hdd}}> {{lang_localHDD}}</label></div> + <div><label class="radio-inline"><input type="radio" name="defaultentry" value="custom" {{active-custom}}> {{lang_customEntry}} ("custom")</label></div> + </div> + + <div class="form-group"> + <strong>{{lang_menuDisplayTime}}</strong> + <div class="input-group form-narrow"> + <input type="text" class="form-control" name="timeout" value="{{timeout}}" pattern="\d+"> + <span class="input-group-addon">{{lang_seconds}}</span> + </div> + </div> + + <div class="form-group"> + <strong>{{lang_masterPassword}}</strong> + <div class="form-narrow"> + <input type="{{password_type}}" class="form-control" name="masterpassword" value="{{masterpasswordclear}}"> + </div> + <i>{{lang_masterPasswordHelp}}</i> + </div> + + <div class="form-group"> + <strong>{{lang_menuCustom}}</strong> <a class="btn btn-default btn-xs" data-toggle="modal" data-target="#help-custom"><span class="glyphicon glyphicon-question-sign"></span></a> + <textarea class="form-control" name="custom" rows="8">{{custom}}</textarea> + </div> + </div> + + <div class="panel-footer"> + <button class="btn btn-primary" name="action" value="ipxe">{{lang_bootMenuCreate}}</button> + </div> + </div> +</form> + +<div class="modal fade" id="help-custom" tabindex="-1" role="dialog"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header">{{lang_menuCustom}}</div> + <div class="modal-body"> + {{lang_menuCustomHint1}} + <br>{{lang_example}}: + <pre>LABEL custom + MENU LABEL ^My Boot Entry + KERNEL http://1.2.3.4/kernel + INITRD http://1.2.3.4/initramfs-stage31 + APPEND custom=option + IPAPPEND 3</pre> + {{lang_menuCustomHint2}} LABEL <strong>custom</strong> + {{lang_menuCustomHint3}} + </div> + <div class="modal-footer"><a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a></div> + </div> + </div> +</div> + +<div class="modal fade" id="ipxe-modal" tabindex="-1" role="dialog" aria-labelledby="ipxe-modal-label" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> + <h4 class="modal-title" id="ipxe-modal-label">{{lang_compilingIpxe}}</h4> + </div> + <div class="modal-body" id="ipxe-modal-body"> + + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button> + <button id="download-btn" type="button" class="btn btn-primary" disabled="disabled" onclick="downloadIpxe()">{{lang_download}}</button> + </div> + </div> + </div> +</div> + +<script> + function mountIpxe() { + document.getElementById('ipxe-modal-body').innerHTML = "<div class='alert alert-info' role='alert'>{{lang_ipxeWarning}}</div>" + + "{{lang_loading}} <img src='fonts/loader.gif'/>"; + $("#download-btn").prop("disabled",true); + var xmlhttp = new XMLHttpRequest(); + var extension = $("select[name=ext]").val(); + xmlhttp.open("GET","?do=ServerSetup&async=true&submitTask=true&extension=" + extension,true); + xmlhttp.onreadystatechange= function() { + if (xmlhttp.readyState==4 && xmlhttp.status==200) { + var initResponse = xmlhttp.responseText; + if(initResponse != "success") + document.getElementById('ipxe-modal-body').innerHTML = initResponse; + else { + document.getElementById('ipxe-modal-body').innerHTML = "{{lang_success}}: ipxe." + extension; + $("#download-btn").prop("disabled",false); + } + } + } + xmlhttp.send(); + } + + function downloadIpxe() { + window.location = "?do=ServerSetup&download=" + $("select[name=ext]").val(); + } +</script> diff --git a/modules/serversetup/templates/ipxe_update.html b/modules/serversetup/templates/ipxe_update.html new file mode 100644 index 00000000..9c598667 --- /dev/null +++ b/modules/serversetup/templates/ipxe_update.html @@ -0,0 +1,20 @@ +<div class="panel panel-default"> + <div class="panel-heading">{{lang_menuGeneration}}</div> + <div class="panel-body"> + <div data-tm-id="{{taskid}}" data-tm-log="error" data-tm-callback="restartCb">{{lang_menuGeneration}}</div> + <div id="genfailed" class="alert alert-danger" style="display:none"> + {{lang_generationFailed}} + </div> + </div> +</div> + +<script type="text/javascript"> + function restartCb(task) + { + if (!task || !task.statusCode) + return; + if (task.statusCode === 'TASK_ERROR') { + $('#genfailed').show('slow'); + } + } +</script> |