| 1234567891011121314151617181920212223242526272829303132333435363738 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from flask import Blueprint, render_template, url_for, request
- import requests
- __author__ = 'James Iter'
- __date__ = '2017/8/17'
- __contact__ = 'james.iter.cn@gmail.com'
- __copyright__ = '(c) 2017 by James Iter.'
- blueprint = Blueprint(
- 'v_dashboard',
- __name__,
- url_prefix='/'
- )
- def show():
- args = list()
- resource_path = request.path
- host_url = request.host_url.rstrip('/')
- guests_url = host_url + url_for('api_guests.r_get_by_filter')
- if args.__len__() > 0:
- guests_url = guests_url + '?' + '&'.join(args)
- guests_ret = requests.get(url=guests_url)
- guests_ret = json.loads(guests_ret.content)
- return render_template('dashboard.html', guests_ret=guests_ret, resource_path=resource_path)
|