diff --git a/src/components/pages/settings/NodeSettingsList.vue b/src/components/pages/settings/NodeSettingsList.vue index a2974e3..082f249 100644 --- a/src/components/pages/settings/NodeSettingsList.vue +++ b/src/components/pages/settings/NodeSettingsList.vue @@ -13,21 +13,80 @@
{{ getNodeHexId(nodeId) }} / {{ nodeId }}
-
+ +
- - -
+ +
+ +
Radio Configuration
+ + + +
+ + +
+ + + +
+ + +
User
+ + +
+ + + +
+ +
+
+ + + +
+ + +
+ + + +
+ + +
Channels
+ + +
+ + + +
+ +
+
+ +
+ + +
+ +
Commands
+ +
- +
-
User
+
Get Firmware Version
@@ -37,21 +96,18 @@
- - - -
+
- +
-
Channels
+
Reboot
@@ -61,26 +117,6 @@
- - -
- - -
- - - -
- - -
Reboot
- - -
- - - -
@@ -107,6 +143,15 @@ export default { getNodeLongName: (nodeId) => NodeUtils.getNodeLongName(nodeId), getNodeColour: (nodeId) => NodeUtils.getNodeColour(nodeId), getNodeTextColour: (nodeId) => NodeUtils.getNodeTextColour(nodeId), + async getDeviceFirmwareVersion(nodeId) { + try { + const response = await NodeAPI.remoteAdminGetDeviceMetadata(nodeId); + const firmwareVersion = response.firmwareVersion; + alert(firmwareVersion ?? "Unknown Firmware Version"); + } catch(e) { + DialogUtils.showErrorAlert(e); + } + }, async reboot(nodeId) { // confirm user wants to reboot node diff --git a/src/js/NodeAPI.js b/src/js/NodeAPI.js index e16bf5d..e084e30 100644 --- a/src/js/NodeAPI.js +++ b/src/js/NodeAPI.js @@ -481,6 +481,26 @@ class NodeAPI { } + /** + * Sends an admin request to get device metadata from the provided node id + * @param nodeId + * @returns {Promise<*>} + */ + static async remoteAdminGetDeviceMetadata(nodeId) { + + // create admin message packet + const adminMessageRequest = Protobuf.Admin.AdminMessage.fromJson({ + getDeviceMetadataRequest: true, + }); + + // send packet and wait for response + const adminMessageResponse = await this.sendAdminPacketAndWaitForResponse(nodeId, adminMessageRequest, true); + + // return device metadata from admin response + return adminMessageResponse.payloadVariant.value; + + } + } export default NodeAPI;