Esempio n. 1
0
File: node.py Progetto: spawn3/uss
    '/node_exit',
    'Node_exit',
    '/set_mds_c60',
    'Set_mds_c60',
    '/page/(.*)',
    'Page',
)

render = render_jinja(
    'webapps/node/templates',
    encoding='utf-8',
)
app = web.application(urls, locals())

#########################################################
oops_db_dir = os.path.join(os.path.dirname(current_dir()), db_dir)
oops_sql_dir = os.path.join(os.path.dirname(current_dir()), sql_dir)

node_db = LocalSqliteDB('node', oops_db_dir, oops_sql_dir)
#########################################################


def notfound():
    return web.notfound(render.notfound())


app.notfound = notfound


def login_required(func):
    def new_func(*args, **argvkw):
Esempio n. 2
0
File: flog.py Progetto: e42s/uss
        '/field_ctrl', 'Field_ctrl', #used 单个服务
        '/tab_rrd', 'Tab_rrd', #used 整个集群

        '/srvc/(.*)', 'Srvc', # used 单个服务

        '/page/(.*)', 'Page',
        '/logOption', 'LogOption', #used
        '/loginfo', 'LogInfo', #used
        '/srvc_dtls', 'Srvc_dtls',
        )

render = render_jinja('webapps/fsys/templates/flog', encoding='utf-8',)
app = web.application(urls, locals())

#########################################################
oops_db_dir = os.path.join(os.path.dirname(current_dir()), db_dir)
oops_sql_dir = os.path.join(os.path.dirname(current_dir()), sql_dir)

node_db = LocalSqliteDB('node', oops_db_dir, oops_sql_dir)
#########################################################


def notfound():
    return web.notfound(render.notfound())
app.notfound = notfound

def login_required(func):
    def new_func(*args, **argvkw):
        session = web.ctx.session
        if session.user == 'anonymous' or session.user == '':
#            return render.notlogin()
Esempio n. 3
0
from ua.common.utils import current_dir
from ua.common.ua_conf import db_dir

import web
import os
import sys
import sqlite3
import json
import time
import random

DEBUG = True

#########################################################
db = os.path.join(os.path.dirname(current_dir()), db_dir, 'user.db')

#db="/media/store/prog/garden/uss/ua/store/db/user_tree.db"
tableName = "jstree_view"

def getChildNode(nodeId, nodeType):
    """接受一个nodeId, 和该节点的类型。 返回它的子节点的Id和类型。 """
    if nodeType == "user":
        return []
    elif nodeType == "group":
        conn=sqlite3.connect(db)
        conn.text_factory=str
        c=conn.cursor()
        txt=c.execute("select * from '%s' where fnodeId = '%s' "%(tableName, nodeId))
        childNodeId = []
        for row in txt: