switched default to the new ajax UI packaging V0.8.2

Thu, 27 Nov 2014 00:18:29 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Thu, 27 Nov 2014 00:18:29 +0100
branch
packaging
changeset 59
ca29af300a23
parent 58
3dc5adcf2195
child 60
337930ada416

switched default to the new ajax UI

victrond/config.py file | annotate | diff | comparison | revisions
victrond/victrond.py file | annotate | diff | comparison | revisions
--- a/victrond/config.py	Thu Nov 27 00:14:05 2014 +0100
+++ b/victrond/config.py	Thu Nov 27 00:18:29 2014 +0100
@@ -19,6 +19,8 @@
 HTTP_AUTH_STATUS = "access"  # password for status viewer (leave empty for free access)
 HTTP_AUTH_SETTINGS = "admin"  # password for any changes/ups commands (empty password not allowed)
 
+HTTP_AJAX_UI = True # use ajax UI instead of the old static interface
+
 # SERIAL COMMUNICATIONS TO THE UPS
 SERIAL_DEV = "/dev/ttyS0"
 
--- a/victrond/victrond.py	Thu Nov 27 00:14:05 2014 +0100
+++ b/victrond/victrond.py	Thu Nov 27 00:18:29 2014 +0100
@@ -20,9 +20,9 @@
 from config import BATTERYVOLTAGE, LOG_INFOS, LOG_DEBUG, NOTICE_EMAIL, \
     SHUTDOWN_DELAY, SHUTDOWN_POSTDELAY, SHUTDOWN_BATTERYLEFT, SHUTDOWN_CMD, \
     HTTP_ENABLED, HTTP_AUTH_STATUS, HTTP_AUTH_SETTINGS, HTTP_IP, HTTP_PORT, \
-    SERIAL_DEV
+    SERIAL_DEV, HTTP_AJAX_UI
 
-__version__ = "0.8.1"
+__version__ = "0.8.2"
 
 
 class AuthException(Exception):
@@ -797,7 +797,10 @@
             return None
 
         if self.path == "/":
-            self.path = "/index.tmpl"
+            if HTTP_AJAX_UI:
+                self.path = "/ajax-ui.html"
+            else:
+                self.path = "/index.tmpl"
         self.path = self.path.partition("?")[0]  # remove passed parameters!
         dirname = os.path.join(os.path.dirname(os.path.abspath(tools.__file__)), "http")
         filename = dirname + self.path

mercurial