Skip to content

Commit 1ec5d29

Browse files
committed
Improvements to initial setup page/process
1 parent 87dd120 commit 1ec5d29

File tree

4 files changed

+69
-21
lines changed

4 files changed

+69
-21
lines changed

www/index.php

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ function PageSetup() {
196196
RemoteVolumeControlChange(this.value);
197197
});
198198

199+
SetupHostnameBanner();
199200
SetupBanner();
200201
};
201202

@@ -222,6 +223,34 @@ function SetupBanner() {
222223
}
223224
}
224225

226+
function HostnameConfirmed() {
227+
SetSetting("hostnameConfirmed", "True", 2);
228+
$("#bannerHostnameRow").hide();
229+
}
230+
231+
function SetupHostnameBanner() {
232+
let showHostnameBanner = false;
233+
console.log(settings.hasOwnProperty('hostnameConfirmed'));
234+
if (!(settings.hasOwnProperty('hostnameConfirmed') && $settings["HostName"] == "FPP")) {
235+
showHostnameBanner = true;
236+
}
237+
238+
if (showHostnameBanner) {
239+
$("#bannerHostnameRow").html(
240+
"Your hostname is set to FPP, if you have multiple FPP devices " +
241+
"each one should have a different hostname. " +
242+
"Please visit the " +
243+
"<a href=\"networkconfig.php#tab-host-dns\">Host Settings Page</a> " +
244+
" to change your hostname." +
245+
"<div style='margin-top:1em'><button class='buttons wideButton " +
246+
"btn-outline-light' onClick='HostnameConfirmed();'>Dismiss Warning</button></div>"
247+
).show();
248+
} else {
249+
$("#bannerHostnameRow").hide();
250+
}
251+
252+
}
253+
225254
function SetSpeakerIndicator(value) {
226255
var speaker = $('#speaker');
227256
var speaker_d_flex = $('#speaker_d_flex');
@@ -380,6 +409,7 @@ function NextPlaylistEntry() {
380409
<div id="warningsDiv"></div>
381410
</div>
382411
</div>
412+
<div id="bannerHostnameRow" class="alert alert-info"></div>
383413
<div id="bannerRow" class="alert alert-info">Banner Messages go here.</div>
384414
<div id="programControl" class="settings">
385415

@@ -712,4 +742,4 @@ class="col-4 d-flex flex-grow-1 align-items-center">
712742
</div>
713743
</body>
714744

715-
</html>
745+
</html>

www/initialSetup.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,24 @@ function UpdateChildSettingsVisibility() {
141141
?>
142142
<b>System Settings</b><br>
143143
<?
144-
144+
PrintSettingGroup('initialSetup', '', '', 1, '', '', false);
145+
?>
146+
<b>Privacy Settings</b><br>
147+
<?
145148
$extraData = "<div class='form-actions'>" .
146-
"<input type='button' class='buttons' value='Preview Statistics' onClick='PreviewStatistics();'> ";
149+
"<input type='button' class='buttons' value='Preview Statistics' onClick='PreviewStatistics();'> </div>";
150+
PrintSettingGroup('initialSetup-privacy', $extraData, '', '', '', '', false);
151+
?>
152+
<b>Location Settings</b><br>
153+
<?
154+
$extraData = "<div class='form-actions'>";
147155
if ($settings["Platform"] != "MacOS") {
148156
$extraData .= "<input type='button' class='buttons' value='Lookup Time Zone' onClick='GetTimeZone();'> ";
149157
}
150158
$extraData .= "<input type='button' class='buttons' value='Lookup Location' onClick='GetGeoLocation();'> " .
151159
"<input type='button' class='buttons' value='Show On Map' onClick='ViewLatLon();'> " .
152160
"</div>";
153-
154-
PrintSettingGroup('initialSetup', $extraData, '', 1, '', '', false);
161+
PrintSettingGroup('initialSetup-location', '', $extraData, '', '', '', false);
155162
?>
156163

157164
</div>
@@ -161,4 +168,4 @@ function UpdateChildSettingsVisibility() {
161168
</div>
162169
</body>
163170

164-
</html>
171+
</html>

www/networkconfig.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -938,9 +938,12 @@ function dhcpServerEnabledCallback() {
938938
</div>
939939
<div class="tab-pane fade" id="tab-host-dns" role="tabpanel" aria-labelledby="tab-host-dns-tab">
940940

941-
941+
<h2>Host Settings</h2>
942+
<b>Changing the hostname from FPP will cause http://fpp.local/ to change and you will need to use the new hostname eg http://&lthostname&gt.local/</b>
943+
<br>
944+
<br>
942945
<?
943-
PrintSettingGroup('host');
946+
PrintSettingGroup('host','','','','','',false);
944947
?>
945948

946949

@@ -1007,4 +1010,4 @@ class="newInterfaceName" value="">
10071010
</div>
10081011
</body>
10091012

1010-
</html>
1013+
</html>

www/settings.json

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,22 @@
100100
"description": "Initial Setup",
101101
"settings": [
102102
"fppMode",
103-
"HostName",
104-
"HostDescription",
105-
"emailAddress",
106-
"statsPublish",
103+
"InstalledCape"
104+
]
105+
},
106+
"initialSetup-privacy": {
107+
"description": "Privacy Setup",
108+
"settings": [
107109
"ShareCrashData",
110+
"emailAddress",
108111
"FetchVendorLogos",
109112
"SendVendorSerial",
110-
"InstalledCape",
113+
"statsPublish"
114+
]
115+
},
116+
"initialSetup-location": {
117+
"description": "Location Setup",
118+
"settings": [
111119
"Locale",
112120
"TimeZone",
113121
"Latitude",
@@ -1927,13 +1935,13 @@
19271935
},
19281936
"osPasswordEnable": {
19291937
"name": "osPasswordEnable",
1930-
"description": "Set OS password",
1938+
"description": "OS password",
19311939
"tip": "Changing the OS password is not normally needed unless your FPP instance is connected to a public network. The default password is 'falcon', but you may select 'Custom' to allow choosing a custom password. The OS password can always be changed via the FPP UI even if you do not remember the OS password.",
19321940
"gatherStats": true,
19331941
"type": "select",
19341942
"options": {
1935-
"Default (falcon)": "0",
1936-
"Custom": "1"
1943+
"falcon (Default)": "0",
1944+
"Enter a Password": "1"
19371945
},
19381946
"onChange": "ConfirmOSPasswordEnable",
19391947
"children": {
@@ -1977,13 +1985,13 @@
19771985
},
19781986
"passwordEnable": {
19791987
"name": "passwordEnable",
1980-
"description": "Enable UI password",
1988+
"description": "UI password",
19811989
"tip": "Enabling UI Password is not normally needed unless you are connected to a public network. If you set a UI password, you will need to make sure that you remember this password so you and other applications, like xLights, will be able to access the UI when needed. Select 'Disabled' to disable password protection. Select 'Enabled' to allow choosing a UI password",
19821990
"gatherStats": true,
19831991
"type": "select",
19841992
"options": {
1985-
"Disabled": "0",
1986-
"Enabled": "1"
1993+
"No Password (Default)": "0",
1994+
"Enter a Password": "1"
19871995
},
19881996
"onChange": "ConfirmPasswordEnable",
19891997
"children": {
@@ -2498,4 +2506,4 @@
24982506
]
24992507
}
25002508
}
2501-
}
2509+
}

0 commit comments

Comments
 (0)