mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-25 04:22:49 +00:00
Add reset user config button
This commit is contained in:
parent
89840790e7
commit
ef63342e20
3 changed files with 55 additions and 19 deletions
|
@ -61,7 +61,7 @@
|
|||
{{#each config}}
|
||||
{{#if groupdoc}}
|
||||
<div class="card bg-light mb-3">
|
||||
<div class="card-header"><button class="btn btn-link collapsed" type="button" data-toggle="collapse"
|
||||
<div class="card-header"><button type="button" class="btn btn-link collapsed" data-toggle="collapse"
|
||||
data-target="#g_{{group}}">{{groupdoc}}</button></div>
|
||||
<div id="g_{{group}}" class="card-body collapse" data-parent="#config-form">
|
||||
{{#each elements}}
|
||||
|
@ -95,6 +95,7 @@
|
|||
{{/if}}
|
||||
{{/each}}
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
<button type="button" class="btn btn-danger float-right" onclick="deleteConfig();">Reset defaults</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -176,6 +177,19 @@
|
|||
"Error saving config", data);
|
||||
return false;
|
||||
}
|
||||
function deleteConfig() {
|
||||
var input = prompt("This will remove all user configurations, and restore the defaults and the " +
|
||||
"values set by the environment. This operation could be dangerous. Type 'DELETE' to proceed:");
|
||||
if (input === "DELETE") {
|
||||
_post("/admin/config/delete",
|
||||
"Config deleted correctly",
|
||||
"Error deleting config");
|
||||
} else {
|
||||
alert("Wrong input, please try again")
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
function masterCheck(check_id, inputs_query) {
|
||||
function toggleEnabled(check_id, inputs_query, enabled) {
|
||||
$(inputs_query).prop("disabled", !enabled)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue