summaryrefslogblamecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/templates/ipxe-new-boot-entry.html
blob: 8b7b74fcff65328e33d8675a031b5e89c53d2b44 (plain) (tree)
1
2
3
4
5
6
7
               
                                  



                                           
 





                                         







                                                                                 
                                                                                   


                                                   
                                                                                                                                                      
                                                                                             

                                                   
                                                                                                                                                            
                                                                                                 
                                      





                                                                                                                                                                





                                                                              

                                                                                                                                        




                                                           
                                                                                                                                         

                              

                                                                 
                                                              



                                                                     
                                                                                                                        





                                                                                                                             






                                                                                                              
                                                                                                               

                                                                                                            
                                                                                                                                                                                                          

                                                                                                
                                                                                                               

                                                                                                       
                                                                                                                                                                                                  

                                                                                                
                                                                                                                

                                                                                                            
                                                                                                                                                                       
                                                                                                                                      
                                                                              



                                                                                                                                                              
                                                                                                                                                                              


                                                                                                                                                         


                                                                                                                                                              
                                                                                                                                                                          





                                                                                                                                                         
                                                                                                                                                                                





                                                                                                                                                            
                                                                                                                                                                                    


                                                                                                                                                          


























                                                                                                                                                                                                                  



                                                                      








                                                                                               
                                                                                                                              


                                      







                                                                                                                            
                                                                                                                          




                                                                    







                                                                                


                                  





                                                                 

                            


                                                                          
                                                                                                                                              


                                  
                                                          



                                                                                                                      
                                                                                           











                                                                                             

                                                          









                                                                     
           

                                      
                                                             










                                                     


                                                                              

                    
                                          











                                                                                                  

              
{{^oldentryid}}
<h2>{{lang_newBootEntryHead}}</h2>
{{/oldentryid}}
{{#oldentryid}}
	<h2>{{lang_editBootEntryHead}}</h2>
{{/oldentryid}}

{{#builtin}}
	<div class="alert alert-warning">
		{{lang_editBuiltinWarn}}
	</div>
{{/builtin}}

<div class="panel panel-default">
	<div class="panel-heading">
		{{lang_bootEntryData}}
	</div>
	<div class="panel-body">
		<form method="post" action="?do=serversetup">
			<input type="hidden" name="token" value="{{token}}">
			<input type="hidden" name="action" value="savebootentry">
			<input type="hidden" name="entryid" value="{{oldentryid}}">

			<div class="form-group">
				<div class="radio">
					<input class="type-radio" type="radio" name="type" value=".exec" id="type-exec" {{exec_checked}} {{disabled}}>
					<label for="type-exec">{{lang_typeExecEntry}}</label>
				</div>
				<div class="radio">
					<input class="type-radio" type="radio" name="type" value=".script" id="type-script" {{script_checked}} {{disabled}}>
					<label for="type-script">{{lang_typeScriptEntry}}</label>
				</div>
				{{#hooks}}
				<div class="radio">
					<input class="type-radio" type="radio" name="type" value="{{moduleId}}" id="type-{{moduleId}}" {{checked}} {{disabled}}>
					<label for="type-{{moduleId}}">{{name}}</label>
				</div>
				{{/hooks}}
			</div>

			<div class="form-group">
				<label for="input-id">
					{{lang_entryId}} {{lang_idFormatHint}}
				</label>
				<input id="input-id" class="form-control" name="newid" value="{{entryid}}" pattern="^[a-z0-9\-_]{1,16}$"
						 minlength="1" maxlength="16" required {{#builtin}}readonly{{/builtin}} {{disabled}}>
			</div>
			<div class="form-group">
				<label for="input-title">
					{{lang_entryTitle}}
				</label>
				<input id="input-title" class="form-control" name="title" value="{{title}}" maxlength="100" {{disabled}}>
			</div>

			<h4>{{lang_bootEntryDetailsHeading}}</h4>

			<div class="type-form" id="form-exec">
				<div class="form-group">
					<label for="arch-selector">
						{{lang_archSelector}}
					</label>
					<select id="arch-selector" class="form-control" name="entry[arch]" {{disabled}}>
						<option value="agnostic" {{agnostic_selected}}>{{lang_archAgnostic}}</option>
						<option value="PCBIOS" {{PCBIOS_selected}}>{{lang_biosOnly}}</option>
						<option value="EFI" {{EFI_selected}}>{{lang_efiOnly}}</option>
						<option value="PCBIOS-EFI" {{PCBIOS-EFI_selected}}>{{lang_archBoth}}</option>
					</select>
				</div>
				<div class="row">
					{{#entries}}
						<div class="mode-class col-md-6" id="col-{{mode}}">
							<div class="panel panel-default">
								<div class="panel-body">
									<h4 class="arch-heading">{{mode}}</h4>
									<div class="form-group">
										<label for="input-ex-{{mode}}">
											{{lang_imageToLoad}}
										</label>
										<input id="input-ex-{{mode}}" class="form-control" name="entry[{{mode}}][executable]" value="{{executable}}" {{disabled}}>
									</div>
									<div class="form-group">
										<label for="input-rd-{{mode}}">
											{{lang_initRd}}
										</label>
										<input id="input-rd-{{mode}}" class="form-control" name="entry[{{mode}}][initRd]" value="{{initRd}}" {{disabled}}>
									</div>
									<div class="form-group">
										<label for="input-cmd-{{mode}}">
											{{lang_commandLine}}
										</label>
										<input id="input-cmd-{{mode}}" class="form-control" name="entry[{{mode}}][commandLine]"
												 value="{{commandLine}}" {{disabled}}>
									</div>
									<h4>{{lang_ipxeSettings}}</h4>
									<div class="form-group">
										<div class="checkbox checkbox-inline">
											<input id="exec-imgfree-{{mode}}" class="form-control" type="checkbox"
													 name="entry[{{mode}}][imageFree]" {{imageFree_checked}} {{disabled}}>
											<label for="exec-imgfree-{{mode}}">{{lang_execImageFree}}</label>
										</div>
									</div>
									<div class="form-group">
										<div class="checkbox checkbox-inline">
											<input id="exec-replace-{{mode}}" class="form-control" type="checkbox"
													 name="entry[{{mode}}][replace]" {{replace_checked}} {{disabled}}>
											<label for="exec-replace-{{mode}}">{{lang_execReplace}}</label>
										</div>
									</div>
									<div class="form-group">
										<div class="checkbox checkbox-inline">
											<input id="exec-au-{{mode}}" class="form-control" type="checkbox"
													 name="entry[{{mode}}][autoUnload]" {{autoUnload_checked}} {{disabled}}>
											<label for="exec-au-{{mode}}">{{lang_execAutoUnload}}</label>
										</div>
									</div>
									<div class="form-group">
										<div class="checkbox checkbox-inline">
											<input id="exec-reset-{{mode}}" class="form-control" type="checkbox"
													 name="entry[{{mode}}][resetConsole]" {{resetConsole_checked}} {{disabled}}>
											<label for="exec-reset-{{mode}}">{{lang_execResetConsole}}</label>
										</div>
									</div>
									<h4>{{lang_dhcpOverrides}}</h4>
									{{#opts}}
									<div class="form-group">
										<div class="row">
											<div class="col-sm-8">
												<div class="checkbox">
													<input type="checkbox" id="opt-{{mode}}-{{opt}}"
															 name="entry[{{mode}}][dhcpOptions][{{opt}}][override]" {{override_checked}} {{disabled}}>
													<label for="opt-{{mode}}-{{opt}}">
														{{name}} ({{opt}})
													</label>
												</div>
											</div>
											<div class="col-sm-4 text-right">
												<div class="checkbox checkbox-inline">
													<input class="hex-box" type="checkbox" id="opt-{{mode}}-{{opt}}-hex"
															 name="entry[{{mode}}][dhcpOptions][{{opt}}][hex]" {{hex_checked}} {{disabled}}>
													<label for="opt-{{mode}}-{{opt}}-hex">
														{{lang_hex}}
													</label>
												</div>
											</div>
										</div>
										<input type="text" id="opt-{{mode}}-{{opt}}-value" class="form-control hex-value"
												 name="entry[{{mode}}][dhcpOptions][{{opt}}][value]" value="{{value}}" {{disabled}}>
									</div>
									{{/opts}}
								</div>
							</div>
						</div>
					{{/entries}}
				</div>
			</div>

			<div class="type-form" id="form-script">
				<div class="form-group">
					<label for="script-ta">
						{{lang_scriptContent}}
					</label>
					<textarea id="script-ta" class="form-control" rows="10"
								 name="entry[script]" {{disabled}}>{{entry.script}}</textarea>
				</div>
			</div>

			{{#hooks}}
			<div class="type-form" id="form-{{moduleId}}">
				<label for="select-{{moduleId}}">{{name}}</label>
				<div class="form-group">
					<select id="select-{{moduleId}}" class="form-control" name="selection-{{moduleId}}">
						{{#groups}}
						<optgroup label="{{groupName}}">
							{{#entries}}
							<option value="{{id}}" {{selected}} {{disabled}}>{{name}}</option>
							{{/entries}}
						</optgroup>
						{{/groups}}
					</select>
				</div>
				<div class="form-group">
					{{#renderExtraFields.0}}
					<h4>{{lang_hookExtraOptionHeading}}</h4>
					{{/renderExtraFields.0}}
					{{#renderExtraFields}}
					{{{html}}}
					{{/renderExtraFields}}
				</div>
			</div>
			{{/hooks}}

			{{#builtin}}
				<div class="alert alert-warning">
					{{lang_editBuiltinWarn}}
				</div>
			{{/builtin}}

			<hr>

			<p class="slx-bold">{{lang_referencingMenus}}:</p>
			<ul>
			{{#menus}}
				<li><a href="?do=serversetup&amp;show=editmenu&amp;id={{menuid}}&amp;highlight={{entryid}}">{{title}}</a></li>
			{{/menus}}
			</ul>

			<div class="buttonbar text-right">
				<button type="submit" class="btn btn-primary" name="next" value="reload" {{disabled}}>
					<span class="glyphicon glyphicon-floppy-disk"></span>
					{{lang_saveAndReload}}
				</button>
				<button type="submit" class="btn btn-primary" {{disabled}}>
					<span class="glyphicon glyphicon-floppy-disk"></span>
					{{lang_save}}
				</button>
			</div>
		</form>
	</div>
</div>

<script><!--
document.addEventListener('DOMContentLoaded', function () {
	$('.type-radio').click(function () {
		$('.type-form').hide();
		var name = $(this).val().replace('.', '');
		$('#form-' + name).show();
		if (name === 'script') {
			$('[id^=input-ex-]').prop('required', false);
			$('#script-ta').prop('required', true);
		} else if (name === 'exec') {
			$('#arch-selector').change();
			$('#script-ta').prop('required', false);
		} else {
			$('[id^=input-ex-]').prop('required', false);
			$('#script-ta').prop('required', false);
		}
	});
	var $as = $('#arch-selector');
	$as.change(function() {
		$('[id^=input-ex-]').prop('required', false);
		var v = $as.val();
		if (v === 'agnostic') {
			v = 'PCBIOS';
			$('.arch-heading').hide();
		} else {
			$('.arch-heading').show();
		}
		var vs = v.split('-');
		var cols = 12 / vs.length;
		$('.mode-class').hide();
		for (var i = 0; i < vs.length; ++i) {
			const col = $('#col-' + vs[i]);
			col.attr('class', 'mode-class col-md-' + cols).show();
			col.find('[id^=input-ex-]').prop('required',true);
		}
	}).change();
	$('.type-radio[checked]').click();
	var colorize = function() {
		var $t = $(this);
		$t.css('color', ($t.data('hex') && !$t.val().match(/^[a-f0-9]*$/i)) ? 'red' : '');
	};
	var setHex = function() {
		var n = '#' + this.id.replace(/-hex$/, '-value');
		var $obj = $(n);
		$obj.data('hex', this.checked);
		colorize.call($obj[0]);
	};
	$('.hex-box').change(setHex).each(setHex);
	$('.hex-value').change(colorize).keyup(colorize).each(colorize);
});
// --></script>