|
|
@ -647,35 +647,42 @@ document.getElementById('openAbout').onclick = function() {
|
|
|
|
aboutModal.show();
|
|
|
|
aboutModal.show();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('openDefaultsWizard').onclick = function() {
|
|
|
|
function populateRadios() {
|
|
|
|
this.disabled = true
|
|
|
|
|
|
|
|
this.innerHTML =
|
|
|
|
|
|
|
|
'<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true" style="margin-right: 0.5rem;"></span>' +
|
|
|
|
|
|
|
|
'Loading...';
|
|
|
|
|
|
|
|
let req = new XMLHttpRequest();
|
|
|
|
|
|
|
|
req.responseType = 'json';
|
|
|
|
|
|
|
|
req.open("GET", "/getUsers", true);
|
|
|
|
|
|
|
|
req.setRequestHeader("Authorization", "Basic " + btoa(window.token + ":"));
|
|
|
|
|
|
|
|
req.onreadystatechange = function() {
|
|
|
|
|
|
|
|
if (this.readyState == 4) {
|
|
|
|
|
|
|
|
if (this.status == 200) {
|
|
|
|
|
|
|
|
let users = req.response['users'];
|
|
|
|
|
|
|
|
let radioList = document.getElementById('defaultUserRadios');
|
|
|
|
let radioList = document.getElementById('defaultUserRadios');
|
|
|
|
radioList.textContent = '';
|
|
|
|
radioList.textContent = '';
|
|
|
|
let first = true;
|
|
|
|
let first = true;
|
|
|
|
for (user of users) {
|
|
|
|
for (user of jfUsers) {
|
|
|
|
let radio = document.createElement('div');
|
|
|
|
let radio = document.createElement('div');
|
|
|
|
radio.classList.add('radio');
|
|
|
|
radio.classList.add('form-check');
|
|
|
|
let checked = 'checked';
|
|
|
|
let checked = 'checked';
|
|
|
|
if (first) {
|
|
|
|
if (first) {
|
|
|
|
first = false;
|
|
|
|
first = false;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
checked = '';
|
|
|
|
checked = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
radio.innerHTML =
|
|
|
|
// radio.innerHTML =
|
|
|
|
`<label><input type="radio" name="defaultRadios" id="default_${user['id']}" style="margin-right: 1rem;" ${checked}>${user['name']}</label>`;
|
|
|
|
// `<label><input type="radio" name="defaultRadios" id="default_${user['id']}" style="margin-right: 1rem;" ${checked}>${user['name']}</label>`;
|
|
|
|
|
|
|
|
radio.innerHTML = `
|
|
|
|
|
|
|
|
<input class="form-check-input" type="radio" name="defaultRadios" id="default_${user['id']}" ${checked}>
|
|
|
|
|
|
|
|
<label class="form-check-label" for="default_${user['id']}">${user['name']}</label>`;
|
|
|
|
radioList.appendChild(radio);
|
|
|
|
radioList.appendChild(radio);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('openDefaultsWizard').onclick = function() {
|
|
|
|
|
|
|
|
this.disabled = true
|
|
|
|
|
|
|
|
this.innerHTML =
|
|
|
|
|
|
|
|
'<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true" style="margin-right: 0.5rem;"></span>' +
|
|
|
|
|
|
|
|
'Loading...';
|
|
|
|
|
|
|
|
let req = new XMLHttpRequest();
|
|
|
|
|
|
|
|
req.responseType = 'json';
|
|
|
|
|
|
|
|
req.open("GET", "/getUsers", true);
|
|
|
|
|
|
|
|
req.setRequestHeader("Authorization", "Basic " + btoa(window.token + ":"));
|
|
|
|
|
|
|
|
req.onreadystatechange = function() {
|
|
|
|
|
|
|
|
if (this.readyState == 4) {
|
|
|
|
|
|
|
|
if (this.status == 200) {
|
|
|
|
|
|
|
|
jfUsers = req.response['users'];
|
|
|
|
|
|
|
|
populateRadios();
|
|
|
|
let button = document.getElementById('openDefaultsWizard');
|
|
|
|
let button = document.getElementById('openDefaultsWizard');
|
|
|
|
button.disabled = false;
|
|
|
|
button.disabled = false;
|
|
|
|
button.innerHTML = 'New User Defaults <i class="fa fa-user settingIcon"></i>';
|
|
|
|
button.innerHTML = 'New User Defaults <i class="fa fa-user settingIcon"></i>';
|
|
|
|