AI Translation Notice
This document is automatically translated by AI. If you can read Chinese, we recommend checking the original Chinese documentation for more accurate information.
Task Development Steps
TIP
If your sub-task/tool code will not be called by other tasks, please place it directly in the primary task folder; if you think other tasks will also call this sub-task/tool, then place it in modules/AllTask/SubTask/ or modules/utils
- Use the screenshot function (or other functions) in test to capture the required image patterns. Place the screenshots from different servers in their respective subfolders within the
assetsfolders, and rename them consistently. - Register this pattern in
ButtonName.py,PageName.py, orPopupName.pyunderDATA/assets/using the filename. - Place patterns with the same filename but belonging to different servers in
DATA/assets_<server>. - Create a new folder for this primary task under
modules/AllTask/, and create a new Python file with the same name inside it. Copy the content fromataskformat.pyor from the task template in the development specifications, modifying the class name and the name default attribute in the constructor to your task name. Import this primary task class inmodules/AllTask/__init__. If your task class does not need to appear in the task list and will be called by other tasks, then no import is needed. - If you need to add task-related configuration items, add the default values and mapping functions in
modules/configs/defaultSettings.py, and define the mapping relationships inmodules/configs/settingMaps. - Modify the content of this new task's Python file to implement the task logic. When necessary, implement code splitting for sub-tasks/tools.
- To ensure your task can be correctly parsed from the configuration file, you need to add the task name stored in the user configuration file to
TaskNameinmodules/AllTask/myAllTask.py, and add the mapping relationship betweentask_config_nameandi18n_key_name(the i18n string key displayed in the GUI for this task),task_module(the Python class of this task) inTaskInstanceMap. If your task class does not need to appear in the task list (not a primary task), then no import is needed. - If you need to allow users to modify related configuration content, you need to add the configuration page object ConfigPanel for this feature in
get_config_listingui/refactor_pages/json_set_panel.py. This will appear as an element in the left list of the configuration page. The methods in ConfigPanel are the sub-pages of the configuration content, stored ingui/pages/. - Add the corresponding text in
DATA/i18n.