示例#1
0
def searchmatch():
    form = SearchForm()
    params = None
    if form.validate_on_submit():
        if len(form.hostname.data) == 0:
            abort(500)
        params = slib.searchmatch(form.hostname.data)
        sysgrps = slib.get_sysgroups()
        if params['hosts'] != None:
            for x in params['hosts']:
                for y in sysgrps['results']:
                    if y['id'] == x['sysgroupid']:
                        x['sysgroupname'] = y['name']
                        break
        else:
            params['hosts'] = []
    return render_template('searchmatch.html', form=form, results=params)
示例#2
0
def searchmatch():
    form = SearchForm()
    params = None
    if form.validate_on_submit():
        if len(form.hostname.data) == 0:
            abort(500)
        params = slib.searchmatch(form.hostname.data)
        sysgrps = slib.get_sysgroups()
        if params['hosts'] != None:
            for x in params['hosts']:
                for y in sysgrps['results']:
                    if y['id'] == x['sysgroupid']:
                        x['sysgroupname'] = y['name']
                        break
        else:
            params['hosts'] = []
    return render_template('searchmatch.html', form=form, results=params)
示例#3
0
def sysgroups():
    res = slib.get_sysgroups()
    return render_template('sysgroups.html', results=res)
示例#4
0
def sysgroups():
    res = slib.get_sysgroups()
    return render_template('sysgroups.html', results=res)