|
@@ -19,9 +19,18 @@ def data():
|
|
|
if request.env.http_origin:
|
|
|
response.headers['Access-Control-Allow-Origin'] = '*'
|
|
|
def GET(*args, **kargs):
|
|
|
- if len(args) == 0: redirect('index')
|
|
|
-
|
|
|
- db_name = args[0]
|
|
|
+ if len(args) == 0:
|
|
|
+ redirect('index')
|
|
|
+ elif len(args) == 1:
|
|
|
+ db_name = args[0]
|
|
|
+ else:
|
|
|
+ db_name = args[0]
|
|
|
+ table_name = args[1]
|
|
|
+
|
|
|
+ db = globals()[db_name]
|
|
|
+ table = db[table_name]
|
|
|
+ sensors = db().select(table.ALL, orderby='id DESC', limitby=(0,1))
|
|
|
+
|
|
|
# kmodules = info(info.sql_db.database==db_name)\
|
|
|
# (info.sql_module.db==info.sql_db.id).\
|
|
|
# select(info.sql_module.ALL)
|