Dashticz - General Discussions
Moderators: leecollings, htilburgs, robgeerts
-
- Posts: 1273
- Joined: Saturday 24 January 2015 22:12
- Target OS: NAS (Synology & others)
- Domoticz version: 3.7067
- Location: NL
- Contact:
Re: New Dashboard Design
If you open console (F12) and reload the dashboard, you can see a call made to Domoticz (network-tab), if you click on it, it will show his response, could you send me this response in a PM?
Verstuurd vanaf mijn SM-G930F met Tapatalk
Verstuurd vanaf mijn SM-G930F met Tapatalk
-
- Posts: 89
- Joined: Friday 09 October 2015 17:40
- Target OS: Linux
- Domoticz version:
- Contact:
Re: New Dashboard Design
I want to change the image of a custom selector switch based on the levels
I can see there is some code for that but it is hashed out.
It seems I only have to define the levels and the icon I want to show for that level?
like:
Right?
Another question{
How can I change that to my custom idx?
I can see there is some code for that but it is hashed out.
Code: Select all
//if(parseFloat(data.result[r]['Level'])==0) switchHTML+='<img src="img/'+buttonimg+$
//else
switchHTML+='<img src="img/'+buttonimg+'_on.png" class="on icon" />';
like:
Code: Select all
if(parseFloat(data.result[r]['Level'])==10) switchHTML+='<img src="img/some-image"
elseif
if(parseFloat(data.result[r]['Level'])==20) switchHTML+='<img src="img/some-other-image"
else
switchHTML+='<img src="img/'+buttonimg+'_off.png" class="on icon" />';
Another question
Code: Select all
else if(typeof(data.result[r]['LevelActions'])!=='undefined' && data.result[r]['LevelActions']!=="")
How can I change that to my custom idx?
-
- Posts: 1273
- Joined: Saturday 24 January 2015 22:12
- Target OS: NAS (Synology & others)
- Domoticz version: 3.7067
- Location: NL
- Contact:
Re: New Dashboard Design
Right!Ierlandfan wrote: It seems I only have to define the levels and the icon I want to show for that level?
Right?
Another question
Code: Select all
else if(typeof(data.result[r]['LevelActions'])!=='undefined' && data.result[r]['LevelActions']!=="")
Code: Select all
else if(data.result[r]['idx']==123)
-
- Posts: 89
- Joined: Friday 09 October 2015 17:40
- Target OS: Linux
- Domoticz version:
- Contact:
Re: New Dashboard Design
This test ended up in missing text and completely no block of switches
(I suck in coding html and javascript I know....I probably forgot some } somewhere?)
(I suck in coding html and javascript I know....I probably forgot some } somewhere?)
$('#groups').append(switchHTML);
}
else if(data.result[r]['idx']==104)
var actions = data.result[r]['LevelActions'].split('|');
var names = data.result[r]['LevelNames'].split('|');
var switchHTML = '<div class="col-md-4 mb no-pr switch" data-light="'+data.result[r]['idx']+'">';
switchHTML+='<div class="transbg"> ';
switchHTML+='<div class="col-md-4 no-padding">';
###
if(parseFloat(data.result[r]['Level'])==10) switchHTML+='<img src="img/weekend.png">;
else
if(parseFloat(data.result[r]['Level'])==20) switchHTML+='<img src="img/other-image'>;
else
if(parseFloat(data.result[r]['Level'])==30) switchHTML+='<img src="img/groen.png">;
else
if(parseFloat(data.result[r]['Level'])==40) switchHTML+='<img src="img/'+buttonimg+$
else
if(parseFloat(data.result[r]['Level'])==50) switchHTML+='<img src="img/'+buttonimg+$
else
if(parseFloat(data.result[r]['Level'])==60) switchHTML+='<img src="img/'+buttonimg+$
else
if(parseFloat(data.result[r]['Level'])==70) switchHTML+='<img src="img/'+buttonimg+$
else
if(parseFloat(data.result[r]['Level'])==90) switchHTML+='<img src="img/'+buttonimg+$
else
switchHTML+='<img src="img/'+buttonimg+'_on.png" class="on icon" />';
switchHTML+='</div>';
switchHTML+='<div class="col-md-8 no-padding">';
switchHTML+='<strong class="title">'+data.result[r]['Name']+'</strong><br />';
switchHTML+='<select onchange="switchDeviceBtn(this,this.value);">';
switchHTML+='<option value="">Selecteer</option>';
for(a in actions){
switchHTML+='<option value="'+actions[a]+'">'+names[a]+'</option>';
}
switchHTML+='</select>';
switchHTML+='</div>';
switchHTML+='</div>';
switchHTML+='</div>';
$('#switches').append(switchHTML);
}
else if(typeof(data.result[r]['LevelActions'])!=='undefined' && data.result[r]['LevelActions']!==""){
var actions = data.result[r]['LevelActions'].split('|');
var names = data.result[r]['LevelNames'].split('|');
-
- Posts: 1273
- Joined: Saturday 24 January 2015 22:12
- Target OS: NAS (Synology & others)
- Domoticz version: 3.7067
- Location: NL
- Contact:
Re: New Dashboard Design
Please attach your main.js to your reply..
-
- Posts: 89
- Joined: Friday 09 October 2015 17:40
- Target OS: Linux
- Domoticz version:
- Contact:
-
- Posts: 1273
- Joined: Saturday 24 January 2015 22:12
- Target OS: NAS (Synology & others)
- Domoticz version: 3.7067
- Location: NL
- Contact:
Re: New Dashboard Design
Well, you missed a lot of } and ' but I fixed it.
Don't know if the result is expected but at least there are no more parse errors in the script.
Don't know if the result is expected but at least there are no more parse errors in the script.
- Attachments
-
- main.js
- (14.94 KiB) Downloaded 124 times
-
- Posts: 108
- Joined: Thursday 12 February 2015 7:51
- Target OS: Linux
- Domoticz version:
- Contact:
Re: New Dashboard Design
Is there an easy/simple way to display only the groups, switches and sliders?
I tried to edit the index.html, but I end up with only the left side of the screen filled.
I tried to edit the index.html, but I end up with only the left side of the screen filled.
-
- Posts: 1273
- Joined: Saturday 24 January 2015 22:12
- Target OS: NAS (Synology & others)
- Domoticz version: 3.7067
- Location: NL
- Contact:
Re: New Dashboard Design
You have to change:
to:
On row 34
Code: Select all
<div class="col-md-5" style="padding-right:30px;">
Code: Select all
<div class="col-md-12" style="padding-right:30px;">
-
- Posts: 108
- Joined: Thursday 12 February 2015 7:51
- Target OS: Linux
- Domoticz version:
- Contact:
Re: New Dashboard Design
I'll grab a cool beer and try this immediately
Txs!
Txs!
-
- Posts: 108
- Joined: Thursday 12 February 2015 7:51
- Target OS: Linux
- Domoticz version:
- Contact:
Re: New Dashboard Design
This way I get 3 very wide switchboxes on every row.
Is there a way to get about 8 of them on each row?
I wish I didn't have to ask these simple questions, but unfortunately I'm not a coder
-
- Posts: 1273
- Joined: Saturday 24 January 2015 22:12
- Target OS: NAS (Synology & others)
- Domoticz version: 3.7067
- Location: NL
- Contact:
Re: New Dashboard Design
You can found several times things like 'col-md-6' or 'col-md-4' in main.js, change the number to 1,2,3, etc, for example: col-md-1
Verstuurd vanaf mijn SM-G930F met Tapatalk
Verstuurd vanaf mijn SM-G930F met Tapatalk
-
- Posts: 6
- Joined: Sunday 19 February 2017 19:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: New Dashboard Design
Very nice dashboard! I got it working by copying the contents, changing the domoticz ip, wunderground api and so on.
Only problem is it doesn't automatically load my favorite switches. It doesn't load a single switch at all. What can I do about this?
Only problem is it doesn't automatically load my favorite switches. It doesn't load a single switch at all. What can I do about this?
-
- Posts: 1273
- Joined: Saturday 24 January 2015 22:12
- Target OS: NAS (Synology & others)
- Domoticz version: 3.7067
- Location: NL
- Contact:
Re: New Dashboard Design
I think you've set the wrong IP or PORTnumber of Domoticz.
Or do you have a username/password?
If you have username/password, enter:
http://username:pass@ip:port
e.g.: http://admin:[email protected]:8080
or if you don't have a password:
http://ip:port
e.g.: http://192.168.1.23:8080
If it still doesn't work, open your console (F12) en see if it shows any errors in console-tab.
Or do you have a username/password?
If you have username/password, enter:
http://username:pass@ip:port
e.g.: http://admin:[email protected]:8080
or if you don't have a password:
http://ip:port
e.g.: http://192.168.1.23:8080
If it still doesn't work, open your console (F12) en see if it shows any errors in console-tab.
-
- Posts: 89
- Joined: Friday 09 October 2015 17:40
- Target OS: Linux
- Domoticz version:
- Contact:
Re: New Dashboard Design
Thanx for the main.js! Perfect! Level off and no image it won't show which is exactly what I wanted!
I noticed that the page does not respond to the change of switches. I have to manually reload (F5) the page for the change to show up.
Is there any refresh timer I can adjust?
I noticed that the page does not respond to the change of switches. I have to manually reload (F5) the page for the change to show up.
Is there any refresh timer I can adjust?
-
- Posts: 1273
- Joined: Saturday 24 January 2015 22:12
- Target OS: NAS (Synology & others)
- Domoticz version: 3.7067
- Location: NL
- Contact:
Re: New Dashboard Design
My dashboard does response to the change of switches, although it could take some seconds... After a click on the switch it gets the new states of all switches from Domoticz and rebuild the blocks.
Verstuurd vanaf mijn SM-G930F met Tapatalk
Verstuurd vanaf mijn SM-G930F met Tapatalk
-
- Posts: 89
- Joined: Friday 09 October 2015 17:40
- Target OS: Linux
- Domoticz version:
- Contact:
Re: New Dashboard Design
I started over..unzipped the original (with the then 2 hours old update) dashboard..only changed CONFIG.js (IP and Port) No refesh.
I started over...downloaded the original tar (a few minutes ago) dashboard..untarred the archive...only changed CONFIG.js (IP and Port) No refesh.
Tried Chrome, Microsoft Edge & IE..no refresh.
Tot test Domoticz I installed another frontpage...that responded.
Could it be that the update from yesterday broke the refresh?
I started over...downloaded the original tar (a few minutes ago) dashboard..untarred the archive...only changed CONFIG.js (IP and Port) No refesh.
Tried Chrome, Microsoft Edge & IE..no refresh.
Tot test Domoticz I installed another frontpage...that responded.
Could it be that the update from yesterday broke the refresh?
-
- Posts: 1273
- Joined: Saturday 24 January 2015 22:12
- Target OS: NAS (Synology & others)
- Domoticz version: 3.7067
- Location: NL
- Contact:
Re: New Dashboard Design
Well, its possible, do you get any errors in console (F12)?
-
- Posts: 89
- Joined: Friday 09 October 2015 17:40
- Target OS: Linux
- Domoticz version:
- Contact:
Re: New Dashboard Design
Did a git clone (just to make sure)...same result.
I checked out branch 8fb5c41f and that one worked immediately.
No errors in the console for as far as I can see. I can see that nzbget (which i don't use) is the only part that updates.
I checked out branch 8fb5c41f and that one worked immediately.
No errors in the console for as far as I can see. I can see that nzbget (which i don't use) is the only part that updates.
-
- Posts: 1273
- Joined: Saturday 24 January 2015 22:12
- Target OS: NAS (Synology & others)
- Domoticz version: 3.7067
- Location: NL
- Contact:
Re: New Dashboard Design
I'll check tonight!
Who is online
Users browsing this forum: Bing [Bot] and 1 guest