smia_hi.utilities.gui_utils module

class smia_hi.utilities.gui_utils.GUIControllers(agent_object)[source]

Bases: object

This class contains all the controller to be added to SMIA in order to manage the operator actions.

async static hello_controller(request)[source]

Generic controller during the request of SMIA GUI webpages via HTTP GET call.

async smia_hi_gui_get_controller(request)[source]

The controller during the request of SMIA PE Dashboard.

async smia_hi_task_done_controller(request)[source]

The controller during the request of SMIA PE Dashboard.

class smia_hi.utilities.gui_utils.GUIFeatures[source]

Bases: object

This class contains the methods related to SPADE web interface customization.

FAVICON_PATH = '/htmls/static/SMIA_favicon.ico'
async static add_new_menu_entry(agent, entry_name, entry_url, entry_icon)[source]

This method adds a new entry to the SPADE web interface menu.

Parameters:
  • agent (smia.agents.smia_agent.SMIAAgent) – SMIA SPADE agent object.

  • entry_name (str) – name of the new entry.

  • entry_url (str) – url to access the new entry.

  • entry_icon (str) – icon identifier from Font Awesome collection.

async static handle_favicon(request)[source]

This method represents the controller that will handle the requests when the Favicon is requested.

Parameters:

request – request object to get the favicon file.

Returns:

response to the web browser.

Return type:

web.FileResponse

async static add_custom_favicon(agent)[source]

This method adds a custom Favicon to the SMIA GUI.

Parameters:

agent (spade.agent.Agent) – SMIA SPADE agent object.

static build_avatar_url(jid: str) str[source]

This method overrides the original SPADE method to use the Favicon as the avatar in SMIA SPADE web interface.