setting for saving credentials

pull/1856/head
antelle 2021-04-25 23:17:14 +02:00
parent fe9ff205b9
commit 29e5c14009
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
3 changed files with 27 additions and 0 deletions

View File

@ -782,5 +782,8 @@
"extensionConnectAskGet": "Ask before returning passwords to the extension:",
"extensionConnectAskGetMultiple": "if there's more than one match",
"extensionConnectAskGetAlways": "always",
"extensionConnectAskSave": "Ask before saving new passwords to KeeWeb:",
"extensionConnectAskSaveAlways": "always",
"extensionConnectAskSaveAuto": "when it's not possible to save automatically",
"extensionConnectSettingsAreForSession": "Settings you select here are valid only for the active session. You can view and manage sessions in KeeWeb settings."
}

View File

@ -21,6 +21,7 @@ class SettingsBrowserView extends View {
'change .check-enable-for-browser': 'changeEnableForBrowser',
'change .settings__browser-focus-if-locked': 'changeFocusIfLocked',
'change .settings__browser-session-ask-get': 'changeSessionAskGet',
'change .settings__browser-session-ask-save': 'changeSessionAskSave',
'change .settings__browser-session-file-check': 'changeSessionFileAccess',
'click .settings__browser-btn-terminate-session': 'terminateSession'
};
@ -42,6 +43,7 @@ class SettingsBrowserView extends View {
...session,
fileAccess,
noFileAccess: fileAccess && !fileAccess.some((f) => f.checked),
showAskSave: session.permissions?.askSave !== undefined,
connectedDate: DateFormat.dtStr(session.connectedDate)
};
})
@ -162,6 +164,13 @@ class SettingsBrowserView extends View {
BrowserExtensionConnector.setClientPermissions(clientId, { askGet });
}
changeSessionAskSave(e) {
const clientId = e.target.dataset.clientId;
const askSave = e.target.value;
BrowserExtensionConnector.setClientPermissions(clientId, { askSave });
}
changeSessionFileAccess(e) {
const clientId = e.target.dataset.clientId;
const fileId = e.target.dataset.fileId;

View File

@ -142,6 +142,21 @@
</option>
</select>
</div>
{{#if session.showAskSave}}
<div>
<label for="settings__browser-session-ask-save--{{session.connectionId}}">{{res 'extensionConnectAskSave'}}</label>
<select id="settings__browser-session-ask-save--{{session.connectionId}}"
data-client-id="{{session.clientId}}"
class="settings__browser-session-ask-save settings__select input-base">
<option value="always" {{#ifeq session.permissions.askSave 'always'}}selected{{/ifeq}}>
{{res 'extensionConnectAskSaveAlways'}}
</option>
<option value="auto" {{#ifeq session.permissions.askSave 'auto'}}selected{{/ifeq}}>
{{res 'extensionConnectAskSaveAuto'}}
</option>
</select>
</div>
{{/if}}
{{/if}}
{{#if session.passwordsRead}}<p>{{res 'setBrowserSessionsPasswordsRead'}}: {{session.passwordsRead}}</p>{{/if}}
{{#if session.passwordsWritten}}<p>{{res 'setBrowserSessionsPasswordsWritten'}}: {{session.passwordsWritten}}</p>{{/if}}