Skip to content

Commit

Permalink
FIX: Format
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoPlays committed Oct 3, 2024
1 parent 6577650 commit a98167e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 23 additions & 19 deletions launcher/src/components/UI/node-page/sections/ExpertWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
<div
class="row-part-scrollable w-full overflow-y-auto space-y-2 mt-2"
:class="
isExpertModeActive || ssvExpertModeActive || ssvDkgExpertModeActive || prometheusExpertModeActive
? 'h-[40px]'
: 'max-h-[59vh]'
isExpertModeActive || ssvExpertModeActive || ssvDkgExpertModeActive || prometheusExpertModeActive ? 'h-[40px]' : 'max-h-[59vh]'
"
>
<!-- expert mode row -->
Expand Down Expand Up @@ -417,43 +415,48 @@ export default {
switch (option.commands[0]) {
case "--prune-history": {
option.changeValue = match[2].includes("h") ? true : false;
break;
break;
}
case "--prune-receipts": {
option.changeValue = match[2].includes("r") ? true : false;
break;
break;
}
case "--prune-transaction": {
option.changeValue = match[2].includes("t") ? true : false;
break;
break;
}
case "--prune-call-traces": {
option.changeValue = match[2].includes("c") ? true : false;
break;
break;
}
}
this.somethingIsChanged(option);
}
else if (this.item.service === "NethermindService") {
if(!this.item.yaml.includes("Pruning.AvailableSpaceCheckEnabled=")){
} else if (this.item.service === "NethermindService") {
if (!this.item.yaml.includes("Pruning.AvailableSpaceCheckEnabled=")) {
const matchAllCommands = this.item.yaml.match(new RegExp(/--[\S]+/gm));
const lastCommand = matchAllCommands[matchAllCommands.length - 1];
const matchSpaces = this.item.yaml.match(new RegExp(`(\\s*- )${lastCommand}`));
let spaces = " ";
if (matchSpaces) {
spaces = matchSpaces[1];
}
this.item.yaml = this.item.yaml.replace(new RegExp(`${lastCommand}`), lastCommand + spaces + "--Pruning.AvailableSpaceCheckEnabled=true");
this.item.yaml = this.item.yaml.replace(
new RegExp(`${lastCommand}`),
lastCommand + spaces + "--Pruning.AvailableSpaceCheckEnabled=true"
);
}
if(!this.item.yaml.includes("Pruning.FullPruningDisableLowPriorityWrites=")){
if (!this.item.yaml.includes("Pruning.FullPruningDisableLowPriorityWrites=")) {
const matchAllCommands = this.item.yaml.match(new RegExp(/--[\S]+/gm));
const lastCommand = matchAllCommands[matchAllCommands.length - 1];
const matchSpaces = this.item.yaml.match(new RegExp(`(\\s*- )${lastCommand}`));
let spaces = " ";
if (matchSpaces) {
spaces = matchSpaces[1];
}
this.item.yaml = this.item.yaml.replace(new RegExp(`${lastCommand}`), lastCommand + spaces + "--Pruning.FullPruningDisableLowPriorityWrites=false");
this.item.yaml = this.item.yaml.replace(
new RegExp(`${lastCommand}`),
lastCommand + spaces + "--Pruning.FullPruningDisableLowPriorityWrites=false"
);
}
} else {
option.changeValue = false;
Expand Down Expand Up @@ -637,8 +640,8 @@ export default {
this.item.yaml = this.item.yaml.replace(new RegExp(/\n^.*\/opt\/app\/slasher*$/gm), "");
} else if (this.item.yaml.includes("--slasher") && !this.item.yaml.includes("/opt/app/slasher")) {
let path = this.item.yaml.match(/^.*beacon:\/opt\/app\/beacon.*$/gm)[0].replace(new RegExp(/beacon/gm), "slasher");
this.item.yaml = this.item.yaml.replace("--slasher","--slasher\n - --slasher-dir=/opt/app/slasher");
this.item.yaml = this.item.yaml.replace("volumes:" ,"volumes:\n" + path)
this.item.yaml = this.item.yaml.replace("--slasher", "--slasher\n - --slasher-dir=/opt/app/slasher");
this.item.yaml = this.item.yaml.replace("volumes:", "volumes:\n" + path);
}
}
if (this.item.service === "ErigonService") {
Expand All @@ -647,14 +650,15 @@ export default {
if (this.item.yaml.includes("--prune-receipts")) erigonPruneSetting += "r";
if (this.item.yaml.includes("--prune-transaction")) erigonPruneSetting += "t";
if (this.item.yaml.includes("--prune-call-traces")) erigonPruneSetting += "c";
if(erigonPruneSetting == "") erigonPruneSetting = "disabled";
if (erigonPruneSetting == "") erigonPruneSetting = "disabled";
this.item.yaml = this.item.yaml.replace(/\n^.*--prune-.*$/gm, "");
this.item.yaml = this.item.yaml.replace(/--prune=.*$/gm, "--prune=" + erigonPruneSetting);
}
if (this.item.service === "NethermindService") {let erigonPruneSetting = "";
if (this.item.service === "NethermindService") {
let erigonPruneSetting = "";
if (!this.item.yaml.includes("--FullPruningDisableLowPriorityWrites=")) {
this.item.yaml = this.item.yaml.replace(/\n^.*--prune-.*$/gm, "");
this.item.yaml = this.item.yaml.replace(/--prune=.*$/gm, "--prune=" + erigonPruneSetting);
this.item.yaml = this.item.yaml.replace(/\n^.*--prune-.*$/gm, "");
this.item.yaml = this.item.yaml.replace(/--prune=.*$/gm, "--prune=" + erigonPruneSetting);
}
}
Expand Down
4 changes: 2 additions & 2 deletions launcher/src/store/ControlService.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,8 @@ class ControlService extends EventEmitter {
return this.promiseIpc.send("getNewLauncherVersion");
}

async deleteSlasherVolume(args){
return this.promiseIpc.send("deleteSlasherVolume", args)
async deleteSlasherVolume(args) {
return this.promiseIpc.send("deleteSlasherVolume", args);
}
}
if (!instance) {
Expand Down
2 changes: 1 addition & 1 deletion launcher/src/store/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ export const useServices = defineStore("services", {
pattern: ["(- --JsonRpc.WebSocketsPort=)(.*)(\\n)"],
commands: ["--JsonRpc.WebSocketsPort"],
},

{
title: "Metrics Port",
type: "text",
Expand Down

0 comments on commit a98167e

Please sign in to comment.