diff --git a/app/Domain/Nodes/Actions/CreateNodeAction.php b/app/Domain/Nodes/Actions/CreateNodeAction.php index cf7ead5..f210f06 100644 --- a/app/Domain/Nodes/Actions/CreateNodeAction.php +++ b/app/Domain/Nodes/Actions/CreateNodeAction.php @@ -70,7 +70,14 @@ public function execute( ]); $configDB->putConfig(App::Info, $uuid, [ - "name" => $nodeName . '/' . $destinationCluster . '/' . $destinationNode, + "name" => sprintf("%s/%s (%s)", + $group->name, $nodeName, $destinationNode), + ]); + + // Register the Sparkplug address the EA should use + $configDB->putConfig(App::SparkplugAddress, $uuid, [ + "group_id" => $group->name, + "node_id" => $nodeName, ]); // Split the $charts string (comma-delimited) into an array of UUIDs @@ -78,7 +85,7 @@ public function execute( // Create an entry in the Edge Agent Deployment app to trigger the deployment of the edge agent $configDB->putConfig(App::EdgeAgentDeployment, $uuid, [ - "name" => $nodeName, + "name" => sprintf("%s.%s", $group->name, $nodeName), "charts" => $charts, "cluster" => $destinationCluster, "hostname" => $destinationNode, diff --git a/app/Domain/Nodes/Actions/DeleteNodeAction.php b/app/Domain/Nodes/Actions/DeleteNodeAction.php index 41676cd..631e58f 100644 --- a/app/Domain/Nodes/Actions/DeleteNodeAction.php +++ b/app/Domain/Nodes/Actions/DeleteNodeAction.php @@ -54,6 +54,12 @@ public function execute(Node $node) $configDB = $fplus->getConfigDB(); $configDB->deleteConfig(App::EdgeAgentDeployment, $node->uuid); + $configDB->deleteConfig(App::SparkplugAddress, $node->uuid); + + /* XXX This should be a library method to mark an object deleted */ + $info = $configDB->getConfig(App::Info, $node->uuid); + $info["deleted"] = true; + $configDB->putConfig(App::Info, $node->uuid, $info); $node->delete(); diff --git a/resources/js/components/Containers/EdgeClusterContainer.vue b/resources/js/components/Containers/EdgeClusterContainer.vue index bf972ba..ef0ebfe 100644 --- a/resources/js/components/Containers/EdgeClusterContainer.vue +++ b/resources/js/components/Containers/EdgeClusterContainer.vue @@ -24,7 +24,7 @@