dsternlicht / RESTool

RESTool is an open source UI tool for managing RESTful APIs. It could save you time developing your own internal tools. A live example:
https://dsternlicht.github.io/RESTool/
MIT License
480 stars 121 forks source link

Present all dataPath data #201

Open joseapdmota opened 2 years ago

joseapdmota commented 2 years ago

Taking example on the config-sample.json, with a small nuance by adding the field valid:


{
  "page": 1,
  "limit": 20,
  "total": 11,
  "valid": true,
  "items": [
    {
      "id": "aI8Li80Dr8Vx",
      "thumbnail": "https://www.hbo.com/content/dam/hbodata/series/game-of-thrones/character/s5/tyrion-lannister-512x512.jpg/_jcr_content/renditions/cq5dam.web.260.260.jpeg",
      "name": "Tyrion Lannister",
      "realName": "Peter Dinklage",
      "location": "Winterfell",
      "isAlive": true
    },
...

Is it possible to present the values on the fields total and valid only?

Thanks

dsternlicht commented 2 years ago

@joseapdmota hey, I'm not sure I understand what's the purpose of the new valid field you suggest to add.

joseapdmota commented 2 years ago

@dsternlicht it might be a bit confusing indeed.

Let me put it in a different way, the data i'm return is regarding the status of GPIO's and some modules on the system.

This is what i'm retrieving:

{
  "gpio_44": false,
  "gpio_45": false,
  "gpio_46": true,
  "gpio_47": true,
  "modbus.ac_meter_live_rx.voltage_L1": 230.1999969482422,
  "modbus.ac_meter_live_rx.voltage_L2": 231.8999938964844,
  "modbus.ac_meter_live_rx.voltage_L3": 230.1999969482422,
  "modules": [
    {
      "active": true,
      "system_gpios": [
        44,
        45,
        46,
        47
      ],
      "status": true,
      "frequency": 1000,
      "module": "system"
    },
   ],
...

Currently, i'm able to display the data from modules without issues, nonetheless i didn't find an easy way to display the data from gpio_45 or modbus.ac_meter_live_rx.voltage_L1.

Noob here, so i'm not sure if that is possible at all.

Thanks

dsternlicht commented 2 years ago

You should simply set the filed's name to gpio_45 or modbus.ac_meter_live_rx.voltage_L1.