Skip to content

Commit de597fc

Browse files
committed
Remove scan option ScanOnlyNewFiles
1 parent 027a905 commit de597fc

File tree

3 files changed

+1
-28
lines changed

3 files changed

+1
-28
lines changed

lib/Settings/VaasAdmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function getForm(): TemplateResponse
2929
'vaasUrl' => $this->config->getAppValue(self::APP_ID, 'vaasUrl', 'wss://gateway.staging.vaas.gdatasecurity.de'),
3030
'quarantineFolder' => $this->config->getAppValue(self::APP_ID, 'quarantineFolder', 'Quarantine'),
3131
'autoScanFiles' => $this->config->getAppValue(self::APP_ID, 'autoScanFiles', false),
32-
'scanOnlyNewFiles' => $this->config->getAppValue(self::APP_ID, 'scanOnlyNewFiles', false),
32+
'scanOnlyNewFiles' => $this->config->getAppValue(self::APP_ID, 'scanOnlyNewFiles', true),
3333
'prefixMalicious' => $this->config->getAppValue(self::APP_ID, 'prefixMalicious', true),
3434
'disableUnscannedTag' => $this->config->getAppValue(self::APP_ID, 'disableUnscannedTag', false),
3535
'allowlist' => $this->config->getAppValue(self::APP_ID, 'allowlist'),

src/admin-settings.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ document.addEventListener('DOMContentLoaded', async () => {
2727
const authSubmitAdvanced = document.querySelector('#auth_submit_advanced');
2828
const resetAllTags = document.querySelector('#reset');
2929
const autoScanFiles = document.querySelector('#auto_scan_files');
30-
const scanOnlyNew = document.querySelector('#scan_only_new');
3130
const prefixMalicious = document.querySelector('#prefixMalicious');
3231
const authMethod = document.querySelector('#authMethod');
3332
const disableUnscannedTag = document.querySelector('#disable_tag_unscanned');
@@ -94,10 +93,6 @@ document.addEventListener('DOMContentLoaded', async () => {
9493
await toggleAutoScan(autoScanFiles.checked);
9594
});
9695

97-
scanOnlyNew.addEventListener('click', async () => {
98-
await toggleScanOnlyNew(scanOnlyNew.checked);
99-
});
100-
10196
prefixMalicious.addEventListener('click', async () => {
10297
await postData(OC.generateUrl('apps/gdatavaas/setPrefixMalicious'), {prefixMalicious: prefixMalicious.checked});
10398
});
@@ -106,21 +101,10 @@ document.addEventListener('DOMContentLoaded', async () => {
106101
await postData(OC.generateUrl('apps/gdatavaas/setDisableUnscannedTag'), {disableUnscannedTag: disableUnscannedTag.checked});
107102
});
108103

109-
// Activate or deactivate scanning only for new files
110-
const toggleScanOnlyNew = async (enable) => {
111-
scanOnlyNew.checked = enable;
112-
scanOnlyNew.disabled = !autoScanFiles.checked;
113-
const response = await postData(OC.generateUrl('apps/gdatavaas/setScanOnlyNewFiles'), {scanOnlyNewFiles: enable});
114-
if (response.status !== "success") {
115-
OC.Notification.showTemporary(`An Error occurred when ${enable ? 'activating' : 'deactivating'} scanning only for new files.`);
116-
}
117-
};
118-
119104
// Activate or deactivate automatic file scanning
120105
const toggleAutoScan = async (enable) => {
121106
autoScanFiles.checked = enable;
122107
const response = await postData(OC.generateUrl('apps/gdatavaas/setAutoScan'), {autoScanFiles: enable});
123-
await toggleScanOnlyNew(enable);
124108
if (response.status !== "success") {
125109
OC.Notification.showTemporary(`An Error occurred when ${enable ? 'activating' : 'deactivating'} automatic file scanning.`);
126110
}
@@ -130,12 +114,8 @@ document.addEventListener('DOMContentLoaded', async () => {
130114
const autoScanResponse = await getData(OC.generateUrl('apps/gdatavaas/getAutoScan'));
131115
if (autoScanResponse.status) {
132116
autoScanFiles.checked = true;
133-
scanOnlyNew.disabled = false;
134-
const scanOnlyNewResponse = await getData(OC.generateUrl('apps/gdatavaas/getScanOnlyNewFiles'));
135-
scanOnlyNew.checked = scanOnlyNewResponse.status;
136117
} else {
137118
autoScanFiles.checked = false;
138-
await toggleScanOnlyNew(false);
139119
}
140120
prefixMalicious.checked = (await getData(OC.generateUrl('apps/gdatavaas/getPrefixMalicious'))).status;
141121
disableUnscannedTag.checked = (await getData(OC.generateUrl('apps/gdatavaas/getDisableUnscannedTag'))).status;

templates/admin.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,6 @@
9292
</td>
9393
<td><label for="auto_scan"><?php p($l->t('Automatic file scanning'));?></label></td>
9494
</tr>
95-
<tr id="scan_option_only_new">
96-
<td>
97-
<input id="scan_only_new" class="toggle-round" type="checkbox">
98-
<label for="scan_only_new"></label>
99-
</td>
100-
<td><div title="<?php p($l->t('Automatically scans only files that have not yet been scanned. When switched off, files that have already been scanned are scanned again at random, but unscanned files are prioritized.'));?>" class="visible"><label for="scan_new"><?php p($l->t('Scan only new files'));?></label></div></td>
101-
</tr>
10295
<tr>
10396
<td>
10497
<input id="prefixMalicious" class="toggle-round" type="checkbox">

0 commit comments

Comments
 (0)