Skip to content

Commit

Permalink
Merge pull request #3188 from thomasjacquin/Remove-Advanced-Options
Browse files Browse the repository at this point in the history
Remove advanced options
  • Loading branch information
EricClaeys authored Dec 15, 2023
2 parents 70b5178 + e4ef37d commit ff0c090
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 357 deletions.
348 changes: 113 additions & 235 deletions config_repo/options.json.repo

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion html/documentation/changeLog.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@ <h4>Enhancements</h4>
in October, 2023.
<blockquote>Support for the Buster Operating System will be removed
after the next major Allsky release.</blockquote></li>
<li>Added support for the Pi 5.</li>
<li>Increased suggested amount of swap by 1 GB to help minimize timelapse
creation problems.</li>
<li>New camera support:
<ul class="minimalPadding">
<li></li>Arducam IMX462 camera (inexpensive 1920x1080 camera).</li>
<li>Arducam IMX462 camera (inexpensive 1920x1080 camera).</li>
<li>All ZWO cameras as of October 19, 2023 (ZWO SDK 1.32)</li>
</ul>
</li>
<li>The concept of "Advanced Options" no longer exists.
ALL settings are always shown.
</ul>

<h4>Bug Fixes</h4>
Expand All @@ -78,6 +81,10 @@ <h4>Bug Fixes</h4>
is now included in the PATH so you can simply type the name of
any of the scripts in that directory to execute them.
<br>A reboot may be required for this to take affect.
<li>The documentation now specifies to set
<span class="shSetting">IMAGE_DIR</span> to
<code>${ALLSKY_WEBSITE}</code>
when only a local Website exists.
</ul>

<hr class="separator"><!-- =========================================== -->
Expand Down
22 changes: 1 addition & 21 deletions html/documentation/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -363,30 +363,10 @@ table .alert-dismissable {
border-color: #ad5451;
}

.btn-advanced {
border: 2px solid #c9c46a;
}
.btn-advanced:hover {
color: black;
background-color: #e3e3a3;
}
.advanced, .btn-advanced { /* "advanced" options are highlighted in same color as button */
background-color: #fffcc0;
}
.dark .advanced, .dark .btn-advanced {
color: #bfbfbf;
border-color: #bdb173;
background-color: #837a2f;
}
.advanced-nocolor {
background-color: inherit;
}

.dark .btn-primary:hover,
.dark .btn-success:hover,
.dark .btn-warning:hover,
.dark .btn-danger:hover,
.dark .btn-advanced:hover
.dark .btn-danger:hover
{
color: #efefef;
border-color: #d6d6d6;
Expand Down
6 changes: 0 additions & 6 deletions html/documentation/css/documentation.css
Original file line number Diff line number Diff line change
Expand Up @@ -902,12 +902,6 @@ b, strong {
cursor: auto;
pointer-events: none;
}
.btn-advanced {
border: 2px solid #c9c46a;
}
.advanced, .btn-advanced { /* "advanced" options are highlighted in same color as button */
background-color: #fffcc0;
}

.markdown-body .systemPageAdditionsLineType {
font-weight: bold;
Expand Down
3 changes: 0 additions & 3 deletions html/documentation/installations/Allsky.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,6 @@ <h2>Post installation</h2>
</blockquote>

<li>Go to the <span class="WebUILink">Allsky Settings</span> page.
<li>Optionally click the
<span class="btn advanced btn-advanced btn-not-real btn-small">Show advanced options</span> button.
button to show the advanced options.
<li>Make any necessary changes.
<li>Click on the
<span class="btn btn-primary btn-not-real btn-small">Save changes</span> button.
Expand Down
Binary file modified html/documentation/settings/AllskySettingsPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 0 additions & 12 deletions html/documentation/settings/allsky.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ <h2><i class="fa fa-camera fa-fw"></i> <span class="WebUIWebPage">Allsky Setting
This section lists the settings that are updated in the WebUI's
<span class="WebUIWebPage">Allsky Settings</span> page.
A (partial) typical page is below.
The entries highlighted in yellow are Advanced entries that aren't changed very often;
to see them, click on the
<span class="btn advanced btn-advanced btn-not-real btn-small">Show advanced options</span>
button on the top of the page.
Note that in the screenshot below, that button was already pressed so the
<span class="btn advanced btn-advanced btn-not-real btn-small">Hide advanced options</span>
button is shown instead, as well as some advanced settings.
</p>
<img allsky="true" src="AllskySettingsPage.png" class="imgBorder imgCenter" title="Typical Allsky Settings page" alt="AllskySettings" loading="lazy">

Expand Down Expand Up @@ -549,11 +542,6 @@ <h2><i class="fa fa-camera fa-fw"></i> <span class="WebUIWebPage">Allsky Setting
<td>Determines if you need to log into the WebUI.
<b>If you Pi is accessible on the Internet, do NOT disable this!!</b></td>
</tr>
<tr><td><span class="WebUISetting">Always Show Advanced</span></td>
<td>No</td>
<td>Enable to always show the advanced options,
which are typically not used very often, so are hidden.</td>
</tr>

<tr><td class="note" colspan="3">Image overlay settings
<p>See the
Expand Down
9 changes: 2 additions & 7 deletions html/documentation/troubleshooting/ZWOCameras.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ <h2>ASI_ERROR_TIMEOUT Errors</h2>
<span class="WebUISetting">USB Bandwidth</span> setting.
Try increasing and decreasing it, and try turning
<span class="WebUISetting">Auto USB Bandwidth</span> on and off.
You will have to click on the
<span class="btn advanced btn-advanced btn-not-real btn-small">Show advanced options</span>
button at the top of the page in order to view the USB options.
<li>See if the system is in under-voltage mode or is throttling which
could lead to insufficient power getting to the camera.
In the WebUI, go to the <b>System</b> page;
Expand All @@ -125,10 +122,8 @@ <h2>ASI_ERROR_TIMEOUT Errors</h2>
If it does, it's likely a hardware issue.
<li>Revert to the pre-0.8 exposure method.
In the WebUI, click on the <b>Camera Settings</b> link.
At the bottom of the page click on the
<span class="btn advanced btn-advanced btn-not-real btn-small">Show advanced options</span>
button and look for the <span class="WebUISetting">Version 0.8 Exposure</span> setting
and toggle it then click on the
Toggle the <span class="WebUISetting">Version 0.8 Exposure</span> setting
then click on the
<span class="btn btn-primary btn-not-real btn-small">Save changes</span> button.
<li>The above changes work for almost everyone.
If they don't work for you, follow the instructions on the
Expand Down
71 changes: 5 additions & 66 deletions html/includes/allskySettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,64 +243,20 @@ function DisplayAllskyConfig(){
}
}

// Determine if the advanced settings should always be shown.
$errorMsg = "ERROR: Unable to process settings file '$settings_file'.";
$settings_array = get_decoded_json_file($settings_file, true, $errorMsg);
if ($settings_array === null) {
exit;
}
$cameraType = getVariableOrDefault($settings_array, $cameraTypeName, "");
$cameraModel = getVariableOrDefault($settings_array, $cameraModelName, "");
$initial_display = $settings_array['alwaysshowadvanced'] == 1 ? "table-row" : "none";

check_if_configured($page, "settings");

if ($formReadonly != "readonly") {
$settingsDescription = "";
?>
<script language="javascript">
function toggle_advanced()
{
var adv = document.getElementsByClassName("advanced");
var newMode = "";
for (var i=0; i<adv.length; i++) {
// Don't hide the button!
if (adv[i].id != "advButton") {
var s = adv[i].style;
if (s.display == "none") {
newMode = "table-row";
} else {
newMode = "none";
}
s.display = newMode;
}
}

var b = document.getElementById("advButton");
if (newMode == "none") {
// advanced options are now hidden, change button text
b.innerHTML = "Show advanced options...";
} else {
b.innerHTML = "Hide advanced options";
}

// Show/hide the default values.
var def = document.getElementsByClassName("default");
var newMode = "";
for (var i=0; i<def.length; i++) {
var s = def[i].style;
if (s.display == "none") {
newMode = "inline";
} else {
newMode = "none";
}
s.display = newMode;
}
}
<?php
}
?>
</script>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-primary">
Expand All @@ -327,10 +283,6 @@ function toggle_advanced()
<input type="submit" class="btn btn-warning" name="reset_settings"
value="Reset to default values"
onclick="return confirm('Really RESET ALL VALUES TO DEFAULT??');">
<button type="button" class="btn advanced btn-advanced" id="advButton"
onclick="toggle_advanced();">
<?php if ($initial_display == "none") echo "Show advanced options"; else echo "Hide advanced options"; ?>
</button>
<div title="UNcheck to only save settings without restarting Allsky" style="line-height: 0.3em;">
<br>
<input type="checkbox" name="restart" checked> Restart Allsky after saving changes?
Expand All @@ -349,9 +301,6 @@ function toggle_advanced()
$readonlyForm = "";
}

// Allow for "advanced" options that aren't displayed by default to avoid
// confusing novice users.
$numAdvanced = 0;
$numMissing = 0;
$numMissingHasDefault = 0;
$missingSettingsHasDefault = "";
Expand Down Expand Up @@ -387,16 +336,6 @@ function toggle_advanced()

$minimum = getVariableOrDefault($option, 'minimum', "");
$maximum = getVariableOrDefault($option, 'maximum', "");
$advanced = getVariableOrDefault($option, 'advanced', 0);
if ($advanced == 1) {
$numAdvanced++;
$advClass = "advanced";
$advStyle = "display: $initial_display;";
} else {
$advClass = "";
$advStyle = "";
}

$label = getVariableOrDefault($option, 'label', "");

if ($type != "header") {
Expand Down Expand Up @@ -443,13 +382,13 @@ function toggle_advanced()
if ($type == "header") {
// Not sure how to display the header with a background color with 10px
// of white above and below it using only one <tr>.
echo "<tr class='$advClass advanced-nocolor' style='$advStyle height: 10px;'><td colspan='3'></td></tr>";
echo "<tr class='$advClass advanced-nocolor rowSeparator' style='$advStyle'>";
echo "<tr style='height: 10px;'><td colspan='3'></td></tr>";
echo "<tr class='rowSeparator'>";
echo "<td colspan='3' class='settingsHeader' style='padding: 8px 0px;'>$description</td>";
echo "</tr>";
echo "<tr class='$advClass advanced-nocolor rowSeparator' style='$advStyle height: 10px;'><td colspan='3'></td></tr>";
echo "<tr class='rowSeparator' style='height: 10px;'><td colspan='3'></td></tr>";
} else {
echo "<tr class='form-group $advClass $class $warning_class' style='margin-bottom: 0px; $advStyle'>";
echo "<tr class='form-group $class $warning_class' style='margin-bottom: 0px;'>";
// Show the default in a popup
if ($type == "boolean") {
if ($default == "0") $default = "No";
Expand Down Expand Up @@ -544,7 +483,7 @@ function toggle_advanced()

echo "</td>";
if ($type == "widetext")
echo "</tr><tr class='rowSeparator $advClass' style='$advStyle'><td></td>";
echo "</tr><tr class='rowSeparator'><td></td>";
echo "\n\t<td style='padding-left: 10px;'>$warning_msg$description</td>";
}
echo "</tr>";
Expand Down
10 changes: 4 additions & 6 deletions html/includes/createAllskyOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ function add_field($f, $v, $setting) { // field, value, name_of_setting
$options_str .= "$q$v$q";
}

// The "advanced" field comes last in a setting, so don't append a comma to it.
if ($f !== "advanced") $options_str .= ",";
// The "display" field comes last in a setting, so don't append a comma to it.
if ($f !== "display") $options_str .= ",";
$options_str .= "\n";
}

Expand Down Expand Up @@ -315,11 +315,10 @@ function add_options_field($field, $options, $setting) {
// label [string]
// type [string - header, number, text, checkbox, select, readonly]
// options [array with 1 or more entries] (only if "type" == "select")
// display [0/1]
// checkchanges [0/1]
// optional [0/1]
// generic [0/1]
// advanced [0/1] (last, so no comma after it)
// display [0/1]


// ================== Create options file
Expand Down Expand Up @@ -393,11 +392,10 @@ function add_options_field($field, $options, $setting) {
add_non_null_field($repo, "label", $name);
add_non_null_field($repo, "type", $name);
add_non_null_field($repo, "options", $name);
add_non_null_field($repo, "display", $name);
add_non_null_field($repo, "checkchanges", $name);
add_non_null_field($repo, "optional", $name);
add_non_null_field($repo, "generic", $name);
add_non_null_field($repo, "advanced", $name);
add_non_null_field($repo, "display", $name);
$options_str .= "},\n";
}
$options_str .= "]\n\n";
Expand Down

0 comments on commit ff0c090

Please sign in to comment.