diff options
author | daita <maxence@pontapreta.net> | 2016-10-31 05:01:45 +0300 |
---|---|---|
committer | daita <maxence@pontapreta.net> | 2016-10-31 05:01:45 +0300 |
commit | 085deaa78ea476196551061116f685613a8c5ffb (patch) | |
tree | b8ec56278af6ffa5a5219615195bfd03563284a5 | |
parent | a3b6f1504fcff0a3798c461568bae416887090d4 (diff) |
Admin UI supports external/encrypted
-rw-r--r-- | js/settings.admin.js | 29 | ||||
-rw-r--r-- | lib/Controller/SettingsController.php | 7 | ||||
-rw-r--r-- | templates/settings.admin.php | 25 |
3 files changed, 41 insertions, 20 deletions
diff --git a/js/settings.admin.js b/js/settings.admin.js index 2e090cb..394874e 100644 --- a/js/settings.admin.js +++ b/js/settings.admin.js @@ -60,7 +60,9 @@ $(document) .is(':checked')) ? 1 : 0, index_files_max_size : $( '#solr_index_files_max_size').val(), - index_files_external_index : ($('#solr_index_files_external_index') + index_files_external : ($('#solr_index_files_external') + .is(':checked')) ? 1 : 0, + index_files_encrypted : ($('#solr_index_files_encrypted') .is(':checked')) ? 1 : 0 } @@ -71,8 +73,12 @@ $(document) data.index_files_live = (data.index_files_live == 1) ? 0 : 1; - if (switched == 'index_files_external_index') - data.index_files_external_index = (data.index_files_external_index == 1) ? 0 + if (switched == 'index_files_external') + data.index_files_external = (data.index_files_external == 1) ? 0 + : 1; + + if (switched == 'index_files_encrypted') + data.index_files_encrypted = (data.index_files_encrypted == 1) ? 0 : 1; $.post(OC.filePath('nextant', 'ajax/settings', @@ -158,9 +164,10 @@ $(document) (response.index_files == 1)); $('#solr_index_files_live').prop('checked', (response.index_files_live == 1)); - $('#solr_index_files_external_index').prop( - 'checked', - (response.index_files_external_index == 1)); + $('#solr_index_files_external').prop('checked', + (response.index_files_external == 1)); + $('#solr_index_files_encrypted').prop('checked', + (response.index_files_encrypted == 1)); $('#solr_index_files_max_size').val( response.index_files_max_size); @@ -444,11 +451,17 @@ $(document) $('#solr_index_files_max_size').on('input', function(e) { nextantSettings.savesuboptions_files(); }); - $('#solr_index_files_external_index') + $('#solr_index_files_external') + .mousedown( + function() { + nextantSettings + .savesuboptions_files('index_files_external'); + }); + $('#solr_index_files_encrypted') .mousedown( function() { nextantSettings - .savesuboptions_files('index_files_external_index'); + .savesuboptions_files('index_files_encrypted'); }); $('#nextant_force_index').on('click', function() { nextantSettings.savesuboptions_status('force_index'); diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 40d3606..35f3791 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -94,7 +94,8 @@ class SettingsController extends Controller 'index_files_needed' => $this->configService->getAppValue('index_files_needed'), 'index_files_max_size' => $this->configService->getAppValue('index_files_max_size'), 'index_files_live' => $this->configService->getAppValue('index_files_live'), - 'index_files_external_index' => $this->configService->getAppValue('index_files_external_index'), + 'index_files_external' => $this->configService->getAppValue('index_files_external'), + 'index_files_encrypted' => $this->configService->getAppValue('index_files_encrypted'), 'display_result' => $this->configService->getAppValue('display_result'), 'current_docs' => $this->solrTools->count('files', $error), 'bookmarks_app_enabled' => (\OCP\App::isEnabled('bookmarks')), @@ -112,11 +113,11 @@ class SettingsController extends Controller return $response; } - public function setOptionsFiles($index_files, $index_files_live, $index_files_max_size, $index_files_external_index) + public function setOptionsFiles($index_files, $index_files_live, $index_files_max_size, $index_files_external, $index_files_encrypted) { $this->configService->setAppValue('index_files', $index_files); $this->configService->setAppValue('index_files_live', $index_files_live); - $this->configService->setAppValue('index_files_external_index', $index_files_external_index); + $this->configService->setAppValue('index_files_external', $index_files_external); $this->configService->setAppValue('index_files_max_size', $index_files_max_size); return $this->updateSubOptions(false, 'files'); diff --git a/templates/settings.admin.php b/templates/settings.admin.php index 8537c94..0500844 100644 --- a/templates/settings.admin.php +++ b/templates/settings.admin.php @@ -94,6 +94,7 @@ style('nextant', 'admin'); style="width: 100px;"></td> </tr> + <tr style="height: 30px;"> <td class="nextant_admin_left"> <?php p($l->t('Live Index :')); ?> @@ -104,22 +105,28 @@ style('nextant', 'admin'); href="https://github.com/daita/nextant/wiki/Extracting,-Live-Update" target="_blank">help</a>)</td> </tr> + + <tr style="height: 30px;"> + <td class="nextant_admin_left"> + <?php p($l->t('Index External Storage :')) ?></td> + <td><input type="checkbox" name="solr_index_files_external" + id="solr_index_files_external" value="1" style="margin: 10px;"></td> + </tr> + + <tr style="height: 30px;"> + <td class="nextant_admin_left"> + <?php p($l->t('Index Encrypted Files :')) ?></td> + <td><input type="checkbox" name="solr_index_files_encrypted" + id="solr_index_files_encrypted" value="1" style="margin: 10px;"></td> + </tr> + <tr style="height: 30px;"> <td class="nextant_admin_left"> <?php p($l->t('Last index :')) ?></td> <td><div id="solr_index_files_last"></div></td> - </tr> - <!-- - <tr style="height: 30px;"> - <td class="nextant_admin_left"> - <?php p($l->t('Index External Storage :')) ?></td> - <td><input type="checkbox" name="solr_index_files_external_index" - id="solr_index_files_external_index" value="1" style="margin: 10px;"></td> - </tr> - --> </table> </div> |