TeamFilesSelector
Last updated
Last updated
TeamFilesSelector
is a graphic interface widget in the Supervisely platform that enables users to easily select files and/or folders from their Team files. It allows to customize selecting type (files, folder or both of this types) and displaying additional columns with information about files and folder (size, created date, updated date, type, mime type). The widget features a user-friendly interface and is optimized for performance, making it a valuable tool for teams working.
team_id
int
Team ID
multiple_selection
bool
Whether available selection multiple files/folders
max_height
int
Determine maximum height of the widget
selection_file_type
Literal["folder", "file"]
or None
Determine type of items available for selection
hide_header
bool
If True
hide widget table header
hide_empty_table
bool
If True
and Team files directory is empty it will display message
additional_fields
List[Literal["id", "createdAt", "updatedAt", "type", "size", "mimeType"]]
Determine column names to display additional information about files/folders
widget_id
str
ID of the widget
Team ID
type: int
Whether available selection multiple files/folders
type: bool
default value: False
Determine maximum height of the widget
type: int
default value: 500
If True
hide widget table header
type bool
default value: True
Determine type of items available for selection
type: Literal["folder", "file"]
or None
default value: None
If True
and Team files directory is empty it will display message
type: bool
default value: True
Determine column names to display additional information about files/folders
type: List[Literal["id", "createdAt", "updatedAt", "type", "size", "mimeType"]]
default value: []
ID of the widget
type: str
default value: ``
get_selected_paths()
Get list of path for selected files/folders in Team files.
get_selected_items()
Get list of selected files/folders information in Team files.
set_team_id(team_id: int)
Set team_id
for TeamFilesSelector
widget.
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/selection/012_team_files_selector/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
team_id
from environment variablesTeamFilesSelector
widgetText
, Button
widgets we will use in UI for demoPrepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create an app object with layout parameter.