/* Step: Name The first step: the name of the server, with the other Runtime settings (System Settings > Runtime) folded away under Advanced settings for whoever wants to tune them. The values come with system/setup/state (runtime) and are saved through system/bootflags on Continue, so they apply at once and are restored on the next start. A setting given as a start parameter is set by that parameter again on the next start; the step marks it with the parameter's name. */ (function () { "use strict"; var W = window.Wizard, T = W.T, esc = W.esc; //Setting -> start parameter, as bootFlagNames in startup.flags.go var FLAGS = { Hostname: "hostname", MaxUploadSize: "max_upload_size", MaxFileUploadBuff: "upload_buf", FileIOBuffer: "iobuf", EnableGzip: "gzip", DisableIPResolver: "disable_ip_resolver", EnableHomePage: "homepage", EnableDirListing: "dir_list" }; var FIELDS = Object.keys(FLAGS); var NUMBERS = ["MaxUploadSize", "MaxFileUploadBuff", "FileIOBuffer"]; var SWITCHES = ["EnableGzip", "DisableIPResolver", "EnableHomePage", "EnableDirListing"]; var draft = null; //what the form shows, kept when the step redraws var advancedOpen = false; function saved() { return W.state.runtime || {}; } function fromFlag(field) { return (saved().FromStartFlag || []).indexOf(field) >= 0; } function current() { if (!draft) { draft = {}; FIELDS.forEach(function (field) { draft[field] = saved()[field]; }); } return draft; } function flagChip(field) { if (!fromFlag(field)) { return ""; } var tip = T("name/flag/tip", "Set by a start parameter. It replaces the saved value again on the next start unless the parameter is removed."); return ' -' + esc(FLAGS[field]) + ""; } function flagNote(fields) { var flagged = fields.filter(fromFlag); if (!flagged.length) { return ""; } return '
' + esc(T("name/lead", "People see this name when they sign in and in the browser tab, and other devices on your network find the server by it.")) + "
" + '