• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. cbyrne
    3. Best

    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
    • Profile
    • Following 0
    • Followers 0
    • Topics 43
    • Posts 93
    • Best 7
    • Controversial 1
    • Groups 0

    Best posts made by cbyrne

    • RE: How to call a global script from dashboard?

      Finally got a working solution. Posted the basic custom module below for anyone else who comes across this thread.

      define(['angular', 'require'], function(angular, require) {
      'use strict';
      
      var userModule = angular.module('userModule', ['maUiApp']);
      
      userModule.component('userComponent', {
          bindings: {},
          controller: ['$scope', '$http', 
              function($scope, $http){
                  $scope.msg = null;
                  $scope.sendPost = function(point_xid, date_from, date_to, email_recipients){
                      var from = JSON.stringify(date_from);
                      var to = JSON.stringify(date_to);
                      var emails = JSON.stringify(email_recipients);
                      var script = "send_HTTP_debug(point_xid, " + from + ", " + to + ", " + emails + ")"
      
                      var address= "/rest/v2/script/run";
                      var content = {'Content-Type': 'application/json;charset=UTF-8'};
                      var data = {
                            "context": [
                              {
                                "contextUpdate": true,
                                "variableName": "point_xid",
                                "xid": point_xid
                              },
                            ],
                            "logLevel": "DEBUG",
                            "permissions": [
                              "admin"
                            ],
                            "script": script,
                            "wrapInFunction": true
                      };
                      function success(response){$scope.msg=response;};
                      function error(response){$scope.msg=response;};
      
                      $http.post(address, JSON.stringify(data),content).then(success, error);
                  };
              }],
          template: '\
          <div flex layout="column">\
              <md-input-container md-no-float="">\
                  <label>Point</label>\
                  <ma-point-list ng-model="point" query="query_tmpVal" start="start_tmpVal" limit="limit_tmpVal" sort="sort_tmpVal"></ma-point-list>\
              </md-input-container>\
              <div flex layout="row">\
                  <md-input-container style="flex-grow:1">\
                  <label>From</label>\
                      <ma-date-picker ng-model="date_from" mode="date" format="DD/MM/YYYY"></ma-date-picker>\
                  </md-input-container>\
                  <div style="width="10vw">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>\
                  <md-input-container style="flex-grow:1">\
                      <label>To</label>\
                      <ma-date-picker ng-model="date_to" mode="date" format="DD/MM/YYYY"></ma-date-picker>\
                  </md-input-container>\
              </div>\
              <md-input-container>\
                  <ma-email-recipients ng-model="email_recipients"></ma-email-recipients>\
              </md-input-container>\
              <md-button class="md-primary md-raised" ng-click="sendPost(point.xid, date_from, date_to, email_recipients)">Request Report</md-button>\
              <p>{{msg}}</p>\
          </div>\
          '
      });
      
      return userModule;
      
      }); // define
      
      posted in User help
      cbyrneC
      cbyrne
    • Request for FTL Reports module in Mango v4

      Email reports are one of our most used features and the main thing keeping us from moving to v4.

      posted in Mango feedback
      cbyrneC
      cbyrne
    • RE: Data File 3.7 issues

      @terrypacker Just updated the module and saw that you added the filename regex, thanks so much!

      posted in User help
      cbyrneC
      cbyrne
    • SElinux modification required for mango bin/ scripts

      Just something I noticed while doing a new test install of v4.

      If SElinux is enabled, the bash scripts in the mango bin directory need a small modification to their type otherwise mango.service will fail with

      mango.service: Failed at step EXEC spawning /opt/mango/bin/start-mango.sh: Permission denied
      

      To check a file's SElinux type, pass the -Z flag to ls.

      ls -Z /opt/mango/bin/
      unconfined_u:object_r:user_home_t:s0 certbot-deploy.sh*  
      unconfined_u:object_r:user_home_t:s0 mango.cmd
      unconfined_u:object_r:user_home_t:s0 start-options.sh*
      unconfined_u:object_r:user_home_t:s0 genkey.sh*
      unconfined_u:object_r:user_home_t:s0 mango.service
      unconfined_u:object_r:user_home_t:s0 stop-mango.sh*
      unconfined_u:object_r:user_home_t:s0 getenv.sh*
      unconfined_u:object_r:user_home_t:s0 mango.xml
      unconfined_u:object_r:user_home_t:s0 install-mango.sh*
      unconfined_u:object_r:user_home_t:s0 start-mango.sh*
      

      In order to be run from a systemd service, the scripts need to be of type bin_t. Their type can be changed using chcon.

      sudo chcon -t bin_t /opt/mango/bin/*.sh
      

      Now the files are of the correct SElinux type and mango.service will run as expected.

      ls -Z /opt/mango/bin/
      unconfined_u:object_r:bin_t:s0 certbot-deploy.sh*
      unconfined_u:object_r:user_home_t:s0 mango.cmd
      unconfined_u:object_r:bin_t:s0 start-options.sh*
      unconfined_u:object_r:bin_t:s0 genkey.sh*
      unconfined_u:object_r:user_home_t:s0 mango.service
      unconfined_u:object_r:bin_t:s0 stop-mango.sh*
      unconfined_u:object_r:bin_t:s0 getenv.sh*
      unconfined_u:object_r:user_home_t:s0 mango.xml
      unconfined_u:object_r:bin_t:s0 install-mango.sh*
      unconfined_u:object_r:bin_t:s0 start-mango.sh*
      

      Might be helpful info to add to the linux documentation.

      posted in Mango feedback
      cbyrneC
      cbyrne
    • RE: Out of memory problem

      Perfect, thanks @terrypacker! I'll try that and update this post.

      update 1:
      The H2 database shell doesn't recognise LIKE in CREATE TABLE. It may not be supported, The H2 command info for CREATE DATABASE doesn't show LIKE - https://www.h2database.com/html/commands.html#create_table

      update 2
      I just did a DELETE FROM EVENTS; instead.

      So yeah, there might have been a few too many events... 12 million. The database has gone from ~6 Gb to 76 Mb.

      posted in User help
      cbyrneC
      cbyrne
    • RE: Could not convert socket to TLS; nested exception is: javax.net.ssl.SSLHandshakeException

      @jared-wiltshire Oh I know... that's a whole other issue. I'm painfully aware how silly this is!

      posted in User help
      cbyrneC
      cbyrne
    • Filter behaviour and ma-data-point-selector

      The filter behaviour in the Data Sources > Data Points list is excellent. Primarily, it is case insensitive and has an implied glob. I would like to suggest that it is applied to the data point details page's data point selector also.

      I would also like to add this filter behaviour to my own pages that use ma-data-point-selector, any advice on how to go about this would be appreciated.

      ma-data-point-selector is an great component and I really like using it in my own pages, could we please get some documentation? Up to now I've gone off guesses and page inspections.

      Thanks!

      posted in User help
      cbyrneC
      cbyrne