diff --git a/Hub/ui/src/views/NodeDetailView.vue b/Hub/ui/src/views/NodeDetailView.vue index 546cab6..b732edd 100644 --- a/Hub/ui/src/views/NodeDetailView.vue +++ b/Hub/ui/src/views/NodeDetailView.vue @@ -176,6 +176,20 @@ const composePre = ref(null) const showKeyModal = ref(false) const showSyncModal = ref(false) const syncComposeYaml = ref('') +const showManualSync = ref(false) + +watch(showSyncModal, (val) => { + if (!val) showManualSync.value = false +}) + +const syncCommand = computed(() => { + if (!node.value) return '' + const hubUrl = config.hubEndpoint || window.location.origin + if (!node.value.lastHeartbeat) { + return `./wizard --link ${hubUrl} ${node.value.apiKey}\n./wizard apply` + } + return `./wizard apply` +}) // --- COPY STATE (ephemeral UI) --- const copiedStates = ref({}) @@ -291,15 +305,6 @@ const handleApplySensor = async () => { const handleManageKey = () => { showKeyModal.value = true } -const copySyncYamlToClipboard = async () => { - if (!syncComposeYaml.value) return - try { - await navigator.clipboard.writeText(syncComposeYaml.value) - } catch (err) { - alert('Unable to copy compose YAML. Please copy it manually.') - } -} - const triggerManualSync = async () => { if (!node.value?.id) return try { @@ -743,15 +748,64 @@ const applyHighlighting = () => { - -
-

This is the generated docker-compose.yml for this node. Use it to deploy the node with the selected sensors and config.

-
-
{{ syncComposeYaml || 'No compose output available.' }}
+ +
+ +
+

Automatic Deployment (Recommended)

+

+ Run the HoneyWire Wizard on your server to automatically reconcile this node's configuration. +

+ +
+ {{ syncCommand }} + + +
-
- Close - Copy Compose + +
+ + +
+

+ For air-gapped environments or manual orchestration, save the following configuration to /opt/honeywire/sensors/docker-compose.yml. +

+ +
+ +
{{ syncComposeYaml || 'No compose output available.' }}
+
+ +

+ Then, apply the configuration using Docker Compose: +

+ +
+ cd /opt/honeywire/sensors
docker compose -p honeywire up -d --remove-orphans
+ + +
+
+
+ +
+ Done