SelectAppSession
Introduction
SelectAppSession
widget in Supervisely is a dropdown menu that allows users to select an application session from a list of available sessions. SelectAppSession
widget is particularly useful when working with multiple application sessions in Supervisely. It can be customized with various parameters, such as the size and label showing.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| Team ID |
|
| List of possible tags |
|
| Show label text |
|
| Selector size |
|
| Operation type ( |
|
| ID of the widget |
team_id
Determine Team
from which run sessions will be selected.
type: int
tags
Determines list of possible tags to select run sessions. Tags are set in config.json
file of the application in session_tags
field.
type: List[str]
show_label
Determine show text App Session
on widget or not.
type: bool
default value: false
size
Determine selector size (large/small/mini/None).
type: Literal["large", "small", "mini", None]
default value: mini
operation
Determine operation type in select. Can be one of "or"
, "and"
. Setting the operation
parameter to "or"
allows users to connect to apps with any of the provided tags, while setting it to "and"
allows them to connect to apps that have all the selected tags specified.
type: str
default value: Literal["or", "and"]
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Set given session id to widget |
| Return current selected session id |
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/selection/008_select_app_session/src/main.py
Import libraries
Get team_id
from environment variables
team_id
from environment variablesInitialize SelectAppSession
widget
SelectAppSession
widgetCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create app using layout
Create an app object with layout parameter.
Last updated