# HG changeset patch # User sean # Date 1437553527 -7200 # Node ID c49f7fe8274326361acba57b52ea0f1be2486018 # Parent 3e66e2f927708382325be3fe2fc9212e95254e87 changed the grid layout to a more responsive and compatible self-calculating JS based version diff -r 3e66e2f92770 -r c49f7fe82743 dash.conf --- a/dash.conf Wed Jul 15 15:13:07 2015 +0200 +++ b/dash.conf Wed Jul 22 10:25:27 2015 +0200 @@ -41,25 +41,15 @@ [tile4] type=mon -source=192.168.3.1 -status=down +source=192.168.4.3 +status=up [tile5] type=mon -source=192.168.4.5 +source=192.168.4.3 status=up [tile6] type=mon -source=192.168.3.2 -status=down - -[tile7] -type=mon -source=192.168.4.12 -status=up - -[tile8] -type=mon -source=192.168.3.66 -status=down +source=192.168.4.3 +status=up \ No newline at end of file diff -r 3e66e2f92770 -r c49f7fe82743 dash.py --- a/dash.py Wed Jul 15 15:13:07 2015 +0200 +++ b/dash.py Wed Jul 22 10:25:27 2015 +0200 @@ -20,6 +20,8 @@ config = configparser.ConfigParser() config.read(CONFIG_FILE) + + #read the tiles read_tiles_config(config) @@ -70,7 +72,6 @@ """) file.close() - ##Bottle @route('/') @view('hello_template') diff -r 3e66e2f92770 -r c49f7fe82743 views/hello_template.tpl --- a/views/hello_template.tpl Wed Jul 15 15:13:07 2015 +0200 +++ b/views/hello_template.tpl Wed Jul 22 10:25:27 2015 +0200 @@ -3,79 +3,156 @@ License: GNU GPL >= v2. See LICENSE for details. --> <% - import math - break_tile_lines = math.ceil(len(tiles)/2) - tilecounter = 1 - vp_size = 1; - if len(tiles) <= 2: - vp_size = "6vw" - elif len(tiles) >2 and len(tiles) <=4 : - vp_size = "5vw" - elif len(tiles) >4 and len(tiles) <=6 : - vp_size = "4vw" - elif len(tiles) >6 and len(tiles) <=8 : - vp_size = "3vw" - end + import math + from datetime import date + + ################# + # date and time # + ################# + + + today = date.today() + weekday = ("Montag", "Dienstag", "Mittwoch", "Donnerstag", + "Freitag", "Samstag", "Sonntag")[today.weekday()] + month_name = ("Januar", "Februar", "März", "Aprill", "Mai", + "Juni", "Juli", "August", "September", "Oktober", + "November", "Dezember")[today.month-1] + + + ################## + # size of tiles # + ################## + + number_of_rows = 3 + + ################# + # viewport size # + ################# + + vp_size = "12px" + + #if len(tiles) <= 2: + # vp_size = "6vw" + #elif len(tiles) >2 and len(tiles) <=4 : + # vp_size = "5vw" + #elif len(tiles) >4 and len(tiles) <=6 : + # vp_size = "4vw" + #elif len(tiles) >6 and len(tiles) <=8 : + # vp_size = "3vw" + #end %> + +