{"size": 1670, "ext": "js", "max_stars_repo_path": "code/scripts/controllers/ConfigurationController.js", "max_stars_repo_name": "OpenDSU/demiurge", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "code/scripts/controllers/ConfigurationController.js", "max_issues_repo_name": "OpenDSU/demiurge", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "code/scripts/controllers/ConfigurationController.js", "max_forks_repo_name": "OpenDSU/demiurge", "max_forks_repo_forks_event_min_datetime": "2021-10-21T12:34:52.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-21T12:34:52.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 22.8767123288, "max_line_length": 65, "alphanum_fraction": 0.5095808383}
const { Controller } = WebCardinal.controllers;

export default class ConfigurationController extends Controller {
  constructor(...props) {
    super(...props);

    this.model = {};
  }

  async onReady() {
    super.onReady();

    const container = this.getElementByTag("jsoneditor");
    const options = {
      modes: ["tree", "code"],
    };
    const editor = new JSONEditor(container, options);

    // set json
    const initialJson = {
      default: {
        replicas: [],
        brickStorages: ["$ORIGIN"],
        anchoringServices: ["$ORIGIN"],
      },
      epi: {
        replicas: [],
        brickStorages: ["$ORIGIN"],
        anchoringServices: ["$ORIGIN"],
      },
      predefined: {
        replicas: [],
        brickStorages: ["$ORIGIN"],
        anchoringServices: ["$ORIGIN"],
      },
      epidev: {
        replicas: [],
        brickStorages: ["$ORIGIN"],
        anchoringServices: ["$ORIGIN"],
      },
      "mah1.epidev": {
        replicas: [],
        brickStorages: ["$ORIGIN"],
        anchoringServices: ["$ORIGIN"],
      },
      "mah2.epidev": {
        replicas: [],
        brickStorages: ["$ORIGIN"],
        anchoringServices: ["$ORIGIN"],
      },
      epiqa: {
        replicas: [],
        brickStorages: ["$ORIGIN"],
        anchoringServices: ["$ORIGIN"],
      },
      vault: {
        replicas: [],
        brickStorages: ["$ORIGIN"],
        anchoringServices: ["$ORIGIN"],
      },
      "vault.nvs": {
        replicas: [],
        brickStorages: ["$ORIGIN"],
        anchoringServices: ["$ORIGIN"],
      },
    };
    editor.set(initialJson);

    // get json
    const updatedJson = editor.get();
  }
}
