Skip to content
Extraits de code Groupes Projets
Vérifiée Valider ee254731 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Fill settings modal from config

parent d6a2b8fb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!10Settings in instance
...@@ -17,6 +17,7 @@ var config = { ...@@ -17,6 +17,7 @@ var config = {
port: null, port: null,
loglevel: null, loglevel: null,
loglektord: null, loglektord: null,
attachmode: null,
reload() { reload() {
var fd = fs.openSync(__configFile, 'a'); var fd = fs.openSync(__configFile, 'a');
fs.close(fd, err => {}); fs.close(fd, err => {});
...@@ -31,6 +32,7 @@ var config = { ...@@ -31,6 +32,7 @@ var config = {
__config.database.path ??= '/home/kara/kara.db'; __config.database.path ??= '/home/kara/kara.db';
__config.lektord.host ??= 'localhost'; __config.lektord.host ??= 'localhost';
__config.lektord.port ??= '6600'; __config.lektord.port ??= '6600';
__config.lektord.attach ??= true;
this.database = __config.database.path; this.database = __config.database.path;
this.host = __config.lektord.host; this.host = __config.lektord.host;
......
...@@ -38,6 +38,15 @@ function addIpcToButton(btnId, ipc) { ...@@ -38,6 +38,15 @@ function addIpcToButton(btnId, ipc) {
}); });
} }
function autoFillSettings() {
$('#inputHost').val(config.host);
$('#inputPort').val(config.port);
$('#inputAttachMode').prop('checked', true);
$('#inputDbPath').val(config.database);
$('#inputLogLektord').val(config.loglektord);
$(`#log${config.loglevel.toUpperCase()}`).prop('checked', true);
}
window.onload = () => { window.onload = () => {
createButtonList(buttonList); createButtonList(buttonList);
...@@ -80,6 +89,9 @@ window.onload = () => { ...@@ -80,6 +89,9 @@ window.onload = () => {
}, },
false false
); );
/* Autofill settings */
autoFillSettings();
}; };
/* Create the button list */ /* Create the button list */
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter