Skip to content

Commit

Permalink
Merge pull request #3181 from Alex-developer/Point-Release-4
Browse files Browse the repository at this point in the history
Remove experimental display option
  • Loading branch information
Alex-developer authored Dec 12, 2023
2 parents a2e23e3 + c6b9775 commit 14128d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 48 deletions.
10 changes: 0 additions & 10 deletions html/includes/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,6 @@ function DisplayModule() {
</label>
<p class="help-block">Auto enable modules when selected</p>
</div>
</div>
<div class="form-group">
<label for="checkbox" class="control-label col-xs-4"></label>
<div class="col-xs-8">
<label class="checkbox-inline">
<input type="checkbox" name="showexperimental" id="showexperimental">
Show Experimental
</label>
<p class="help-block">Show experimental modules. NOTE: These may be unstable and cause issues</p>
</div>
</div>
<div class="form-group">
<label for="checkbox" class="control-label col-xs-4"></label>
Expand Down
47 changes: 11 additions & 36 deletions html/includes/moduleutil.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private function runRequest() {
}
}

private function readModuleData($moduleDirectory, $type, $event, $showexperimental) {
private function readModuleData($moduleDirectory, $type, $event) {
$arrFiles = array();
$handle = opendir($moduleDirectory);

Expand Down Expand Up @@ -115,19 +115,13 @@ private function readModuleData($moduleDirectory, $type, $event, $showexperiment
} else {
$experimental = false;
}
if (!$showexperimental && $experimental) {
$addModule = false;
} else {
$addModule = true;
}
if ($addModule) {
$arrFiles[$entry] = [
'module' => $entry,
'metadata' => $decoded,
'type' => $type
];
$arrFiles[$entry]['metadata']->experimental = $experimental;
}

$arrFiles[$entry] = [
'module' => $entry,
'metadata' => $decoded,
'type' => $type
];
$arrFiles[$entry]['metadata']->experimental = $experimental;
}
}
}
Expand Down Expand Up @@ -230,11 +224,6 @@ private function readModules() {
$rawConfigData = file_get_contents($configFileName);
$moduleConfig = json_decode($rawConfigData);

$showexperimental = false;
if (isset($moduleConfig->showexperimental) && $moduleConfig->showexperimental) {
$showexperimental = true;
}

$event = $_GET['event'];
$configFileName = ALLSKY_MODULES . '/' . 'postprocessing_' . strtolower($event) . '.json';
$rawConfigData = file_get_contents($configFileName);
Expand All @@ -246,8 +235,8 @@ private function readModules() {
$configData = array();
}

$coreModules = $this->readModuleData($this->allskyModules, "system", $event, $showexperimental);
$userModules = $this->readModuleData($this->userModules, "user", $event, $showexperimental);
$coreModules = $this->readModuleData($this->allskyModules, "system", $event);
$userModules = $this->readModuleData($this->userModules, "user", $event);
$allModules = array_merge($coreModules, $userModules);

$availableResult = [];
Expand Down Expand Up @@ -301,21 +290,7 @@ private function readModules() {
$moduleData['lastexecutionresult'] = '';
}

if (isset($data->metadata->experimental)) {
$experimental = strtolower($data->metadata->experimental) == "true"? true: false;
} else {
$experimental = false;
}

if (!$showexperimental && $experimental) {
$addModule = false;
} else {
$addModule = true;
}

if ($addModule) {
$selectedResult[$selectedName] = $moduleData;
}
$selectedResult[$selectedName] = $moduleData;
};

$restore = false;
Expand Down
2 changes: 0 additions & 2 deletions html/js/modules/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,6 @@ class MODULESEDITOR {
}
$('#enablewatchdog').prop('checked', result.watchdog);
$('#watchdog-timeout').val(result.timeout);
$('#showexperimental').prop('checked', result.showexperimental);
$('#autoenable').prop('checked', result.autoenable);
$('#debugmode').prop('checked', result.debugmode);
$('#periodic-timer').val(result.periodictimer);
Expand All @@ -991,7 +990,6 @@ class MODULESEDITOR {

this.#moduleSettings.watchdog = $('#enablewatchdog').prop('checked');
this.#moduleSettings.timeout = $('#watchdog-timeout').val() | 0;
this.#moduleSettings.showexperimental = $('#showexperimental').prop('checked');
this.#moduleSettings.autoenable = $('#autoenable').prop('checked');
this.#moduleSettings.debugmode = $('#debugmode').prop('checked');

Expand Down

0 comments on commit 14128d9

Please sign in to comment.