예제 #1
0
def nodata_add_get():
    g.menu = 'nodatas'
    o = Nodata.get(int(request.args.get('id', '0').strip()))
    return render_template('nodata/add.html',
                           data={
                               'nodata': o,
                               'uic_address': UIC_ADDRESS['external']
                           })
예제 #2
0
def nodatas_get():
    g.menu = 'nodatas'
    page = int(request.args.get('p', 1))
    limit = int(request.args.get('limit', 5))
    query = request.args.get('q', '').strip()
    mine = request.args.get('mine', '1')
    me = g.user_name if mine == '1' else None
    vs, total = Nodata.query(page, limit, query, me)
    return render_template('nodata/list.html',
                           data={
                               'vs': vs,
                               'total': total,
                               'query': query,
                               'limit': limit,
                               'page': page,
                               'mine': mine,
                           })
예제 #3
0
파일: nodata.py 프로젝트: Cepave/portal
def nodatas_get():
    g.menu = 'nodatas'
    page = int(request.args.get('p', 1))
    limit = int(request.args.get('limit', 5))
    query = request.args.get('q', '').strip()
    mine = request.args.get('mine', '1')
    me = g.user_name if mine == '1' else None
    vs, total = Nodata.query(page, limit, query, me)
    return render_template(
        'nodata/list.html',
        data={
            'vs': vs,
            'total': total,
            'query': query,
            'limit': limit,
            'page': page,
            'mine': mine,
        }
    )
예제 #4
0
파일: nodata.py 프로젝트: Cepave/portal
def nodata_update_post():
    nodata_id = request.form['nodata_id'].strip()
    name = request.form['name'].strip()
    obj = request.form['obj'].strip()
    obj_type = request.form['obj_type'].strip()
    metric = request.form['metric'].strip()
    tags = request.form['tags'].strip()
    dstype = request.form['dstype'].strip()
    step = request.form['step'].strip()
    mock = request.form['mock'].strip()

    msg = required_chk({
        'name' : name,
        'endpoint' : obj,
        'endpoint_type' : obj_type,
        'metric' : metric,
        'type' : dstype,
        'step' : step,
        'mock_value': mock,
    })

    if msg:
        return jsonify(msg=msg)

    return jsonify(msg=Nodata.save_or_update(
        nodata_id,
        name,
        obj,
        obj_type,
        metric,
        tags,
        dstype,
        step,
        mock,
        g.user_name,
    ))
예제 #5
0
def nodata_update_post():
    nodata_id = request.form['nodata_id'].strip()
    name = request.form['name'].strip()
    obj = request.form['obj'].strip()
    obj_type = request.form['obj_type'].strip()
    metric = request.form['metric'].strip()
    tags = request.form['tags'].strip()
    dstype = request.form['dstype'].strip()
    step = request.form['step'].strip()
    mock = request.form['mock'].strip()

    msg = required_chk({
        'name': name,
        'endpoint': obj,
        'endpoint_type': obj_type,
        'metric': metric,
        'type': dstype,
        'step': step,
        'mock_value': mock,
    })

    if msg:
        return jsonify(msg=msg)

    return jsonify(msg=Nodata.save_or_update(
        nodata_id,
        name,
        obj,
        obj_type,
        metric,
        tags,
        dstype,
        step,
        mock,
        g.user_name,
    ))
예제 #6
0
파일: nodata.py 프로젝트: Cepave/portal
def nodata_delete_get(nodata_id):
    nodata_id = int(nodata_id)
    Nodata.delete_one(nodata_id)
    return jsonify(msg='')
예제 #7
0
파일: nodata.py 프로젝트: Cepave/portal
def nodata_add_get():
    g.menu = 'nodatas'
    o = Nodata.get(int(request.args.get('id', '0').strip()))
    return render_template('nodata/add.html',
                           data={'nodata': o, 'uic_address': UIC_ADDRESS['external']})
예제 #8
0
def nodata_delete_get(nodata_id):
    nodata_id = int(nodata_id)
    Nodata.delete_one(nodata_id)
    return jsonify(msg='')