mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 15:30:41 +09:00
Remove config management
Remove lib/manager/configManager.js and the config management command line interface as well as the serverManager's web interface for config management. The configuration rewrite will work differently and is not compatible with configManager.js.
This commit is contained in:
1 parent
dd865b42b5
commit
5f33cf4d3b
10 files changed
+4
-201
No files matched your search
@@ -26,23 +26,7 @@
|
||||
if(server.plugins) server.plugins.forEach(plugin => {
|
||||
html += `<li><div class="pluginStatus" style="background-color: ${plugin.enabled ? 'green' : 'red'}"></div><div style="width: calc( 100% - 50px )"><h3>${plugin.name}</h3><p>${plugin.description}</p></div></li>`
|
||||
});
|
||||
html += `</ul></div><div id="config">`
|
||||
if(permissions && permissions.cluster && permissions.cluster.includes("readConfig")){
|
||||
if(server.config){
|
||||
html += `<ul>`;
|
||||
server.config.forEach(setting => {
|
||||
if(setting.entry[1] !== "_" && setting.entry !== "masterAuthSecret"){
|
||||
html += `<li class="settingInput">
|
||||
<p style="width: 50%; display:inline-block;">${setting.entry}</p>
|
||||
<input style="color:black; width: calc(50% - 4px); box-sizing: border-box;" value='${setting.value}'>
|
||||
</li>`
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
html += `</ul>
|
||||
<input id="submitSettings" type="button" value="Save changes" style="color:black"/>
|
||||
</div>`
|
||||
html += `</ul></div>`
|
||||
}
|
||||
%>
|
||||
<%- html %>
|
||||
|
||||
@@ -1,40 +1,3 @@
|
||||
// Handle config editing
|
||||
originalSettings = {};
|
||||
let settings = document.querySelectorAll(".settingInput");
|
||||
settings.forEach(setting => {
|
||||
let entry = setting.children[0].innerText
|
||||
originalSettings[setting.children[0].innerText] = {
|
||||
entry: setting.children[0].innerText,
|
||||
value: setting.children[1].value,
|
||||
}
|
||||
setting.children[1].addEventListener("input", ()=>{
|
||||
let newValue = setting.children[1].value;
|
||||
if(newValue != originalSettings[entry].value){
|
||||
setting.children[1].style.backgroundColor = "lightgreen";
|
||||
} else {
|
||||
setting.children[1].style.backgroundColor = "";
|
||||
}
|
||||
});
|
||||
});
|
||||
let submitSettings = document.querySelector("#submitSettings");
|
||||
submitSettings.addEventListener("click", async ()=>{
|
||||
let settings = document.querySelectorAll(".settingInput");
|
||||
for(let i = 0; i < settings.length; i++){
|
||||
let setting = settings[i];
|
||||
let entry = setting.children[0].innerText
|
||||
if(setting.children[1].value != originalSettings[entry].value){
|
||||
// upload new changes, display results somehow
|
||||
let status = await postJSON("/api/serverManager/editConfig", {
|
||||
entry,
|
||||
value: setting.children[1].value,
|
||||
instanceID: getParameterByName("instanceID"),
|
||||
});
|
||||
if(status.ok){
|
||||
setting.children[1].style.backgroundColor = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// Handle plugin management
|
||||
let pluginStatuses = document.querySelectorAll(".pluginStatus");
|
||||
pluginStatuses.forEach(pluginStatus => {
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
width:calc((( 100% ) - (( 100% ) / 4))/2);
|
||||
float:left;
|
||||
}
|
||||
#config {
|
||||
width:calc((( 100% ) - (( 100% ) / 4))/2);
|
||||
float:left;
|
||||
}
|
||||
ul {
|
||||
list-style: none;
|
||||
padding:0px;
|
||||
|
||||
Reference in new issue
Block a user