예제 #1
0
def search_by_tags():
    tags = request.args.get('tags')
    apis = JsonMethods.get_apis(tags=tags)
    endpoints = JsonMethods.get_endpoints(tags=tags)
    edit_api_form = EditApiForm()
    add_endpoint_form = AddEndpointForm()
    edit_endpoint_form = EditEndpointForm()
    add_field_form = AddFieldForm()
    return render_template('search_by_tags.html',
                           apis=apis,
                           endpoints=endpoints,
                           edit_api_form=edit_api_form,
                           add_endpoint_form=add_endpoint_form,
                           edit_endpoint_form=edit_endpoint_form,
                           add_field_form=add_field_form)
예제 #2
0
def list_apis():
    page = request.args.get(get_page_parameter(), type=int, default=1)
    apis = JsonMethods.get_apis(page=page)
    total = JsonMethods.get_apis_count().get('count')
    pagination = Pagination(page=page,
                            per_page=Globals.ITEM_PER_PAGE,
                            total=total,
                            record_name='apis',
                            css_framework='bootstrap4')
    edit_api_form = EditApiForm()
    add_endpoint_form = AddEndpointForm()
    return render_template('apis_listing.html',
                           apis=apis,
                           pagination=pagination,
                           edit_api_form=edit_api_form,
                           add_endpoint_form=add_endpoint_form)