Beispiel #1
0
def index():
    """Function for handling home route.

    Args:
        None

    Returns:
        Home Page

    """
    # Get UID of _infoset agent

    database = Database()
    session = database.session()
    record = session.query(Agent.id).filter(Agent.idx == 1).one()
    database.close()
    uid = record.id.decode('utf-8')

    # Get agent information
    agent = GetUID(uid)
    idx_agent = agent.idx()
    host = _infoset_hostname()

    agent_list = [agent.everything()]
    datapoints = GetDataPoint(idx_agent)
    data_point_dict = datapoints.everything()

    # Render the home page
    return render_template('index.html',
                           data=data_point_dict,
                           agent_list=agent_list,
                           uid=uid,
                           hostname=host)
Beispiel #2
0
def overview(uid):
    """Function for showing UID related data for agent.

    Args:
        uid: UID of agent

    Returns:
        overview page

    """
    # Get agent information
    agent = GetUID(uid)
    host = _infoset_hostname()
    agent_list = [agent.everything()]
    datapoints = GetDataPoint(agent.idx())
    data_point_dict = datapoints.everything()
    # Render the home page
    return render_template('index.html',
                           data=data_point_dict,
                           agent_list=agent_list,
                           uid=uid,
                           hostname=host)