Dashboard tools?

Are there any nifty tools out there for dashboard. One thing that I seem to do a lot is move tiles down to make room for new rows. If the row that I need is near the top it can take quite a while to start at the bottom and move each tile one row down and work my way up in the list....

I see the data in the JSON file but moving though it and bumping the row number up is tricky and one mistake and I foul up the whole thing.

Of course, drag and drop would be wonderful but for now just some simple tools (like insert row). Also a global template change (across selected dashboards) would be nice also.

Thanks.

3 Likes

Several of us have asked for insert/delete row/column. These would definitely be helpful!

1 Like

I spend a lot of time moving tiles down, one by one, on the dashboards. I have had to do it so much that I absolutely hate adding devices to the dashboard because it is so tedious "scooting" the tiles down one by one. I have even tried to edit the JSON file directly.... easy to mess up... Any help?

1 Like

Agree!

Yes. Moving tiles around when adding a new device is... tedious (at best).

Hmmm.... JSON is a highly structured data representation, you'd think it would be easy for a computer to do a process like incrementing row numbers, rather than having human beings do that tedious and error-prone task.

I looked at several JSON editors and couldn't find one that would selectively increment the row.

Actually, I meant that this function should be incorporated into HE....but here's quickie perl script that will increment rows or columns, starting at a specified value and by a specified amount (ie., add 3 to row number 5 or higher, add 1 to column number 3 or higher).


#! /bin/perl -w

my $rowstart;	# first row to increment (ie., if start=4 then it becomes row 5, and rows 1-3 are untouched
my $colstart;	# first col to increment (ie., if start=4 then it becomes col 5, and cols 1-3 are untouched
my $rowinc=1;	# amount to increment rows
my $colinc=1;	# amount to increment cols
my $inputfile;	# amount to increment cols
my $colval;
my $rowval;

while (@ARGV)
{
	# I wish perl had a case() statement
	if ( $ARGV[0] =~ /^-rs|^--rowstart/ )
	{
		shift(@ARGV);
		$rowstart=$ARGV[0];
		shift(@ARGV);
		next;
	}
	
	if ( $ARGV[0] =~ /^-cs|^--colstart/ )
	{
		shift(@ARGV);
		$colstart=$ARGV[0];
		shift(@ARGV);
		next;
	}
	
	if ( $ARGV[0] =~ /^-ri|^--rowinc/ )
	{
		shift(@ARGV);
		$rowinc=$ARGV[0];
		shift(@ARGV);
		next;
	}
	
	if ( $ARGV[0] =~ /^-ci|^--colinc/ )
	{
		shift(@ARGV);
		$colinc=$ARGV[0];
		shift(@ARGV);
		next;
	}

	if ( $ARGV[0] =~ /^-f|^--file/ )
	{
		shift(@ARGV);
		$inputfile=$ARGV[0];
		shift(@ARGV);
		next;
	}
	
	printf STDERR "$0 -- Unrecognized argument: $ARGV[0]\n";
	printf STDERR "\nUsage: $0 [--rowstart # [--rowinc #]] [--colstart # [--colinc #]] --file inputfile.json\n";
	printf "\n";
	printf "Increment the rows and/or columns in a JSON file, beginning at the\n";
	printf "specified row- or column-starting number, and applying the specified\n";
	printf "amount (defaults to 1). Will read from STDIN or a specified file.\n";

	exit 1;
}

if ( !defined($inputfile) ) {
	# read from STDIN
	$inputfile="-";
} else {
	die "No such file: $inputfile" if ( ! -f $inputfile );
}


open(INPUTFILE,"$inputfile") or die "Could not open input file \"$inputfile\" for reading: $!";
while ( <INPUTFILE> )
{
	chomp;
	if ($_ =~ /^\s*"col":/ )  {
		if ( defined($colstart)) {
			($colval=$_)=~s/.* //; 
			$colval=~s/,//;
			if ( $colval >= $colstart )
			{
				$colval=$colval + $colinc;
				$_=~s/\d,$/$colval,/;
			}
		}
	}
	if ($_ =~ /^\s*"row":/ )  {
		if ( defined($rowstart)) {
			($rowval=$_)=~s/.* //; 
			$rowval=~s/,//;
			if ( $rowval >= $rowstart )
			{
				$rowval=$rowval + $rowinc;
				$_=~s/\d,$/$rowval,/;
			}
		}
	}
	print "$_\n";
}
printf "\n";