Page 38 of 48
Re: Dashticz - Module - Garbage collector
Posted: Monday 09 November 2020 21:59
by Lokonli
Antoinne wrote: ↑Sunday 08 November 2020 21:27
Previsously I used this module with a custom 'ical' calender. After the recent update, I now get an "Error loading garbage data" on start-up. Would love to use the new block method. But can you add support for Grondstoffen- en Afvalstoffendienst regio Gooi en Vechtstreek (
https://inzamelkalender.gad.nl)?
hmm, ical should work. It's used internally as well for a few garbage providers.
Anyway, I've added 'gad' as garbage provider to latest beta. Can you test?
Re: Dashticz - Module - Garbage collector
Posted: Tuesday 10 November 2020 5:34
by lzwfkv
Hi Lokonli, i also was using a generic ical with google calndar for garbage collector and i can confirm that it is not working anyloger.
My findings:
- if you call the block with your own name (e.g. 'mygarbage') it won't be recognized as garbage colelctor block and the type assigned to it is the name itself of the block: type='mygarbage'
- It will end up with an error from the blocks.js code that can be seen in developer console: "Unknown string block".
My workaround:
- Call the block "garbage", it will be recognized as garbage collector block and it will correctly call garbage.js for handling the request.
- At that point, though, the garbage collector block will be loading forever, because the garbage.js code is missing the "param: <ical URL>" statement for ical handler function (getIcalData), which i added (param: me.block.icalurl || settings['garbage_icalurl']) to make it work and load the expected garbage URL.
Is it possible to look into the above issue? It will be great to have the corrections in the code and not change them at every update as well as to be able to manage the ical garbage provider consistently to the other garbage block providers.
Thank you.
Re: Dashticz - Module - Garbage collector
Posted: Tuesday 10 November 2020 8:57
by Lokonli
Thanks for the analysis! Good catch: Two bugs at once
Should be fixed in latest beta. Can you test?
Re: Dashticz - Module - Garbage collector
Posted: Tuesday 10 November 2020 19:05
by Antoinne
Nice. Did the update and now my old ical is working again
I also see GAD as provider, will test the new block method with GAD as provider later.
Re: Dashticz - Module - Garbage collector
Posted: Tuesday 10 November 2020 22:15
by Timbau
Lokonli wrote: ↑Thursday 05 November 2020 21:10
afvalstoffendienst has been added to latest beta.
Beta installed and working, thanks for this.
Re: Dashticz - Module - Garbage collector
Posted: Tuesday 10 November 2020 22:54
by Antoinne
Hi Lokonli,
Anyway, I've added 'gad' as garbage provider to latest beta. Can you test?
Test = OK.
Tnx for adding it so fast.
Re: Dashticz - Module - Garbage collector
Posted: Wednesday 11 November 2020 6:49
by lzwfkv
Lokonli wrote: ↑Tuesday 10 November 2020 8:57
Thanks for the analysis! Good catch: Two bugs at once
Should be fixed in latest beta. Can you test?
Just updated and tested: it's all right. It is working as expected for me too.
Thanks Lokonli.
Re: Dashticz - Module - Garbage collector
Posted: Sunday 15 November 2020 0:33
by Gianni
Still getting the garbage not working.
server information
- Spoiler: show
- gianni@webserver:/$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
gianni@webserver:/$ apache2 -v
Server version: Apache/2.4.41 (Ubuntu)
Server built: 2020-08-12T19:46:17
gianni@webserver:/$ php -v
PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
Dashticz info (manual installation,don't like docker)
- 2020-11-15_00-29-57.png (18.25 KiB) Viewed 3774 times
Config.js
- Spoiler: show
-
config['static_weathericons'] = 0;
config['hide_mediaplayer'] = 0;
config['garbage_company'] = 'recycleapp';
config['garbage_icalurl'] = '';
config['google_api_key'] = '';
config['garbage_calendar_id'] = '0';
config['garbage_zipcode'] = '********';
config['garbage_street'] = '********* ';
config['garbage_housenumber'] = '****';
config['garbage_housenumberadd'] = '';
config['garbage_maxitems'] = '5';
config['garbage_width'] = '3';
config['garbage_hideicon'] = 0;
config['garbage_icon_use_colors'] = 1;
config['garbage_use_colors'] = 1;
config['garbage_use_names'] = 1;
config['garbage_use_cors_prefix'] = 1;
config['garbage_mapping'] = {
rest: ['sortibak'],
gft: ['biobak'],
papier: ['papier', 'karton'],
};
config['garbage'] = {
gft: {kliko: 'green', code: '#375b23', name: 'GFT', icon: 'img/garbage/kliko_green.png'},
rest: {kliko: 'grey', code: '#5e5d5c', name: 'Restafval', icon: 'img/garbage/kliko_grey.png'},
papier: {kliko: 'blue', code: '#153477', name: 'Papier', icon: 'img/garbage/kliko_blue.png'},
};
link adres
- Spoiler: show
- http://10.10.20.6/domo/vendor/dashticz/ ... *******&t=
request headers
- Spoiler: show
-
GET /domo/vendor/dashticz/garbage/index.php?service=recycleapp&street=**********%20&sub=*****************%20&zipcode=*******&nr=***&t= HTTP/1.1
Host: 10.10.20.6
Connection: keep-alive
Accept: application/json, text/javascript, */*; q=0.01
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36
X-Requested-With: XMLHttpRequest
Referer: http://10.10.20.6/domo/
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
response header
- Spoiler: show
-
HTTP/1.0 500 Internal Server Error
Date: Sat, 14 Nov 2020 23:22:12 GMT
Server: Apache/2.4.41 (Ubuntu)
Access-Control-Allow-Origin: *
Content-Length: 0
Connection: close
Content-Type: application/json
error in webpage
- 2020-11-15_00-03-35.png (271.36 KiB) Viewed 3774 times
Its looks like the cors is not working for the garbage but it's works for the bus and tv gids.
If you need more information just ask
Re: Dashticz - Module - Garbage collector
Posted: Sunday 15 November 2020 7:22
by Lokonli
Maybe one of the PHP modules is missing.
Check the error log in /var/log/apache2
Sent from my SM-A320FL using Tapatalk
Re: Dashticz - Module - Garbage collector
Posted: Sunday 15 November 2020 10:04
by Gianni
it looks like only the garbage does not use the cors proxy
extra info but i dont know if this is relevant.
i use 2 servers.
domotic run on server1 (fictief name)
dashticz on server2 (fictief name)
acces log
- Spoiler: show
- 10.10.20.243 - - [15/Nov/2020:08:53:11 +0000] "GET /domo/vendor/dashticz/garbage/index.php?service=recycleapp&street=**********r&sub=**********r&zipcode=*********&nr=******&t= HTTP/1.1" 500 209 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
10.10.20.243 - - [15/Nov/2020:08:53:11 +0000] "GET /domo/vendor/dashticz/cors.php?http://json.tvgids.nl/v4/channels HTTP/1.1" 200 12784 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
10.10.20.243 - - [15/Nov/2020:08:53:11 +0000] "GET /domo/vendor/dashticz/cors.php?http://api.9292.nl/0.1/locations/son-en ... lang=nl-NL HTTP/1.1" 200 8517 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
10.10.20.243 - - [15/Nov/2020:08:53:11 +0000] "GET /domo/dist/assets/fonts/fa-solid-900.woff2 HTTP/1.1" 200 80437 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
10.10.20.243 - - [15/Nov/2020:08:53:11 +0000] "GET /domo/vendor/dashticz/cors.php?http://json.tvgids.nl/v4/programs/?day= ... 5430389921 HTTP/1.1" 200 123593 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
10.10.20.243 - - [15/Nov/2020:08:54:11 +0000] "GET /domo/vendor/dashticz/cors.php?http://api.9292.nl/0.1/locations/son-en ... lang=nl-NL HTTP/1.1" 200 8518 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
error log
- Spoiler: show
-
[Sun Nov 15 08:53:11.354378 2020] [php7:error] [pid 319869] [client 10.10.20.243:6861] PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /var/www/web/domo/vendor/dashticz/garbage/index.php:284\nStack trace:\n#0 {main}\n thrown in /var/www/web/domo/vendor/dashticz/garbage/index.php on line 284, referer: http://10.10.20.6/domo/
did some testsingthat maybe can help
when i refresh my browser i notice this url.
h**p://10.10.20.6/domo/vendor/dashticz/garbage/index.php?service=recycleapp&street=********&sub=********&zipcode=*****&nr=**&t=
is see that it's use index.php and no cors.php
"GET /domo/vendor/dashticz/garbage/index.php?service=recycleapp&street=***********&sub=***********&zipcode=******&nr=***&t=
so i test it with this url myself in the browser and change index.php to cors.php
h**p://10.10.20.6/domo/vendor/dashticz/garbage/cors.php?service=recycleapp&street=*********&sub=**********&zipcode=*************&nr=*****&t=
i see this in my error log
[Sun Nov 15 09:22:45.167075 2020] [php7:error] [pid 320339] [client 10.10.20.243:10190] script '/var/www/web/domo/vendor/dashticz/garbage/cors.php' not found or unable to stat
indeed there is no cors.php in my garbage folder
So i copied the cors from dashticz to garbage
then i run the url again
i get a 200 on my get but no response (so far my knowledge of post and get)
- Spoiler: show
-
Request URL: http://10.10.20.6/domo/vendor/dashticz/ ... ***&t=
Request Method: GET
Status Code: 200 OK
Remote Address: 10.10.20.6:80
Referrer Policy: strict-origin-when-cross-origin
Access-Control-Allow-Origin: *
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
Cache-Control: post-check=0, pre-check=0
Connection: Keep-Alive
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Date: Sun, 15 Nov 2020 09:26:00 GMT
Keep-Alive: timeout=5, max=100
Pragma: no-cache
Server: Apache/2.4.41 (Ubuntu)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cache-Control: max-age=0
Connection: keep-alive
Host: 10.10.20.6
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36
service: recycleapp
amp;street: *******
amp;sub: ********
amp;zipcode: *******
amp;nr: *
amp;t:
is see this error in my error.log
- Spoiler: show
-
[Sun Nov 15 09:31:30.283779 2020] [php7:warn] [pid 305762] [client 10.10.20.243:11125] PHP Warning: file_get_contents(service=recycleapp&amp;street=********&amp;sub=******&amp;zipcode=******&amp;nr=*****&amp;t=): failed to open stream: No such file or directory in /var/www/web/domo/vendor/dashticz/garbage/cors.php on line 28
[Sun Nov 15 09:31:30.283862 2020] [php7:notice] [pid 305762] [client 10.10.20.243:11125] PHP Notice: Undefined variable: http_response_header in /var/www/web/domo/vendor/dashticz/garbage/cors.php on line 29
[Sun Nov 15 09:31:30.283875 2020] [php7:warn] [pid 305762] [client 10.10.20.243:11125] PHP Warning: Invalid argument supplied for foreach() in /var/www/web/domo/vendor/dashticz/garbage/cors.php on line 5
may this will help
Re: Dashticz - Module - Garbage collector
Posted: Sunday 15 November 2020 21:02
by Lokonli
Gianni wrote: ↑Sunday 15 November 2020 10:04
it looks like only the garbage does not use the cors proxy
extra info but i dont know if this is relevant.
i use 2 servers.
domotic run on server1 (fictief name)
dashticz on server2 (fictief name)
acces log
- Spoiler: show
- 10.10.20.243 - - [15/Nov/2020:08:53:11 +0000] "GET /domo/vendor/dashticz/garbage/index.php?service=recycleapp&street=**********r&sub=**********r&zipcode=*********&nr=******&t= HTTP/1.1" 500 209 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
10.10.20.243 - - [15/Nov/2020:08:53:11 +0000] "GET /domo/vendor/dashticz/cors.php?http://json.tvgids.nl/v4/channels HTTP/1.1" 200 12784 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
10.10.20.243 - - [15/Nov/2020:08:53:11 +0000] "GET /domo/vendor/dashticz/cors.php?http://api.9292.nl/0.1/locations/son-en ... lang=nl-NL HTTP/1.1" 200 8517 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
10.10.20.243 - - [15/Nov/2020:08:53:11 +0000] "GET /domo/dist/assets/fonts/fa-solid-900.woff2 HTTP/1.1" 200 80437 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
10.10.20.243 - - [15/Nov/2020:08:53:11 +0000] "GET /domo/vendor/dashticz/cors.php?http://json.tvgids.nl/v4/programs/?day= ... 5430389921 HTTP/1.1" 200 123593 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
10.10.20.243 - - [15/Nov/2020:08:54:11 +0000] "GET /domo/vendor/dashticz/cors.php?http://api.9292.nl/0.1/locations/son-en ... lang=nl-NL HTTP/1.1" 200 8518 "http://10.10.20.6/domo/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
error log
- Spoiler: show
-
[Sun Nov 15 08:53:11.354378 2020] [php7:error] [pid 319869] [client 10.10.20.243:6861] PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /var/www/web/domo/vendor/dashticz/garbage/index.php:284\nStack trace:\n#0 {main}\n thrown in /var/www/web/domo/vendor/dashticz/garbage/index.php on line 284, referer: http://10.10.20.6/domo/
did some testsingthat maybe can help
when i refresh my browser i notice this url.
h**p://10.10.20.6/domo/vendor/dashticz/garbage/index.php?service=recycleapp&street=********&sub=********&zipcode=*****&nr=**&t=
is see that it's use index.php and no cors.php
"GET /domo/vendor/dashticz/garbage/index.php?service=recycleapp&street=***********&sub=***********&zipcode=******&nr=***&t=
so i test it with this url myself in the browser and change index.php to cors.php
h**p://10.10.20.6/domo/vendor/dashticz/garbage/cors.php?service=recycleapp&street=*********&sub=**********&zipcode=*************&nr=*****&t=
i see this in my error log
[Sun Nov 15 09:22:45.167075 2020] [php7:error] [pid 320339] [client 10.10.20.243:10190] script '/var/www/web/domo/vendor/dashticz/garbage/cors.php' not found or unable to stat
indeed there is no cors.php in my garbage folder
So i copied the cors from dashticz to garbage
then i run the url again
i get a 200 on my get but no response (so far my knowledge of post and get)
- Spoiler: show
-
Request URL: http://10.10.20.6/domo/vendor/dashticz/ ... ***&t=
Request Method: GET
Status Code: 200 OK
Remote Address: 10.10.20.6:80
Referrer Policy: strict-origin-when-cross-origin
Access-Control-Allow-Origin: *
Cache-Control: no-store, no-cache, must-revalidate, max-age=0
Cache-Control: post-check=0, pre-check=0
Connection: Keep-Alive
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Date: Sun, 15 Nov 2020 09:26:00 GMT
Keep-Alive: timeout=5, max=100
Pragma: no-cache
Server: Apache/2.4.41 (Ubuntu)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cache-Control: max-age=0
Connection: keep-alive
Host: 10.10.20.6
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36
service: recycleapp
amp;street: *******
amp;sub: ********
amp;zipcode: *******
amp;nr: *
amp;t:
is see this error in my error.log
- Spoiler: show
-
[Sun Nov 15 09:31:30.283779 2020] [php7:warn] [pid 305762] [client 10.10.20.243:11125] PHP Warning: file_get_contents(service=recycleapp&amp;street=********&amp;sub=******&amp;zipcode=******&amp;nr=*****&amp;t=): failed to open stream: No such file or directory in /var/www/web/domo/vendor/dashticz/garbage/cors.php on line 28
[Sun Nov 15 09:31:30.283862 2020] [php7:notice] [pid 305762] [client 10.10.20.243:11125] PHP Notice: Undefined variable: http_response_header in /var/www/web/domo/vendor/dashticz/garbage/cors.php on line 29
[Sun Nov 15 09:31:30.283875 2020] [php7:warn] [pid 305762] [client 10.10.20.243:11125] PHP Warning: Invalid argument supplied for foreach() in /var/www/web/domo/vendor/dashticz/garbage/cors.php on line 5
may this will help
From the error log you can see that php curl is not installed.
Try the following:
Code: Select all
sudo apt-get update
sudo apt-get install php-xml php-curl libapache2-mod-php
sudo systemctl restart apache2
And then retry again without your changes (cors.php is not needed in the garbage folder!)
Re: Dashticz - Module - Garbage collector
Posted: Sunday 15 November 2020 21:39
by Gianni
@lokonli you rock
i got my garbage back.
never thought i would be happy with garbage :-p
i did not notice the curl error.
Re: Dashticz - Module - Garbage collector
Posted: Thursday 19 November 2020 22:24
by Enz0jacco
hey guys,
thnx first of all for the great app.
I did some styling myself but can't figure out the following.
1. I would like to have the garbage icon to be the same color as my text. (the darker green is unreadable).
2. I put a break line between the name and the date but I cannot remove the colon before the date. is there a quick fix for that?
thanx in advance!
Jacco
Re: Dashticz - Module - Garbage collector
Posted: Friday 20 November 2020 0:35
by Enz0jacco
okay number 1 is fixed by just inserting a new image in the img/garbage folder with the new color.
still looking to get rid of the colon:P
Re: Dashticz - Module - Garbage collector
Posted: Sunday 22 November 2020 16:39
by HansieNL
I wanna change the color of the garbage info. If there's no trashtomorrow or trashtoday I want the color to have an off status -> .status-off. I don't know if this is possible through custom.js.
Any help is welcome.
Re: Dashticz - Module - Garbage collector
Posted: Sunday 22 November 2020 17:10
by Lokonli
HansieNL wrote: ↑Sunday 22 November 2020 16:39
I wanna change the color of the garbage info. If there's no
trashtomorrow or
trashtoday I want the color to have an off status ->
.status-off. I don't know if this is possible through custom.js.
Any help is welcome.
You want to change the color of the complete block if there is no trash today and no trash tomorrow?
I could add the 'trashtoday' and 'trashtomorrow' classes at block level. Would that work for you?
Then you can define the color of the block in case of trashtoday:
Code: Select all
.garbage.trashtoday {
background-color: red
}
or, for instance hide it, when no trash today and tomorrow:
Code: Select all
.garbage:not(.trashtoday):not(.trashtomorror) {
display: none
}
(Currently, this is not implemented yet)
Re: Dashticz - Module - Garbage collector
Posted: Sunday 22 November 2020 20:14
by HansieNL
- Spoiler: show
Lokonli wrote: ↑Sunday 22 November 2020 17:10
HansieNL wrote: ↑Sunday 22 November 2020 16:39
I wanna change the color of the garbage info. If there's no
trashtomorrow or
trashtoday I want the color to have an off status ->
.status-off. I don't know if this is possible through custom.js.
Any help is welcome.
You want to change the color of the complete block if there is no trash today and no trash tomorrow?
I could add the 'trashtoday' and 'trashtomorrow' classes at block level. Would that work for you?
Then you can define the color of the block in case of trashtoday:
Code: Select all
.garbage.trashtoday {
background-color: red
}
or, for instance hide it, when no trash today and tomorrow:
Code: Select all
.garbage:not(.trashtoday):not(.trashtomorror) {
display: none
}
(Currently, this is not implemented yet)
You want to change the color of the complete block if there is no trash today and no trash tomorrow?
Yes, that's what I want. Let me explain some more: I want the icon (I use an image as icon) and text in the block to have a transparancy of 0.4.
If there's text in trashtoday and/or trashtomorrow, the icon and text in trashtoday and/or trashtomorrow should have no transparancy.
The rest of the text should still have the transparancy.
This is my current config for the garbage:
Code: Select all
blocks['mijnafval'] = {
company: 'mijnafvalwijzer',
zipcode: '<postcode>',
street: '',
housenumber: <housenumber>,
maxitems: 3,
image: '../custom/img/kliko.svg',
url: 'https://mijnafvalwijzer.nl/nl/<postcode>/<housenumber>/',
newwindow: 1,
width: 12,
hideicon: 1,
icon_use_colors:1,
use_colors:0,
use_names: 1,
garbage_mapping: {
rest: ['restafval'],
gft: ['groente', 'fruit', 'tuin', 'etensresten'],
papier: ['papier', 'karton'],
},
garbage: {
gft: {name: 'GFT+E', icon: 'custom/img/kliko.png'},
rest: {name: 'Restafval', icon: 'custom/img/kliko.png'},
papier: {name: 'papier', icon: 'custom/img/kliko.png'},
},
}
Re: Dashticz - Module - Garbage collector
Posted: Monday 23 November 2020 17:01
by HansieNL
HansieNL wrote: ↑Sunday 22 November 2020 20:14
- Spoiler: show
Lokonli wrote: ↑Sunday 22 November 2020 17:10
HansieNL wrote: ↑Sunday 22 November 2020 16:39
I wanna change the color of the garbage info. If there's no
trashtomorrow or
trashtoday I want the color to have an off status ->
.status-off. I don't know if this is possible through custom.js.
Any help is welcome.
You want to change the color of the complete block if there is no trash today and no trash tomorrow?
I could add the 'trashtoday' and 'trashtomorrow' classes at block level. Would that work for you?
Then you can define the color of the block in case of trashtoday:
Code: Select all
.garbage.trashtoday {
background-color: red
}
or, for instance hide it, when no trash today and tomorrow:
Code: Select all
.garbage:not(.trashtoday):not(.trashtomorror) {
display: none
}
(Currently, this is not implemented yet)
You want to change the color of the complete block if there is no trash today and no trash tomorrow?
Yes, that's what I want. Let me explain some more: I want the icon (I use an image as icon) and text in the block to have a transparancy of 0.4.
If there's text in trashtoday and/or trashtomorrow, the icon and text in trashtoday and/or trashtomorrow should have no transparancy.
The rest of the text should still have the transparancy.
This is my current config for the garbage:
Code: Select all
blocks['mijnafval'] = {
company: 'mijnafvalwijzer',
zipcode: '<postcode>',
street: '',
housenumber: <housenumber>,
maxitems: 3,
image: '../custom/img/kliko.svg',
url: 'https://mijnafvalwijzer.nl/nl/<postcode>/<housenumber>/',
newwindow: 1,
width: 12,
hideicon: 1,
icon_use_colors:1,
use_colors:0,
use_names: 1,
garbage_mapping: {
rest: ['restafval'],
gft: ['groente', 'fruit', 'tuin', 'etensresten'],
papier: ['papier', 'karton'],
},
garbage: {
gft: {name: 'GFT+E', icon: 'custom/img/kliko.png'},
rest: {name: 'Restafval', icon: 'custom/img/kliko.png'},
papier: {name: 'papier', icon: 'custom/img/kliko.png'},
},
}
Edit: if it is easier to have just some kind of on (trashtoday / tomorrow = true) and off, that is ok with me. Than the other text will have no transparency, but that’s no problem.
Re: Dashticz - Module - Garbage collector
Posted: Monday 23 November 2020 18:09
by Lokonli
Check latest beta:
Code: Select all
/* This will give the block a red border if trash collection is collected for today */
.trash.trashtoday {
border-color: red
}
/* This will give the block a green border if trash collection is collected for tomorrow*/
.trash.trashtomorrow {
border-color: green
}
/* This will reduce the opacity in case no trash is scheduled for today or tomorrow */
.trash:not(.trashtoday):not(.trashtomorrow) .dt_state {
opacity: 0.2 !important;
}
/* This will increase the font of the trash row that is scheduled for today */
.dt_state .trashtoday {
font-size: 20px
}
Re: Dashticz - Module - Garbage collector
Posted: Monday 23 November 2020 18:12
by Lokonli
and:
Code: Select all
.trash .trashrow {
opacity: 0.2 !important;
}