diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 1021568..06937c2 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -43,7 +43,7 @@ webhook: ping: display_name: "Ping" format: "ping -{ip_version} -c 4 {target}" - description: "Test network connectivity" + description: "Performs ping with 4 ICMP requests to target" field: type: "text" placeholder: "Enter IP address or hostname" @@ -51,7 +51,7 @@ ping: traceroute: display_name: "Traceroute" format: "traceroute -{ip_version} {target}" - description: "Trace network path to destination" + description: "Performs traceroute to target" field: type: "text" placeholder: "Enter IP address or hostname" @@ -59,7 +59,7 @@ traceroute: mtr: display_name: "MTR" format: "mtr -{ip_version} -r {target}" - description: "Trace network path with stats" + description: "Performs MTR to target" field: type: "text" placeholder: "Enter IP address or hostname" diff --git a/app/static/js/main.js b/app/static/js/main.js index b48dfdc..feec0e5 100644 --- a/app/static/js/main.js +++ b/app/static/js/main.js @@ -30,7 +30,13 @@ const app = Vue.createApp({ if (!newVal) { this.resetCommandState(); } + // Check if the current command is valid for the new device + const validCommands = this.currentDevice?.commands || []; + if (!validCommands.includes(this.selectedCommand)) { + this.selectedCommand = ''; // Reset command if invalid + } }, + immediate: true }, selectedCommand: { @@ -49,6 +55,14 @@ const app = Vue.createApp({ })); }, + filteredCommands() { + if (!this.currentDevice) return []; + return this.currentDevice.commands.map(commandKey => ({ + key: commandKey, + ...this.commands[commandKey] + })); + }, + showIpVersionSelector() { if (!this.targetIp) return true; diff --git a/app/templates/footer.html b/app/templates/footer.html index 45a22b3..8321bd0 100644 --- a/app/templates/footer.html +++ b/app/templates/footer.html @@ -4,7 +4,7 @@
diff --git a/app/templates/index.html b/app/templates/index.html index cb8f2c1..c08786c 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -64,21 +64,20 @@ leave-to-class="transform opacity-0 scale-95 -translate-y-2">