• ThomasEinasto

    Not to say something but the link has the source code of all the dialogs if you click on top right corner of each example md-card. To make it more dynamic you should program it with Angular components/directives.

    posted in Wishlist read more
  • ThomasEinasto

    Hi @sky_watcher

    I assume your external IP which you provided is your own modem IP (router). And your MangoES is connected into your local network. You should first see port forwarding to make it secure and to make your router forward remote connections to your ES. This is not good practice as you will be providing to everyone your router which is not a server per say.

    See, for more information-> https://portforward.com/

    Secondly you should buy a domain to get an human understandable address. https://www.sky_watcher.net for an example.

    After buying a domain you can assign this domain dns to be linked with your ip address. Then you would have to wait for a few hours after your dns settings have been updated through all dns servers.

    Then if you go to your bought domain name through your browser then the dns server which you are using for your computer will connect you remotely to your assigned IP address.

    More information is in available like this.
    https://www.ntchosting.com/encyclopedia/dns/ip-address/

    Thomas

    posted in Mango Automation read more
  • ThomasEinasto

    Several options are available like @phildunlap said.

    Following way is more functional by using ng-init to define units and rounding and then using .value on the filter... This way you do not need to slice off the units on the text...

    <ma-svg ng-init="units='kW'; rounding=3" ng-include="'/rest/v2/file-stores/default/BuildingA.svg'">
    <!-- Mains -->
        <div ma-selector="#amainac tspan" ng-bind="(acmain.value | number:rounding) + units"></div>
    </ma-svg>
    <!-- AC Power -->
        <ma-get-point-value point-xid="DP_797e71a8-87e8-4b30-984f-4dcdbdd0d80e" point="acmain"></ma-get-point-value>
    
    

    Thomas

    posted in User help read more
  • ThomasEinasto

    Why cant you make for an example a meta datapoint which has 2 binary points one which is set true through an event and another through user execution after which this meta datapoint will leave "alarm state" and system can continue after the issue has been resolved? >> i.e both points are true

    Thomas

    posted in Wishlist read more
  • ThomasEinasto

    If I understand it correctly you would like to create some dialog window where you can override some settings or set some point values and then if user clicks outside of the window the window will close automatically.

    I would use md-dialog for something like that which Mango has...
    https://material.angularjs.org/latest/demo/dialog

    This however needs programming to be customized to your needs.

    Thomas

    posted in Wishlist read more
  • ThomasEinasto

    Hi @sbaik !

    If you use dashboards then easiest would be something like that

        <div ng-init="flouride = false"  ng-show="flouride === false">
        <md-button ng-click="flouride = true">
        Flouride
        </md-button>
        </div>
        
        <div ng-show="flouride === true">
        <md-button>
        West Plant Flouride
        </md-button>
        <md-button>
        East Plant Flouride
        </md-button>
        </div>
    

    First div is only shown when the first md-button is clicked and after that the two buttons are shown. Variable flouride is in angular $scope and only valid until user goes away from the page.

    ref https://docs.angularjs.org/api/ng/directive/ngShow

    Thomas

    posted in User help read more
  • ThomasEinasto

    Hi all,

    I am playing around with jsonStoreTable taken from here -> https://github.com/infiniteautomation/ma-dashboards/tree/3.3.x/UI/web/ngMango/components/jsonStoreTable

    As I am still learning about subscription to data I have a problem on filtering data of my stores.

    Filtering out stores which have certain string in their xid and then ordering them like I want is quite easy and understandable as it seems this data is accessible within my controller without problems.

            this.orderedItems = this.$filter('filter')(this.items,{xid: "Report"});
            this.orderedItems = this.$filter('orderBy')(this.orderedItems, this.tableOrder);
            this.count = this.orderedItems.length;
            this.latestXid = 'SavedReportData-' + this.orderedItems.length;
            this.nextXid = 'SavedReportData-' + (this.orderedItems.length + 1);
            this.dataTable = this.$filter('limitTo')(this.orderedItems,this.limit,(this.page-1)*this.limit);
    

    The problem is that I would like to filter out some of my stores which have certain variable value in their jsonData object.

    Lets say I have a following jsonStores:

    {
        "reportNo": 4,
        "approved": "testingstation",
        "name": "Thomas Einasto",
        "address": "Street name 34",
        "equipment": "Truck",
        "regno": "919BVY",
        "serialno": "2315824123",
        "firstentry": "2018-07-24",
        "tare": "2015",
        "carryingcapacity": "32153434",
        "finished":true
    },
    {
        "reportNo": 7,
        "approved": "testingstation",
        "name": "Thomas Einasto",
        "address": "Street name 34",
        "equipment": "Truck",
        "regno": "919BVY",
        "serialno": "2315824123",
        "firstentry": "2018-07-24",
        "tare": "2015",
        "carryingcapacity": "32153434",
        "finished":false
    }
    

    I would like to filter out all jsonStores which have reportNo 7. Filtering should work here just like filtering through xids from before work but I cannot access jsonStore because it is undefined in my filtering function.

    Correct me if I am wrong but as I understand $q and $promise make a subscription to the backend and then the data gets passed asynchronously to the object after all promises have been resolved and that is why if I try to pass

    console.log(this.dataTable[0]);
    console.log(this.dataTable[0].jsonData);
    

    at the end of the filtering I see jsonData on the first object log but I get undefined on the second log as browser has got the data from the server as chrome says on the object that:

    value below was evaluated just now
    

    Can someone point me to the right directions on how should I handle this kind of filtering so that I would gain access to my jsonStores in the right time? I think this is about correctly timing my filtering based on an event when the data has been loaded but as I am still learning I am at a problem here.

    Edit:

    Got it filtered by changing html ng-repeat for the table.

    <tr md-row ng-repeat='item in $ctrl.dataTable | filter:{ jsonData: {reportNo : 7}}' >
    

    But still interested in how to do it through a controller.

    Many Thanks
    Thomas

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • ThomasEinasto

    The reason why I commented this post here a couple of weeks ago :)

    https://forum.infiniteautomation.com/topic/3230/ssl-settings-on-mangoes

    Use @Jared-Wiltshire post on how to configure Mango settings and create your jks and my post to modify this jks so that you would add LetsEncrypt or other certs to the jks.

    posted in How-To read more
  • ThomasEinasto

    I would like to know one thing about the new filestorage folder .

    Do do I understand it correctly that ($MA_HOME)/filestore/public folder has the same logic like overrides folder so the updates on Mango do not modify the file contents.

    Reason is that as I am building my custom directives/components I would like to put html templates and files with them into folders for keeping a nice hierarchy of my customization.

    Another thing is that have you planned on showing other than .js files in the modal for better customization?

    i.e maybe add filtering for selectable files so that the selected files can be only .js but the user can also modify other files like html/css etc? Right now if I need to modify some html page I need to ssh into mango and modify it there. But it would be sometimes more convenient to do the modifications through the opened modal.

    Ideally I could probably do these modifications myself but this is just a suggestion as you also suggest to develop inside Mango system if I understand your logic behind recent developments of dashboards. : - )

    Thanks
    Thomas

    posted in Dashboard Designer & Custom AngularJS Pages read more