How to use the webserver.addFormTextBox function in webserver

To help you get started, we’ve selected a few webserver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enesbcs / rpieasy / _C014_GenMQTT.py View on Github external
try:
   kp = self.keepalive
  except:
   kp = 60
  webserver.addFormNumericBox("Keepalive time","keepalive",kp,2,600)
  webserver.addUnit("s")
  try:
   am = self.authmode
   fname = self.certfile
  except:
   am = 0
   fname = ""
  options = ["MQTT","MQTTS/with cert","MQTTS/insecure"]
  optionvalues = [0,1,2]
  webserver.addFormSelector("Mode","c014_mode",len(optionvalues),options,optionvalues,None,int(am))
  webserver.addFormTextBox("Server certificate file","c014_cert",str(fname),120)
  webserver.addBrowseButton("Browse","c014_cert",startdir=str(fname))
  webserver.addFormNote("Upload certificate first at <a href="filelist">filelist</a> then select here!")
  try:
   lwt = self.lwt_topic
   lwt1 = self.lwtconnmsg
   lwt2 = self.lwtdisconnmsg
  except:
   lwt = "%sysname%/LWT"
   lwt1 = "Online"
   lwt2 = "Offline"
  webserver.addFormTextBox("Controller lwl topic","c014_lwt",lwt,255)
  webserver.addFormTextBox("LWT Connect Message","c014_cmsg",lwt1,255)
  webserver.addFormTextBox("LWT Disconnect Message","c014_dcmsg",lwt2,255)
  return True
github enesbcs / rpieasy / _N001_Email.py View on Github external
def webform_load(self): # create html page for settings
  webserver.addFormTextBox("Server","server",self.server,64)
  options = ["Plain","SSL"]
  optionvalues = [0,1]
  webserver.addFormSelector("Protocol","security",len(options),options,optionvalues,None,self.security)
  webserver.addFormNumericBox("Port","port",self.port,1,65535)
  webserver.addFormTextBox("Sender","sender",self.sender,64)
  webserver.addFormTextBox("Receiver","receiver",self.receiver,64)
  webserver.addFormTextBox("SMTP login name","login",self.login,64)
  webserver.addFormPasswordBox("STMP password","passw",self.passw,64)
  webserver.addFormTextBox("Subject","subject",self.subject,64)
  webserver.addHtml("Body:<textarea wrap="off" size="512" cols="80" rows="5">")
  webserver.addHtml(str(self.body))
  webserver.addHtml("</textarea>")
  return True
github enesbcs / rpieasy / _C022_ESPNow.py View on Github external
if ",dest" in scmdarr[2]:
       dnodenum = scmdarr[1].replace("SERIAL: ","").strip()
       try:
        dnodenum = int(dnodenum)
       except:
        dnodenum = -1
     webserver.addFormNumericBox("Destination node number","dnodenum",dnodenum,0,254)

     sdat = ""
     commands.doExecuteCommand("serialcommand,espnow,name",False)
     time.sleep(1)
     scmdarr = getlastseriallogs(3)
     if len(scmdarr)>2:
      if ",name" in scmdarr[2]:
       sdat = scmdarr[1].replace("SERIAL: ","").strip()
     webserver.addFormTextBox("Unit name","name",sdat,25)

     wchan = -1
     commands.doExecuteCommand("serialcommand,espnow,chan",False)
     time.sleep(1)
     scmdarr = getlastseriallogs(3)
     if len(scmdarr)>2:
      if ",chan" in scmdarr[2]:
       wchan = scmdarr[1].replace("SERIAL: ","").strip()
       try:
        wchan = int(wchan)
       except:
        wchan = -1
     if wchan!=-1:
      options = []
      optionvalues = []
      for i in range(1,14):
github enesbcs / rpieasy / _P503_PyGameBG.py View on Github external
def webform_load(self):
  if Settings.SoundSystem["usable"]==False:
   webserver.addHtml("<font color="red">The sound system can not be used!</font>")
  else:
   webserver.addFormTextBox("Directory","p503_dir",str(self.taskdevicepluginconfig[0]),120)
   webserver.addBrowseButton("Browse","p503_dir",startdir=str(self.taskdevicepluginconfig[0]))
   webserver.addFormNote("Specify directory where .MP3 files located!")
  return True
github enesbcs / rpieasy / _N001_Email.py View on Github external
def webform_load(self): # create html page for settings
  webserver.addFormTextBox("Server","server",self.server,64)
  options = ["Plain","SSL"]
  optionvalues = [0,1]
  webserver.addFormSelector("Protocol","security",len(options),options,optionvalues,None,self.security)
  webserver.addFormNumericBox("Port","port",self.port,1,65535)
  webserver.addFormTextBox("Sender","sender",self.sender,64)
  webserver.addFormTextBox("Receiver","receiver",self.receiver,64)
  webserver.addFormTextBox("SMTP login name","login",self.login,64)
  webserver.addFormPasswordBox("STMP password","passw",self.passw,64)
  webserver.addFormTextBox("Subject","subject",self.subject,64)
  webserver.addHtml("Body:<textarea wrap="off" size="512" cols="80" rows="5">")
  webserver.addHtml(str(self.body))
  webserver.addHtml("</textarea>")
  return True
github enesbcs / rpieasy / _P505_VLCAudio.py View on Github external
def webform_load(self):
  if Settings.SoundSystem["usable"]==False:
   webserver.addHtml("<font color="red">The sound system can not be used!</font>")
  else:
   maxlevel = rpieGlobals.PLUGIN_CONFIGVAR_MAX
   if maxlevel&gt;10:
    maxlevel = 10
   for c in range(1,maxlevel+1):
    webserver.addFormTextBox("Level "+str(c*10),"p505_lvl_"+str(c*10),str(self.taskdevicepluginconfig[c]),180)
    webserver.addBrowseButton("Browse","p505_lvl_"+str(c*10),startdir=str(self.taskdevicepluginconfig[c]))
   webserver.addFormNote("Specify file names/network URI for every level, that is needed!")
  return True
github enesbcs / rpieasy / _P512_BLEMijia.py View on Github external
def webform_load(self): # create html page for settings
  webserver.addFormTextBox("Device Address","plugin_512_addr",str(self.taskdevicepluginconfig[0]),20)
  webserver.addFormNote("Enable blueetooth then <a href="blescanner">scan MJ_HT_ address</a> first.")
  webserver.addFormCheckBox("Add Battery value for non-Domoticz system","plugin_512_bat",self.taskdevicepluginconfig[1])
  return True
github enesbcs / rpieasy / _C014_GenMQTT.py View on Github external
fname = ""
  options = ["MQTT","MQTTS/with cert","MQTTS/insecure"]
  optionvalues = [0,1,2]
  webserver.addFormSelector("Mode","c014_mode",len(optionvalues),options,optionvalues,None,int(am))
  webserver.addFormTextBox("Server certificate file","c014_cert",str(fname),120)
  webserver.addBrowseButton("Browse","c014_cert",startdir=str(fname))
  webserver.addFormNote("Upload certificate first at <a href="filelist">filelist</a> then select here!")
  try:
   lwt = self.lwt_topic
   lwt1 = self.lwtconnmsg
   lwt2 = self.lwtdisconnmsg
  except:
   lwt = "%sysname%/LWT"
   lwt1 = "Online"
   lwt2 = "Offline"
  webserver.addFormTextBox("Controller lwl topic","c014_lwt",lwt,255)
  webserver.addFormTextBox("LWT Connect Message","c014_cmsg",lwt1,255)
  webserver.addFormTextBox("LWT Disconnect Message","c014_dcmsg",lwt2,255)
  return True
github enesbcs / rpieasy / _P511_RunOSCmd.py View on Github external
def webform_load(self):
  webserver.addFormTextBox("Command 0","plugin_511_cmd0",str(self.taskdevicepluginconfig[0]),512)
  webserver.addFormTextBox("Command 1","plugin_511_cmd1",str(self.taskdevicepluginconfig[1]),512)
  webserver.addFormNote("Specify OS commands that has to be executed at the speficied state (0/1)")
  return True
github enesbcs / rpieasy / _C008_GenHTTP.py View on Github external
def webform_load(self):
  webserver.addFormTextBox("Report template","inchannel",self.inchannel,255)
  return True