Example #1
0
def my_shell_history(page):
    search_form = SearchForm()
    if search_form.validate_on_submit():
        return redirect(url_for("my_shell_history_search", regex=search_form.regex.data))

    commands = current_user.get_commands(only_public=False).paginate(per_page=100, page=page)
    return render_template("shell_history.html", commands=commands, search_form=search_form, title="My Shell History")
Example #2
0
def my_shell_history_search(page, regex):
    commands = current_user.get_commands(only_public=False).filter(Command.text.op("~")(regex)).paginate(per_page=100, page=page)
    return render_template("shell_history.html", commands=commands, title=u"My Shell History: search results for [{}]".format(regex))