Beispiel #1
0
def db_tree():
    from over_view import get_all_trees
    import config
    try:
        cur_server_index = int(request.GET.get('s', '0'))
        cur_db_index = int(request.GET.get('db', '0'))
        cur_scan_cursor = int(request.GET.get('cursor', '0'))
    except:
        cur_server_index = 0
        cur_db_index = 0
        cur_scan_cursor = 0
    key = request.GET.get('k', '*')
    all_trees = get_all_trees(cur_server_index, key, db=cur_db_index, cursor=cur_scan_cursor)
    if type(all_trees)==list:
        next_scan_cursor, count = all_trees.pop()
        all_trees_json = json_dumps(all_trees)
    else:
        next_scan_cursor, count = 0, 0
        all_trees_json = []
    m_config = config.base
    return template('db_tree', 
                    all_trees=all_trees_json, 
                    config=m_config, 
                    cur_server_index=cur_server_index,
                    cur_db_index=cur_db_index,
                    cur_scan_cursor=next_scan_cursor, 
                    pre_scan_cursor=cur_scan_cursor,
                    cur_search_key= (key!='*' and key or ''), 
                    count = count,
                    media_prefix=media_prefix
                    )
Beispiel #2
0
def db_tree():
    from over_view import get_all_trees
    import config
    try:
        cur_server_index = int(request.GET.get('s', '0'))
        cur_db_index = int(request.GET.get('db', '0'))
        cur_scan_cursor = int(request.GET.get('cursor', '0'))
    except:
        cur_server_index = 0
        cur_db_index = 0
        cur_scan_cursor = 0
    key = request.GET.get('k', '*')
    all_trees = get_all_trees(cur_server_index, key, db=cur_db_index, cursor=cur_scan_cursor)
    if type(all_trees) == list:
        next_scan_cursor, count = all_trees.pop()
        all_trees_json = json_dumps(all_trees)
        error_msg = ''
    else:
        next_scan_cursor, count = 0, 0
        all_trees_json = []
        error_msg = all_trees
    m_config = config.base
    return template('db_tree',
                    all_trees=all_trees_json,
                    config=m_config,
                    cur_server_index=cur_server_index,
                    cur_db_index=cur_db_index,
                    cur_scan_cursor=next_scan_cursor,
                    pre_scan_cursor=cur_scan_cursor,
                    cur_search_key=(key != '*' and key or ''),
                    count=count,
                    error_msg=error_msg,
                    media_prefix=media_prefix
                    )
 def __init__(self, request):
     super(DeviceReport, self) .__init__()
     self.grid.fields["sn"]["width"]=200
     self.grid.fields["ipaddress"]["width"]=200
     self.grid.fields["area"]["width"]=350
     
     from sync_action import get_area_data
     from mole.mole import json_dumps
     area_data = json_dumps(get_area_data())
     self.AddContext({'area_data':area_data})
Beispiel #4
0
    def __init__(self, request):
        super(DeviceReport, self).__init__()
        self.grid.fields["sn"]["width"] = 200
        self.grid.fields["ipaddress"]["width"] = 200
        self.grid.fields["area"]["width"] = 350

        from sync_action import get_area_data
        from mole.mole import json_dumps
        area_data = json_dumps(get_area_data())
        self.AddContext({'area_data': area_data})
Beispiel #5
0
def db_tree():
    from over_view import get_all_trees
    import config
    try:
        cur_server_index = int(request.GET.get('s', '0'))
        cur_db_index = int(request.GET.get('db', '0'))
    except:
        cur_server_index = 0
        cur_db_index = 0
    key = request.GET.get('k', '*')
    all_trees = get_all_trees(cur_server_index, key, db=cur_db_index)
    m_config = config.base
    return template('db_tree', all_trees=json_dumps(all_trees), config=m_config, cur_server_index=cur_server_index,cur_db_index=cur_db_index, media_prefix=media_prefix)
Beispiel #6
0
def db_tree():
    from over_view import get_all_trees
    import config
    try:
        cur_server_index = int(request.GET.get('s', '0'))
        cur_db_index = int(request.GET.get('db', '0'))
    except:
        cur_server_index = 0
        cur_db_index = 0
    key = request.GET.get('k', '*')
    all_trees = get_all_trees(cur_server_index, key, db=cur_db_index)
    m_config = config.base
    return template('db_tree',
                    all_trees=json_dumps(all_trees),
                    config=m_config,
                    cur_server_index=cur_server_index,
                    cur_db_index=cur_db_index,
                    media_prefix=media_prefix)
Beispiel #7
0
def db_tree():
    from over_view import get_all_trees
    import config

    try:
        cur_server_index = int(request.GET.get("s", "0"))
        cur_db_index = int(request.GET.get("db", "0"))
        cur_scan_cursor = int(request.GET.get("cursor", "0"))
    except:
        cur_server_index = 0
        cur_db_index = 0
        cur_scan_cursor = 0
    key = request.GET.get("k", "*")
    all_trees = get_all_trees(cur_server_index, key, db=cur_db_index, cursor=cur_scan_cursor)
    if type(all_trees) == list:
        next_scan_cursor, count = all_trees.pop()
        all_trees_json = json_dumps(all_trees)
        error_msg = ""
    else:
        next_scan_cursor, count = 0, 0
        all_trees_json = []
        error_msg = all_trees
    m_config = config.base
    return template(
        "db_tree",
        all_trees=all_trees_json,
        config=m_config,
        cur_server_index=cur_server_index,
        cur_db_index=cur_db_index,
        cur_scan_cursor=next_scan_cursor,
        pre_scan_cursor=cur_scan_cursor,
        cur_search_key=(key != "*" and key or ""),
        count=count,
        error_msg=error_msg,
        media_prefix=media_prefix,
    )
Beispiel #8
0
def server_tree():
    from over_view import get_db_trees
    all_trees = get_db_trees()
    return template("server_tree",all_trees=json_dumps(all_trees),media_prefix=media_prefix)
Beispiel #9
0
def server_tree():
    from over_view import get_db_trees
    all_trees = get_db_trees()
    return template("server_tree",
                    all_trees=json_dumps(all_trees),
                    media_prefix=media_prefix)