loads / loads-web

Web dashboard for Loads
Apache License 2.0
5 stars 3 forks source link

Pretty-print the JSON in the project builder #47

Closed pdehaan closed 9 years ago

pdehaan commented 9 years ago

Currently, we're displaying the JSON blob, but it'd be nice if it was a bit prettier (but i'm sure the JSON is pretty on the inside).

Current output:

{"project_title":"project title","plans":[{"plan_title":"plan 1 title","plan_description":"plan 1 desc","steps":[{"step_name":"","instance_count":"4","run_max_time":"4000","run_delay":"267","step_url":"","environment_data":"","dns_mapping":"","port_mapping":"","volume_mapping":"","docker_series":""}]}]}

Better output:

{
  "project_title": "project title",
  "plans": [
    {
      "plan_title": "plan 1 title",
      "plan_description": "plan 1 desc",
      "steps": [
        {
          "step_name": "",
          "instance_count": "4",
          "run_max_time": "4000",
          "run_delay": "267",
          "step_url": "",
          "environment_data": "",
          "dns_mapping": "",
          "port_mapping": "",
          "volume_mapping": "",
          "docker_series": ""
        }
      ]
    }
  ]
}

Protip: JSON.stringify(data, null, 2)

There may be an Angular module for prettier JSON, but the above stringify() should be a quick fix.

pdehaan commented 9 years ago

Possible Bower modules if we don't want to roll our own: http://bower.io/search/?q=ng-json

pdehaan commented 9 years ago

Left a comment in https://github.com/loads/loads-web/pull/46/files#r24284482 as well since that code hasn't technically landed yet.

pdehaan commented 9 years ago

Closing, fixed by #56