Skip to content

Commit

Permalink
FIX: missing closing tag
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxTheGeeek committed Jan 23, 2025
1 parent 27c1a66 commit cb6edcd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 141 deletions.
2 changes: 1 addition & 1 deletion launcher/public/output.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
}

/*
! tailwindcss v3.4.16 | MIT License | https://tailwindcss.com
! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com
*/

/*
Expand Down
179 changes: 39 additions & 140 deletions launcher/src/components/UI/edit-page/EditScreen.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<template>
<base-layout>
<!-- Start Node main layouts -->

<div class="w-full h-full grid grid-cols-24 relative select-none">
<div class="col-start-1 col-span-1 flex justify-center items-center">
<SidebarSection
@network-modal="displaySwitchNetwork"
@nuke-node="openNukeNodeModal"
/>
<SidebarSection @network-modal="displaySwitchNetwork" @nuke-node="openNukeNodeModal" />
</div>
<div class="col-start-2 col-end-17 w-full h-full relative">
<EditBody
Expand All @@ -24,16 +19,10 @@
</div>
<div class="col-start-17 col-end-21 ml-1 grid grid-cols-2 grid-rows-9">
<NetworkStatus />
<ServiceSection
@change-connection="serviceModifyHandler"
@delete-service="selectedServiceToRemove"
/>
<ServiceSection @change-connection="serviceModifyHandler" @delete-service="selectedServiceToRemove" />
</div>
<div class="col-start-21 col-end-25 px-1 flex flex-col justify-between">
<ChangesSection
@remove-change="cancelChangeHandler"
@confirm-changes="confirmHandler"
/>
<ChangesSection @remove-change="cancelChangeHandler" @confirm-changes="confirmHandler" />
</div>
</div>
<!-- End Node main layout -->
Expand Down Expand Up @@ -62,23 +51,15 @@
@create-devnet="createDevnetModal"
@get-network="getSetupNetwork"
/>
<ServicesDrawer
v-else-if="manageStore.isServicesDrawerActive"
:dragging="startDrag"
@add-services="addServices"
/>
<ServicesDrawer v-else-if="manageStore.isServicesDrawerActive" :dragging="startDrag" @add-services="addServices" />
</template>
</drawer-box>
</transition>
<!-- End drawer layout -->
<!-- Custom Modals -->
<TransitionGroup name="fadeModal">
<!-- Start Network Switch Modal -->
<NetworkModal
v-if="manageStore.displayNetworkList"
@close-window="closeNetworkModal"
@switch-confirm="switchNetworkConfirm"
/>
<NetworkModal v-if="manageStore.displayNetworkList" @close-window="closeNetworkModal" @switch-confirm="switchNetworkConfirm" />
<!-- End Switch Network Modal -->
<!-- Start Switch Client Modal -->
<SwitchModal
Expand All @@ -89,12 +70,7 @@
/>
<!-- End Switch Client Modal -->
<!-- Start Info Modal -->
<InfoModal
v-if="isInfoModalOpen"
:client="clientForInfo"
@close-window="closeInfoModal"
@ok-button="isInfoModalOpen = false"
/>
<InfoModal v-if="isInfoModalOpen" :client="clientForInfo" @close-window="closeInfoModal" @ok-button="isInfoModalOpen = false" />
<!-- End Info Modal -->
<!-- Start Modify Services Modal -->
<ModifyModal
Expand Down Expand Up @@ -134,33 +110,22 @@
<!-- End Nuke Modal -->

<!-- Start Import Setup -->
<ImportSetup
v-if="manageStore.isImportSetupYamlActive"
@confirm-import="confirmImportSingleSetup"
/>
<ImportSetup v-if="manageStore.isImportSetupYamlActive" @confirm-import="confirmImportSingleSetup" />
<!-- End Import Setup -->
<!-- Start Create Setup -->
<CreateSetup
v-if="setupStore.isCreateSetupModalActive"
:network="selectedSetupNetwork"
/>
<CreateSetup v-if="setupStore.isCreateSetupModalActive" :network="selectedSetupNetwork" />
<!-- End Create Setup -->

<!-- Start Setup Infos -->
<SetupInfos v-if="setupStore.selectedSetupInfos" />
<!-- End Setup Infos -->
<!-- Start Devnet Configs Modal -->
<DevnetSetup
v-if="setupStore.isDevnetSetupModalActive"
@confirm-devnet="setupDevnet"
/>
<DevnetSetup v-if="setupStore.isDevnetSetupModalActive" @confirm-devnet="setupDevnet" />
</TransitionGroup>
<LoaderAnime
v-if="manageStore.disableConfirmButton || setupStore.isImportAnimeActive"
:anime="getAimationSrc"
/>
<LoaderAnime v-if="manageStore.disableConfirmButton || setupStore.isImportAnimeActive" :anime="getAimationSrc" />
</base-layout>
</template>

<script setup>
import { useFrontendServices } from "@/composables/services";
import { useDeepClone } from "@/composables/utils";
Expand Down Expand Up @@ -353,9 +318,7 @@ const switchClientModalhandler = (item) => {
const switchClientConfirm = (properties) => {
isSwitchModalOpen.value = false;
const current = manageStore.newConfiguration.find(
(e) => e?.config.serviceID === properties.itemToReplace.config.serviceID
);
const current = manageStore.newConfiguration.find((e) => e?.config.serviceID === properties.itemToReplace.config.serviceID);
const currentClientIndex = manageStore.newConfiguration.indexOf(current);
Expand Down Expand Up @@ -392,9 +355,7 @@ const switchClientConfirm = (properties) => {
executionClients: [],
consensusClients: [],
otherServices: [],
checkpointURL: properties.checkPointSyncUrl
? properties.checkPointSyncUrl
: false,
checkpointURL: properties.checkPointSyncUrl ? properties.checkPointSyncUrl : false,
},
},
});
Expand Down Expand Up @@ -433,7 +394,6 @@ const hideModifyModal = () => {
isModifyModalOpen.value = false;
manageStore.newConfiguration = useDeepClone(serviceStore.installedServices);
};
const confirmConsensusConnection = (item) => {
clientToConnect.value.isNotConnectedToConsensus = false;
Expand Down Expand Up @@ -509,17 +469,13 @@ const createDevnetModal = () => {
const setupDevnet = async () => {
manageStore.disableConfirmButton = true;
try {
setupStore.genesisFile = useDeepClone(
setupStore.uploadedGenesisConfig || genesisStore.genesis
);
setupStore.genesisFile = useDeepClone(setupStore.uploadedGenesisConfig || genesisStore.genesis);
setupStore.isDevnetSetupModalActive = false;
setupStore.currentStep = 1;
await ControlService.writeGenesisJsonDevnet(useDeepClone(setupStore.genesisFile));
const existDepositContract = setupStore.genesisFile.alloc.hasOwnProperty(
"4242424242424242424242424242424242424242"
);
const existDepositContract = setupStore.genesisFile.alloc.hasOwnProperty("4242424242424242424242424242424242424242");
const writeConfigData = {
configYaml: genesisStore.configYaml,
Expand Down Expand Up @@ -550,13 +506,10 @@ const setupDevnet = async () => {
const executionClients = services.filter((e) => e.category === "execution");
const consensusClients = services.filter((e) => e.category === "consensus");
const installPromises = services.map((client) =>
installService(client, setupId, executionClients, consensusClients)
);
const installPromises = services.map((client) => installService(client, setupId, executionClients, consensusClients));
await Promise.all(installPromises);
await ControlService.handleServiceChanges(useDeepClone(manageStore.confirmChanges));
await ControlService.startServicesForSetup(setupId);
Expand All @@ -577,10 +530,8 @@ const installService = async (client, setupId, executionClients, consensusClient
network: "devnet",
chainId: useDeepClone(setupStore.genesisFile?.config?.chainId),
installDir: client.installDir || "/opt/stereum",
executionClients:
client.category === "consensus" ? executionClients : client.executionClients,
consensusClients:
client.category === "validator" ? consensusClients : client.consensusClients,
executionClients: client.category === "consensus" ? executionClients : client.executionClients,
consensusClients: client.category === "validator" ? consensusClients : client.consensusClients,
otherServices: client.otherServices,
relays: null,
checkpointURL: client.checkPointSyncUrl || false,
Expand Down Expand Up @@ -630,7 +581,6 @@ const cancelChangeHandler = (item) => {
manageStore.newConfiguration.splice(eventIdx, 1);
manageStore.newConfiguration = useDeepClone(serviceStore.installedServices);
}
if (item.content === "MODIFY") {
Expand Down Expand Up @@ -670,10 +620,7 @@ const addServices = (service) => {
const addServerServices = (service) => {
let item = useDeepClone(service);
if (
item.category === "service" &&
manageStore.newConfiguration.map((s) => s?.service).includes(item?.service)
) {
if (item.category === "service" && manageStore.newConfiguration.map((s) => s?.service).includes(item?.service)) {
return;
} else {
item.id = manageStore.newConfiguration.length;
Expand All @@ -683,9 +630,7 @@ const addServerServices = (service) => {
};
manageStore.newConfiguration.push(newItem);
setupStore.editSetups
.find((s) => s.setupId === setupStore.selectedSetup?.setupId)
?.services.push(newItem);
setupStore.editSetups.find((s) => s.setupId === setupStore.selectedSetup?.setupId)?.services.push(newItem);
clientToInstall.value = newItem;
clientToInstall.value.addPanel = true;
Expand All @@ -708,10 +653,7 @@ const onDrop = (event) => {
const allServices = useDeepClone(serviceStore.allServices);
const itemId = event.dataTransfer.getData("itemId");
let item = allServices.find((item) => item.id == itemId);
if (
item.category === "service" &&
manageStore.newConfiguration.map((s) => s.service).includes(item.service)
) {
if (item.category === "service" && manageStore.newConfiguration.map((s) => s.service).includes(item.service)) {
return;
} else {
item.id = manageStore.newConfiguration.length;
Expand Down Expand Up @@ -798,9 +740,7 @@ const switchNetworkConfirm = (network) => {
manageStore.displayNetworkList = false;
if (network?.network != setupStore.selectedSetup?.network) {
if (manageStore.confirmChanges.map((j) => j.content).includes("CHANGE NETWORK")) {
let index = manageStore.confirmChanges.findIndex((j) =>
j.content.includes("CHANGE NETWORK")
);
let index = manageStore.confirmChanges.findIndex((j) => j.content.includes("CHANGE NETWORK"));
if (setupStore.selectedSetup.network === network.network) {
manageStore.confirmChanges.splice(index, 1);
} else {
Expand Down Expand Up @@ -844,12 +784,7 @@ const selectedServiceToRemove = (item) => {
let commonService = setupStore.editSetups.find((s) => {
return s.setupName === "commonServices";
});
if (
item.isNotConnectedToConsensus ||
item.isNotConnectedToValidator ||
item.isNotConnectedToMevboost ||
item.isDisplayPluginMenu
) {
if (item.isNotConnectedToConsensus || item.isNotConnectedToValidator || item.isNotConnectedToMevboost || item.isDisplayPluginMenu) {
return;
} else {
clientToRemove.value = item;
Expand All @@ -864,9 +799,7 @@ const selectedServiceToRemove = (item) => {
content: "DELETE",
contentIcon: "/img/icon/edit-node-icons/delete-service.png",
service: item,
setupId: commonServiceExistance
? commonService.setupId
: setupStore.selectedSetup?.setupId,
setupId: commonServiceExistance ? commonService.setupId : setupStore.selectedSetup?.setupId,
};
const itemExists = manageStore.confirmChanges.some(
(e) => (e.id === item.config?.serviceID || e.id === item.id) && e.content === "DELETE"
Expand Down Expand Up @@ -942,41 +875,26 @@ const confirmHandler = async () => {
manageStore.disableConfirmButton = true;
const setupExists = manageStore.confirmChanges.some(
(item) =>
item.service?.hasOwnProperty("setupName") &&
item.service?.hasOwnProperty("setupId") &&
item.service.setupId == item.id
(item) => item.service?.hasOwnProperty("setupName") && item.service?.hasOwnProperty("setupId") && item.service.setupId == item.id
);
const serverServiceExists = manageStore.confirmChanges.some(
(change) =>
change.content === "INSTALL" &&
setupStore.serverServices.includes(change.service.service)
(change) => change.content === "INSTALL" && setupStore.serverServices.includes(change.service.service)
);
try {
if (serverServiceExists) {
await handleServerServiceChanges();
} else if (
setupExists &&
manageStore.confirmChanges.some((e) => e.content === "DELETE")
) {
} else if (setupExists && manageStore.confirmChanges.some((e) => e.content === "DELETE")) {
await handleSetupChanges();
} else if (manageStore.confirmChanges.some((e) => e.content === "NETWORK")) {
await handleSwitchSetupNetwork();
await ControlService.handleServiceChanges(
JSON.parse(JSON.stringify(manageStore.confirmChanges))
);
await ControlService.handleServiceChanges(JSON.parse(JSON.stringify(manageStore.confirmChanges)));
} else if (manageStore.confirmChanges.some((e) => e.content === "MODIFY")) {
await ControlService.handleServiceChanges(
JSON.parse(JSON.stringify(manageStore.confirmChanges))
);
await ControlService.handleServiceChanges(JSON.parse(JSON.stringify(manageStore.confirmChanges)));
} else {
await ControlService.handleServiceChanges(
JSON.parse(JSON.stringify(manageStore.confirmChanges))
);
await ControlService.handleServiceChanges(JSON.parse(JSON.stringify(manageStore.confirmChanges)));
}
} catch (error) {
console.error("Error processing changes:", error);
Expand All @@ -988,28 +906,18 @@ const confirmHandler = async () => {
};
const handleServerServiceChanges = async () => {
const commonServicesId = setupStore.editSetups.find(
(s) => s.setupName === "commonServices"
)?.setupId;
const commonServicesId = setupStore.editSetups.find((s) => s.setupName === "commonServices")?.setupId;
manageStore.confirmChanges.forEach((change) => {
change.data.setupId = commonServicesId ?? change.data.setupId;
});
await ControlService.handleServiceChanges(
JSON.parse(JSON.stringify(manageStore.confirmChanges))
);
await ControlService.handleServiceChanges(JSON.parse(JSON.stringify(manageStore.confirmChanges)));
};
const handleSetupChanges = async () => {
const setupsToRemoveIds = new Set(
setupStore.selectedSetupToRemove.map((s) => s.setupId)
);
setupStore.allSetups = setupStore.allSetups.filter(
(e) => !setupsToRemoveIds.has(e.setupId)
);
setupStore.editSetups = setupStore.editSetups.filter(
(e) => !setupsToRemoveIds.has(e.setupId)
);
const setupsToRemoveIds = new Set(setupStore.selectedSetupToRemove.map((s) => s.setupId));
setupStore.allSetups = setupStore.allSetups.filter((e) => !setupsToRemoveIds.has(e.setupId));
setupStore.editSetups = setupStore.editSetups.filter((e) => !setupsToRemoveIds.has(e.setupId));
let subtasks = manageStore.confirmChanges.flatMap((e) => e.subTasks);
await ControlService.handleServiceChanges(useDeepClone(subtasks));
Expand Down Expand Up @@ -1074,11 +982,7 @@ const deleteSetup = async (item) => {
});
const subtasks =
item?.services.flatMap((service) => {
const matchedServices = manageStore.newConfiguration.filter(
(e) => e.config?.serviceID === service.config?.serviceID
);
const matchedServices = manageStore.newConfiguration.filter((e) => e.config?.serviceID === service.config?.serviceID);
return matchedServices.map((e) => ({
id: e.config?.serviceID,
Expand All @@ -1098,9 +1002,7 @@ const deleteSetup = async (item) => {
subTasks: subtasks,
};
const itemExists = manageStore.confirmChanges.some(
(e) => e.id === item.setupId && e.content === "DELETE"
);
const itemExists = manageStore.confirmChanges.some((e) => e.id === item.setupId && e.content === "DELETE");
if (!itemExists) {
manageStore.confirmChanges.push(confirmDelete);
}
Expand All @@ -1125,10 +1027,7 @@ const closeSwitchModal = () => {
isSwitchModalOpen.value = false;
manageStore.isLineHidden = false;
manageStore.newConfiguration = JSON.parse(
JSON.stringify(serviceStore.installedServices)
);
manageStore.newConfiguration = JSON.parse(JSON.stringify(serviceStore.installedServices));
};
const closeInfoModal = () => {
Expand Down
Loading

0 comments on commit cb6edcd

Please sign in to comment.