mirror of
https://github.com/hrfee/jellyfin-accounts.git
synced 2025-12-16 15:31:13 +00:00
Self-restarting for config changes
When changing settings that need restart, the option is now available to
do it automatically. Functions on linux at least, might need testing on
windows.
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
A user was created using code {{ code }}.
|
||||
|
||||
Name: {{ username }}
|
||||
Address: {{ address }}
|
||||
Time: {{ time }}
|
||||
|
||||
Note: Notification emails can be toggled on the admin dashboard.
|
||||
@@ -1,10 +0,0 @@
|
||||
Hi {{ username }},
|
||||
|
||||
Someone has recently requests a password reset on Jellyfin.
|
||||
If this was you, enter the below pin into the prompt.
|
||||
This code will expire on {{ expiry_date }}, at {{ expiry_time }} , which is in {{ expires_in }}.
|
||||
If this wasn't you, please ignore this email.
|
||||
|
||||
PIN: {{ pin }}
|
||||
|
||||
{{ message }}
|
||||
@@ -1,5 +0,0 @@
|
||||
Invite expired.
|
||||
|
||||
Code {{ code }} expired at {{ expiry }}.
|
||||
|
||||
Note: Notification emails can be toggled on the admin dashboard.
|
||||
@@ -1,8 +0,0 @@
|
||||
Hi,
|
||||
You've been invited to Jellyfin.
|
||||
To join, follow the below link.
|
||||
This invite will expire on {{ expiry_date }}, at {{ expiry_time }}, which is in {{ expires_in }}, so act quick.
|
||||
|
||||
{{ invite_link }}
|
||||
|
||||
{{ message }}
|
||||
@@ -214,18 +214,31 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="restartModal" role="dialog" aria-labelledby"Restart Warning" aria-hidden="true">
|
||||
<div class="modal fade" id="restartModal" role="dialog" aria-labelledby="Restart Warning" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Warning</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>A restart is needed to apply some settings. This must be done manually. Apply now?</p>
|
||||
<p>A restart is needed to apply some settings. Restart now, later, or cancel?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-primary" id="applyRestarts" data-dismiss="alert">Apply</button>
|
||||
<button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-secondary" id="applyRestarts" data-dismiss="modal">Apply, Restart later</button>
|
||||
<button type="button" class="btn btn-primary" id="applyAndRestart" data-dismiss="modal">Apply & Restart</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="refreshModal" role="dialog" aria-labelledby="Refresh page notice" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Settings applied.</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Refresh the page in a few seconds.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -157,6 +157,7 @@ var settingsModal = createModal('settingsMenu');
|
||||
var userDefaultsModal = createModal('userDefaults');
|
||||
var usersModal = createModal('users');
|
||||
var restartModal = createModal('restartModal');
|
||||
var refreshModal = createModal('refreshModal');
|
||||
|
||||
// Parsed invite: [<code>, <expires in _>, <1: Empty invite (no delete/link), 0: Actual invite>, <email address>, <remaining uses>, [<used-by>], <date created>, <notify on expiry>, <notify on creation>]
|
||||
function parseInvite(invite, empty = false) {
|
||||
@@ -961,8 +962,12 @@ document.getElementById('openSettings').onclick = function () {
|
||||
|
||||
triggerTooltips();
|
||||
|
||||
function sendConfig(modalId) {
|
||||
function sendConfig(modalId, restart = false) {
|
||||
let modal = document.getElementById(modalId);
|
||||
modifiedConfig['restart-program'] = false;
|
||||
if (restart) {
|
||||
modifiedConfig['restart-program'] = true;
|
||||
}
|
||||
let send = JSON.stringify(modifiedConfig);
|
||||
let req = new XMLHttpRequest();
|
||||
req.open("POST", "/modifyConfig", true);
|
||||
@@ -975,6 +980,8 @@ function sendConfig(modalId) {
|
||||
if (modalId != 'settingsMenu') {
|
||||
settingsModal.hide();
|
||||
}
|
||||
} else if (restart) {
|
||||
refreshModal.show();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1010,7 +1017,8 @@ document.getElementById('settingsSave').onclick = function() {
|
||||
}
|
||||
}
|
||||
if (restart_setting_changed) {
|
||||
document.getElementById('applyRestarts').onclick = function(){sendConfig('restartModal');};
|
||||
document.getElementById('applyRestarts').onclick = function(){ sendConfig('restartModal'); };
|
||||
document.getElementById('applyAndRestart').onclick = function(){ sendConfig('restartModal', restart=true); };
|
||||
settingsModal.hide();
|
||||
restartModal.show();
|
||||
} else if (settings_changed) {
|
||||
|
||||
@@ -355,7 +355,7 @@
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title">Finished!</h5>
|
||||
<p class="card-text">
|
||||
Press the button below to submit your settings. The program will quit, so run it again, then refresh this page.
|
||||
Press the button below to submit your settings. The program will restart. Once it's done, refresh this page.
|
||||
</p>
|
||||
<button id="submitButton" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user