Skip to content

Commit

Permalink
2.0.2-fix
Browse files Browse the repository at this point in the history
- Fixed server.properties editor
- Fixed mods list
  • Loading branch information
Seeroy committed Feb 19, 2023
1 parent 220604f commit 95cbe26
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ global.currentFileWritingsText = [];
global.ftpserver;

// Kubek version
global.kubek_version = "v2.0.2";
global.kubek_version = "v2.0.2-fix";

app.use(fileUpload());
app.use(cookieParser());
Expand Down
2 changes: 1 addition & 1 deletion my_modules/servers.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ exports.getServerProperties = (name) => {
}

exports.saveServerProperties = (name, doc) => {
fs.writeFileSync("./servers/" + name + "/server.properties", Buffer.from(doc, 'base64').toString('ascii'));
fs.writeFileSync("./servers/" + name + "/server.properties", doc);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion routers/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ router.get('/installed', function (req, res) {

router.get('/installedMods', function (req, res) {
res.set("content-type", "application/json");
if (fs.existsSync("./servers/" + req.query.server + "/plugins")) {
if (fs.existsSync("./servers/" + req.query.server + "/mods")) {
res.send(plugins.getInstalledMods(req.query.server));
} else {
res.send(JSON.stringify([]));
Expand Down
10 changes: 7 additions & 3 deletions www/pages/server_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ function refreshServerProperties() {
fulls = data;
keys.forEach(function (key, i) {
znach = fulls[key];
if(typeof znach == "object"){
znach = JSON.stringify(znach).replace("null", "").trim();;
}
if (typeof znach == "boolean") {
if (znach == true) {
checkd = " checked";
Expand Down Expand Up @@ -136,11 +139,11 @@ function refreshServerProperties() {
}

function saveProps() {
var sp;
var sp = "";
$(".ttgrid .cbox").each(function () {
chk = $(this).find("input").is(':checked') ? true : false;
key = $(this).find("label").html();
if (typeof (sp) !== "undefined") {
if (sp !== "") {
sp = sp + "\n" + key + "=" + chk;
} else {
sp = key + "=" + chk;
Expand All @@ -151,7 +154,8 @@ function saveProps() {
key = $(this).find("span").html();
sp = sp + "\n" + key + "=" + value;
});
$.get("/server/saveServerPropertiesFile?doc=" + sp + "&server=" + window.localStorage.selectedServer);
sp = sp.trim();
$.get("/server/saveServerPropertiesFile?doc=" + encodeURIComponent(sp) + "&server=" + window.localStorage.selectedServer);
Toastify({
text: "{{settings-saved}}",
duration: 3000,
Expand Down

0 comments on commit 95cbe26

Please sign in to comment.