[wiki-lenny] macro d'autostatus en *noir*

darcs-hash:20090403175934-bd074-2b4d26af4ba32148746ddd28f25946a98c1c515e.gz
This commit is contained in:
Antoine Durand-Gasselin 2009-04-03 19:59:34 +02:00
parent 4e546ed98c
commit d207ba7e7c
2 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@ def Cellule(texte, couleur, f) :
"""
code = f.table(1)
code += f.table_row(1)
code += f.table_cell(1,{'style':'background-color:%s' % couleur })
code += f.table_cell(1,{'style':'background-color:%s; color: black;' % couleur })
code += f.text(texte)
code += f.table_cell(0)
code += f.table_row(0)

View file

@ -21,12 +21,12 @@ def execute(macro, text) :
if not re.search(' 0 ', lines[0]):
line = lines[0].split(' ')
trucsdown += f.table_row(1)
trucsdown += f.table_cell(1,{'style':'background-color:lightgrey;'})
trucsdown += f.table_cell(1,{'style':'background-color:lightgrey; color: black;'})
trucsdown += unicode(f.text('%s (%s)' % (line [0], getoutput("grep '^%s[^-.a-zA-Z]' /usr/scripts/var/autostatus/hosts | cut -d ' ' -f 5-" % line [0])) ), "utf-8")
trucsdown += f.table_cell(0)
# nombre de non réponse au ping
if int(line[1]) > 2 :
trucsdown += f.table_cell(1,{'style':'background-color:red;'})
trucsdown += f.table_cell(1,{'style':'background-color:red; color: black;'})
trucsdown += f.text(u'down')
else :
trucsdown += f.table_cell(1,{'style':'background-color:blue;'})
@ -37,16 +37,16 @@ def execute(macro, text) :
if trucsdown == '':
code += f.table_row(1)
code += f.table_cell(1, {'style':'background-color:silver;'})
code += f.table_cell(1, {'style':'background-color:silver; color: black;'})
code += f.text(u'Autostatus des '+typ)
code += f.table_cell(0)
code += f.table_cell(1, {'style':'background-color:lime;'})
code += f.table_cell(1, {'style':'background-color:lime; color: black;'})
code += f.text(u'OK')
code += f.table_cell(0)
code += f.table_row(0)
else:
code += f.table_row(1)
code += f.table_cell(1, {'style':'background-color:silver', 'colspan':'2'})
code += f.table_cell(1, {'style':'background-color:silver; color:black;', 'colspan':'2' })
code += f.text(u'Autostatus des '+typ)
code += f.table_cell(0)
code += f.table_row(0)