• MattFox

    I trust that you've added the userModule in the UI Settings otherwise the component won't show.

    1. once under page editor you can add them by typing them in.
      In this case:
    <my-component name="'Foxtrot'"></mycomponent>
    

    I believe you can also drag and drop them in the dashboard editor from the user components drop down.

    @wallobee said in User component menu not showing up in dashboard designer:

    How do I define the components/directives in my user module?
    I copied the example from the tutorial
    0_1558371833489_853e5e9a-ae9a-46b7-bc6d-dc211fbe5208-image.png

    How do i work around and add them manually to the page?

    If by manually you mean with your own dashboard page templates you'll need to move away from using the public file store and break everything out into files. If you've looked at the dialogue component I wrote that you commented on you'll see how it's all laid out.

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

    Our beloved search button at the top right of this site to left of the notification bell.
    Also you can scroll through post history of a user under their profile.

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

    Possibly if you split/explode the string (alphanumeric point value) by the separators into an array then convert each value to a numeric.... Then you can apply your mathematical analysis...

    posted in User help read more
  • MattFox

    Thanks Phil, I'll keep these in mind also

    posted in User help read more
  • MattFox

    Yep, please let me know how you get on, the feedback is always welcome.

    posted in User help read more
  • MattFox

    Hi Ceremona, welcome to the forum!

    If you look at the '?' there is a full blown user help for how to utilise these sources.
    0_1557966258052_8d9b2c7d-6af9-4c33-9e0d-e8661cde99c8-image.png

    As can be read, the url you need to post to is http://[mangodomain|localhost]/httpds

    Anyway, you see that set point url I'm pointing to?
    EDIT: Sorry I meant to mean device white list, I was pointing at the wrong textbox!
    You set that as your reference so it will land (the data) in this datasource.
    the parameter being __device

    Here's a snippet:

    var _URL="http://ipAddressHere/httpds?__device=DEMO&QUANTUMM1="+pt*.value+'@'+pt*.time;
           httpReq(_URL,"post",res,{'Content-Type':'application/x-www-form-urlencoded'},{});
    

    Where in this case QUANTUMM1 is my point identifier in the data point in the data source itself.
    0_1557966635843_58b8e4cc-a686-46da-801d-508e2afb5c6a-image.png

    The format as you can see in the code (1 of the allowed formats at least, read the datasource help for the others) is "+pt*.value+'@'+pt*.time
    So value first, separated by an '@' then a timestamp. NOTE This format I believe is the publisher set format for the set format option of this datasource so you can use a mango publisher to flick data via an http publisher to a mango http receiver datasource.

    So as a recap:

    params: __device=[setPointUrl]
    &httpParameterName=[value]@[Timestamp]

    url: mangoUrl/httpds

    You can test by clicking on the 'Listen for HTTP data' button to ascertain if your values are coming through.
    Any further confusion, we're all here to help

    Fox

    posted in User help read more
  • MattFox

    Sorry just realised the URl ain't working. Fixing it now..
    EDIT:
    done, sorry spent some time trying to make it look at least a little bit pretty!

    posted in User help read more
  • MattFox

    Alright! As promised, how to use what you need to get data from a specific filestore.
    I've utilised/hacked some of Jared's code (Sorry Jared!) to make a quicker turnaround.

    1. the /opt/mango/overrides/modules/mangoUI/web/dev/controllers/userFileStore.js component
    /*
    File:userFileStore.js
    Date:16/5/2019
    Author: Matt 'Fox' Fox
    Desc: quick file list generator of anchor links in angular js for @psysak
    */
    define(['angular', 'require'], function(angular, require) {
    
    function UserFilesController($http,maFileStore)
    {
    	var ctrl = this;
    	ctrl.fileStoreName = 'default';
    	
    	const fileStoreUrl = '/rest/v2/file-stores';
    	const fileStoreUrlSplit = fileStoreUrl.split('/');
    	
    	this.$onChanges = function(e)
    	{
    		if(e.fileStoreName && e.fileStoreName.currentValue!==undefined)
    		{
    			ctrl.fileStoreName = e.fileStoreName.currentValue.split('/');
    			getFileList();
    		}
    	}
    	
    	var toUrl = function(isDirectory) {
        	const parts = ctrl.fileStoreName.map(function(part) {
        		return encodeURIComponent(part);
        	});
        	let url = fileStoreUrl + '/' + parts.join('/');
        	if (isDirectory) {
        		url += '/';
        	}
        	return url;
        };
    	
    	var getFileList = function(){
    		
    		if (ctrl.fileStoreName.length < 1) {
    			throw new Error('Must specify the file store name');
    		}
    		const folderUrl = toUrl(true);
    		return $http({
    			method: 'GET',
    			url: folderUrl
    		}).then(function(response) {
    			ctrl.fileStoreList=response.data.map(function(file) {
    				// return new FileStoreFile(ctrl.fileStoreName[0], file);
    				return new maFileStore.newFileStoreFile(ctrl.fileStoreName[0], file);
    			});
    		});
    	};	
    				
    }
    		UserFilesController.$inject = ['$http','maFileStore'];
    	return	{
            bindings: {
    	   fileStoreName:'<'
            },
            scope: {},
            templateUrl: "/modules/mangoUI/web/dev/views/userFileStore.html",
            // you can inject services into the controller
            controller:('UserFilesController',UserFilesController)
    	};
    	
    	
    });//define
    
    1. /opt/mango/overrides/modules/mangoUI/web/dev/views/userFileStore.html
    <a ng-repeat="file in $ctrl.fileStoreList" class="md-icon-button md-button md-mangoLight-theme md-ink-ripple"  style="display:inline-block;min-width:300px;"  ng-if="!file.directory" download="" ng-href="file.url" ng-click="$ctrl.cancelClick($event)" aria-label="" href="{{file.url}}">
    {{file.filename}}
    		        		<md-icon class="md-mangoLight-theme material-icons" style="display:inline-block" role="img" aria-label="file_download">file_download</md-icon>
    		        		
    <div class="md-ripple-container"></div></a>
    
    
    1. /opt/mango/overrides/modules/mangoUI/web/dev/userModule.js
    define(['angular', 'require','./controllers/userFileStore.js'], function(angular, require,userFileStore)
    {
    var userModule = angular.module('userModule', ['maUiApp']);
    try {
    userModule.component('userFileStore', userFileStore);
    }catch(e){console.log(e);}
    });//define
    

    EDIT:
    Oops, forgot the component tag:

    <user-file-store file-store-name="'default'"></user-file-store>
    

    Let me know if you need further help.

    Fox

    posted in User help read more
  • MattFox

    ok cool, that's easy enough, So you're going to restrict them to a given filestore directory?
    If so, let's get this ball rollin!

    posted in User help read more