• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Custom modules in deshboard designer menu

    Development general discussion
    3
    7
    2.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sstuhlmann
      last edited by

      Is there a way for me to code into my module/controller or something at load time that will register my Controllers with the dashboard designer. Currently I have to add this

       {
          name: "dk-graphics",
          translation: "dkDeviceGraphics.description",
          filter: {
      	 moduleName: "dkGraphicsModule"
                    },
          strictFilter: !0
        },
      

      to the 'componentSections' of the dashboardDesignerModule. And then put it in the overrides folder. I would rather not have to copy/modify/load this everytime you guys put out an update. That would actually be impractical if not impossible if I start deploying these at customer sites.

      OR a second option:

      Can I write an extension to dashboard designer module which will do it? Then I could use module dependencies and push an update.

      1 Reply Last reply Reply Quote 0
      • S
        sstuhlmann
        last edited by

        I thought of a third option. A minor change to the dashboardDesigner module code that would read some external file and add those into the component sections. Then developers could just add/modify that(those) files. But really, once I add my section code into the file/folder, the system would just always read and add that when loading the DD module. It would only need to be changed if there was a major structural change to the componentSections part of the module.

        Just a thought.

        And for clarification, I'm not using the userModule. My intention is to avoid using that all together as I'm working on deeper module development.

        MattFoxM 1 Reply Last reply Reply Quote 0
        • Jared WiltshireJ
          Jared Wiltshire
          last edited by

          @sstuhlmann said in Custom modules in deshboard designer menu:

          And for clarification, I'm not using the userModule. My intention is to avoid using that all together as I'm working on deeper module development.

          How are you loading the AngularJS module then? Using a Mango module which has a AngularJSModuleDefinition?

          Developer at Radix IoT

          1 Reply Last reply Reply Quote 0
          • MattFoxM
            MattFox @sstuhlmann
            last edited by MattFox

            @sstuhlmann said in Custom modules in deshboard designer menu:

            And for clarification, I'm not using the userModule. My intention is to avoid using that all together as I'm working on deeper module development.

            If you're going to do that, you might as well write something custom and load it somewhere else and talk via the API. The usermodule exists to extend the dashboard, not overwrite it. Alternatively, write new directives and load those in pages instead of other mango pages via the usermodule. It's honestly not that hard.
            Your menu changes will be saved in the mango sql database.

            @sstuhlmann said in Custom modules in deshboard designer menu:

            I would rather not have to copy/modify/load this everytime you guys put out an update.

            That I do agree with and have raised it myself with custom UI code, as I'm the sole dev. It does slow down my ability to roll out updates with our custom code, but that's how it is now since mango's UI has been reformatted into ES6. All I can do is test, shoot, and hope.

            Do not follow where the path may lead; go instead where there is no path.
            And leave a trail - Muriel Strode

            1 Reply Last reply Reply Quote 0
            • Jared WiltshireJ
              Jared Wiltshire
              last edited by Jared Wiltshire

              @sstuhlmann I agree that Mango modules should be able to add sections. I'll put out a new Dashboard Designer soon in which you can configure a service in order to add sections.

              const myModule = angular.module('myModule', ['maUiApp']);
              
              // no way to specify an option module require in AngularJS, UI bootstrap will pick this up and add it to the module requires if module is present
              // If you know Dashboard Designer module will always be present then you can add it the the standard requires above (after maUiApp)
              myModule.optionalRequires = ['maDashboardDesigner'];
              
              myModule.config(['$injector', function($injector) {
                  // check with the injector that the service provider is present
                  if ($injector.has('maDesignerTagInfoProvider')) {
                      $injector.get('maDesignerTagInfoProvider').addComponentSection({
                          name: 'my-components',
                          translation: 'my.components',
                          filter: {
                              moduleName: 'myModule'
                          },
                          strictFilter: true
                      }, 'mango-modules');
                      // mango-modules is the name of the section that this one will be added before
                  }
              }]);
              
              

              Developer at Radix IoT

              1 Reply Last reply Reply Quote 0
              • Jared WiltshireJ
                Jared Wiltshire
                last edited by

                @sstuhlmann

                https://forum.infiniteautomation.com/topic/3867/release-notes-for-dashboarddesigner-3-5-1

                Developer at Radix IoT

                1 Reply Last reply Reply Quote 0
                • S
                  sstuhlmann
                  last edited by

                  Yes, I am writing completely independent modules with definition java files. I'm currently just running development and testing locally. Once I build my new module (which lists module-parent as its parent), I just drop the zip onto my MangoES. I'm currently working on two modules. One is a better and more standardized deviceConfig/templating module. And the second is a graphical gauges one which wraps ma-gauge and uses the DP tags to dynamically load different layouts. Like so:

                  0_1540483102020_b5380d8c-f55c-4e61-95ac-4611870ee1ae-image.png

                  The injector will be great. Should work out for me nicely.

                  At some point I will look at publishing my modules to the store. But they aren't quite ready for prime time.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post