print("<tr>") print("<td>") print("Key: ") print("</td>") print("<td>") print(mhl.MyTextForm("key", RedisKey, "40", "required", "readonly")) print("</td>") print("</tr>") print("<tr>") print("<td>") print("Nr. tentativi d'invio per messaggio: ") print("</td>") print("<td>") print( mhl.MyNumberForm("attempts", Attempts.decode('unicode_escape'), "3", "3", "1", "100", "required", "")) print("</td>") print("</tr>") print("<tr>") print("<td>") print("Tempo d'intervallo fra tentativi (minuti): ") print("</td>") print("<td>") print( mhl.MyNumberForm("delay", Delay.decode('unicode_escape'), "3", "3", "1", "120", "required", "")) print("</td>") print("</tr>") print("<tr>")
print("</td>") print("<td>") print(mhl.MyTextForm("key", RedisKey, "40", "required", "readonly")) print("</td>") print("</tr>") # Per ogni campo ... stampo il campo ed il suo valore. (la funzione "Decode()" serve per trasformare "bin->str") for i in MyDB.hkeys(RedisKey): print("<tr>") print("<td>") print("Nome \"", flt.Decode(i), "\": ", sep="") print("</td>") print("<td>") if flt.Decode(i) == "freqcheck": print( mhl.MyNumberForm(flt.Decode(i), flt.Decode(MyDB.hget(RedisKey, i)), "2", "2", "1", "60", "1", "required", "")) elif flt.Decode(i) == "out": print( mhl.MyNumberForm(flt.Decode(i), flt.Decode(MyDB.hget(RedisKey, i)), "2", "2", "11", "22", "1", "required", "")) elif flt.Decode(i) == "sensor": Values = [] for j in MyDB.keys("sensore:temperatura:*"): Sensore = MyDB.get(flt.Decode(j)) Values.append(flt.Decode(Sensore)) #Values = MyDB.keys("sensore:temperatura:*") Selected = flt.Decode(MyDB.hget(RedisKey, "sensor")) print(mhl.MyDropDown(flt.Decode(i), Values, Selected)) else: print( mhl.MyNumberForm(flt.Decode(i), flt.Decode(MyDB.hget(RedisKey, i)),
print("</tr>") # Per ogni campo ... stampo il campo ed il suo valore. (la funzione "Decode()" serve per trasformare "bin->str") for i in MyDB.hkeys(RedisKey): print("<tr>") print("<td>") print(flt.Decode(i), ": ", sep="") print("</td>") print("<td>") if flt.Decode(i) == "hostname": print( mhl.MyTextForm(flt.Decode(i), flt.Decode(MyDB.hget(RedisKey, i)), "40", "required", "")) elif flt.Decode(i) == "port": print( mhl.MyNumberForm(flt.Decode(i), flt.Decode(MyDB.hget(RedisKey, i)), "5", "5", "1", "32767", "1", "required", "")) elif flt.Decode(i) == "user": print( mhl.MyTextForm(flt.Decode(i), flt.Decode(MyDB.hget(RedisKey, i)), "20", "", "")) else: print(mhl.MyPasswordForm("password", "password", "")) print("</td>") print("</tr>") print("<tr>") print("<td colspan=\"2\">") print("<hr/>") print("</td>") print("</tr>")
print(mhl.MyTextForm("hostname", KeyRead, "40", "required", "")) print("</td>") print("</tr>") # Cerco nell'array il valore for i in range(len(ConfigNow)): if "port" == (ConfigNow[i]["name"]): # Appoggio a variabile KeyRead = ConfigNow[i]["value"] print("<tr>") print("<td>") print("Port: ") print("</td>") print("<td>") print( mhl.MyNumberForm("port", KeyRead, "6", "6", "0", "32767", "1", "required", "")) print("</td>") print("</tr>") # Cerco nell'array il valore for i in range(len(ConfigNow)): if "db" == (ConfigNow[i]["name"]): # Appoggio a variabile KeyRead = ConfigNow[i]["value"] print("<tr>") print("<td>") print("db (database): ") print("</td>") print("<td>") print(mhl.MyNumberForm("db", KeyRead, "2", "2", "0", "99", "1", "required", ""))
print ("Key: ") print ("</td>") print ("<td>") print (mhl.MyTextForm("key",RedisKey,"40","required","readonly")) print ("</td>") print ("</tr>") # Per ogni campo ... stampo il campo ed il suo valore. (la funzione "Decode()" serve per trasformare "bin->str") for i in MyDB.hkeys(RedisKey): print ("<tr>") print ("<td>") print ("Nome \"",flt.Decode(i),"\": ",sep="") print ("</td>") print ("<td>") if flt.Decode(i) == "freqcheck": print (mhl.MyNumberForm(flt.Decode(i),flt.Decode(MyDB.hget(RedisKey,i)),"2","2","1","60","1","required","")) elif flt.Decode(i) == "outtemp": print (mhl.MyNumberForm(flt.Decode(i),flt.Decode(MyDB.hget(RedisKey,i)),"2","2","5","30","0.1","required","")) else: print ("Qualcosa e` andato storto") print ("</td>") print ("</tr>") print ("<tr>") print ("<td colspan=\"2\">") print ("<hr/>") print ("</td>") print ("</tr>") print ("<tr>") print ("<td>")
print("<tr>") print("<td>") print("Server: ") print("</td>") print("<td>") print( mhl.MyTextForm("serversmtp", ServerSMTP.decode('unicode_escape'), "40", "required", "")) print("</td>") print("<td>") print("port: ") print("</td>") print("<td>") print( mhl.MyNumberForm("port", Port.decode('unicode_escape'), "6", "6", "0", "32767", "required", "")) print("</td>") print("</tr>") print("<tr>") print("<td colspan=\"4\">") print("<hr/>") print("</td>") print("</tr>") print("<tr>") print("<td>") print("</td>") print("<td>") print(mhl.MyButtonForm("submit", "Submit")) print("</td>")
print ("<td>") print (mhl.MyTextForm(FormName,RedisKey,"40","required","readonly")) print ("</td>") print ("</tr>") print ("<tr>") print ("<td>") print ("Start:") print ("</td>") print ("<td>") if MyDB.llen(RedisKey) >= 10000 : start=MyDB.llen(RedisKey)-10000 else: start=0 # def MyNumberForm(Name,Value,Size,Maxlenght,Min,Max,Step,Required,Readonly): print (mhl.MyNumberForm("VStart",str(start),"","","0",str(MyDB.llen(RedisKey)-1),"1","required","")) print ("</td>") print ("</tr>") print ("<tr>") print ("<td>") print ("Stop:") print ("</td>") print ("<td>") # def MyNumberForm(Name,Value,Size,Maxlenght,Min,Max,Step,Required,Readonly): print (mhl.MyNumberForm("VStop",str(MyDB.llen(RedisKey)),"","","",str(MyDB.llen(RedisKey)),"1","required","")) print ("</td>") print ("</tr>") print ("<tr>") print ("<td>")
mhl.MyTextForm("UM", flt.Decode(MyDB.hget(RedisKey, "UM")), "5", "", "")) # Non richiesto else: print(mhl.MyTextForm("UM", "", "5", "", "")) # Non richiesto print("</td>") print("</tr>") print("<tr>") print("<td>") print("TempoRitardo:") print("</td>") print("<td>") if MyDB.hexists(RedisKey, "TempoRitardo"): print( mhl.MyNumberForm("TempoRitardo", flt.Decode(MyDB.hget(RedisKey, "TempoRitardo")), "6", "6", "0", "99", "0.001", "", "")) # Non richiesto else: print( mhl.MyNumberForm("TempoRitardo", "", "6", "6", "0", "99", "0.001", "", "")) # Non richiesto print("</td>") print("</tr>") print("<tr>") print("<td>") print("RangeValori:") print("</td>") print("<td>") if MyDB.hexists(RedisKey, "RangeValori"): print(
mhl.MyTextForm("Descrizione", flt.Decode(MyDB.hget(RedisKey, "Descrizione")), "40", "", "")) # Non richiesto else: print(mhl.MyTextForm("Descrizione", "", "40", "", "")) # Non richiesto print("</td>") print("</tr>") print("<tr>") print("<td>") print("Timer:") print("</td>") print("<td>") # Name,Value,Size,Maxlenght,Min,Max,Step,Required,Readonly print( mhl.MyNumberForm("Timer", flt.Decode(MyDB.hget(RedisKey, "Timer")), "4", "4", "1", "", "1", "required", "")) print("secondi") print("</td>") print("secondi") print("</tr>") print("<tr>") print("<td>") print("Funzionamento:") print("</td>") print("<td>") if MyDB.hexists(RedisKey, "Funzionamento"): print( mhl.MyDropDown("Funzionamento", ["On", "Off", "Auto"], flt.Decode(MyDB.hget(RedisKey, "Funzionamento")))) else: