diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be6618f..1479d8e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,29 +7,29 @@ ci: autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks" repos: - repo: https://github.com/hadialqattan/pycln - rev: v2.1.3 + rev: v2.6.0 hooks: - id: pycln args: [--config, pyproject.toml] - stages: [commit] + stages: [pre-commit] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 7.0.0 hooks: - id: isort - stages: [commit] + stages: [pre-commit] - - repo: https://github.com/psf/black - rev: 23.7.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 25.12.0 hooks: - id: black - stages: [commit] + stages: [pre-commit] - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.3 + rev: v4.0.0-alpha.8 hooks: - id: prettier - stages: [commit] + stages: [pre-commit] - repo: https://github.com/nonebot/nonemoji rev: v0.1.4 diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index 50ee96f..e7ab8f6 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -1,15 +1,15 @@ /* eslint-env node */ -require('@rushstack/eslint-patch/modern-module-resolution') +require("@rushstack/eslint-patch/modern-module-resolution"); module.exports = { root: true, extends: [ - 'plugin:vue/vue3-essential', - 'eslint:recommended', - '@vue/eslint-config-typescript', - '@vue/eslint-config-prettier/skip-formatting' + "plugin:vue/vue3-essential", + "eslint:recommended", + "@vue/eslint-config-typescript", + "@vue/eslint-config-prettier/skip-formatting", ], parserOptions: { - ecmaVersion: 'latest' - } -} + ecmaVersion: "latest", + }, +}; diff --git a/frontend/openapi-ts.config.ts b/frontend/openapi-ts.config.ts index e4279b9..642c32f 100644 --- a/frontend/openapi-ts.config.ts +++ b/frontend/openapi-ts.config.ts @@ -1,13 +1,13 @@ -import { defineConfig } from '@hey-api/openapi-ts' +import { defineConfig } from "@hey-api/openapi-ts"; export default defineConfig({ - client: '@hey-api/client-fetch', - input: '../openapi.json', + client: "@hey-api/client-fetch", + input: "../openapi.json", output: { - format: 'prettier', - path: './src/client/api' + format: "prettier", + path: "./src/client/api", }, services: { - asClass: true - } -}) + asClass: true, + }, +}); diff --git a/frontend/postcss.config.js b/frontend/postcss.config.js index ffde384..750d0a3 100644 --- a/frontend/postcss.config.js +++ b/frontend/postcss.config.js @@ -1,8 +1,8 @@ export default { plugins: { - 'postcss-import': {}, - 'tailwindcss/nesting': 'postcss-nesting', + "postcss-import": {}, + "tailwindcss/nesting": "postcss-nesting", tailwindcss: {}, - autoprefixer: {} - } -} + autoprefixer: {}, + }, +}; diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 13c4a63..e2af2f2 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,9 +1,9 @@ diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css index 98e23e3..f20d7f2 100644 --- a/frontend/src/assets/main.css +++ b/frontend/src/assets/main.css @@ -1,4 +1,4 @@ -@import 'material-symbols'; +@import "material-symbols"; @tailwind base; @tailwind components; diff --git a/frontend/src/client/api/index.ts b/frontend/src/client/api/index.ts index d4894af..1cb041d 100644 --- a/frontend/src/client/api/index.ts +++ b/frontend/src/client/api/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export * from './schemas.gen' -export * from './services.gen' -export * from './types.gen' +export * from "./schemas.gen"; +export * from "./services.gen"; +export * from "./types.gen"; diff --git a/frontend/src/client/api/schemas.gen.ts b/frontend/src/client/api/schemas.gen.ts index e1a5050..672b2f8 100644 --- a/frontend/src/client/api/schemas.gen.ts +++ b/frontend/src/client/api/schemas.gen.ts @@ -1,1267 +1,1269 @@ // This file is auto-generated by @hey-api/openapi-ts export const AdapterSchema = { - title: 'Adapter', - type: 'object', + title: "Adapter", + type: "object", properties: { module_name: { - title: 'Module Name', - type: 'string', - default: 'unknown' + title: "Module Name", + type: "string", + default: "unknown", }, project_link: { - title: 'Project Link', - type: 'string', - default: 'unknown' + title: "Project Link", + type: "string", + default: "unknown", }, name: { - title: 'Name', - type: 'string', - default: 'unknown' + title: "Name", + type: "string", + default: "unknown", }, desc: { - title: 'Desc', - type: 'string', - default: 'unknown' + title: "Desc", + type: "string", + default: "unknown", }, author: { - title: 'Author', - type: 'string', - default: 'unknown' + title: "Author", + type: "string", + default: "unknown", }, homepage: { - title: 'Homepage', - type: 'string', - default: 'unknown' + title: "Homepage", + type: "string", + default: "unknown", }, usage: { - title: 'Usage', - type: 'string', - default: 'unknown' + title: "Usage", + type: "string", + default: "unknown", }, extra: { - title: 'Extra', - type: 'object' + title: "Extra", + type: "object", }, tags: { - title: 'Tags', - type: 'array', + title: "Tags", + type: "array", items: { - $ref: '#/components/schemas/ModuleTag' - } + $ref: "#/components/schemas/ModuleTag", + }, }, is_official: { - title: 'Is Official', - type: 'boolean', - default: false + title: "Is Official", + type: "boolean", + default: false, }, version: { - title: 'Version', - type: 'string', - default: '0.0.0' + title: "Version", + type: "string", + default: "0.0.0", }, is_download: { - title: 'Is Download', - type: 'boolean', - default: false - } - } -} as const + title: "Is Download", + type: "boolean", + default: false, + }, + }, +} as const; export const AddProjectDataSchema = { - title: 'AddProjectData', - required: ['project_name', 'project_dir', 'mirror_url'], - type: 'object', + title: "AddProjectData", + required: ["project_name", "project_dir", "mirror_url"], + type: "object", properties: { project_name: { - title: 'Project Name', - type: 'string' + title: "Project Name", + type: "string", }, project_dir: { - title: 'Project Dir', - type: 'string' + title: "Project Dir", + type: "string", }, mirror_url: { - title: 'Mirror Url', - type: 'string' + title: "Mirror Url", + type: "string", }, adapters: { - title: 'Adapters', - type: 'array', + title: "Adapters", + type: "array", items: { - type: 'string' + type: "string", }, - default: [] + default: [], }, plugins: { - title: 'Plugins', - type: 'array', + title: "Plugins", + type: "array", items: { - type: 'string' + type: "string", }, - default: [] + default: [], }, plugin_dirs: { - title: 'Plugin Dirs', - type: 'array', + title: "Plugin Dirs", + type: "array", items: { - type: 'string' + type: "string", }, - default: [] + default: [], }, builtin_plugins: { - title: 'Builtin Plugins', - type: 'array', + title: "Builtin Plugins", + type: "array", items: { - type: 'string' + type: "string", }, - default: [] - } - } -} as const + default: [], + }, + }, +} as const; export const Body_search_nonebot_store_item_v1_store_nonebot_search_postSchema = { - title: 'Body_search_nonebot_store_item_v1_store_nonebot_search_post', - required: ['data'], - type: 'object', + title: "Body_search_nonebot_store_item_v1_store_nonebot_search_post", + required: ["data"], + type: "object", properties: { data: { - $ref: '#/components/schemas/SearchRequest' - } - } -} as const + $ref: "#/components/schemas/SearchRequest", + }, + }, +} as const; export const ConfigTypeSchema = { - title: 'ConfigType', - enum: ['project', 'toml'], - type: 'string', - description: 'An enumeration.' -} as const + title: "ConfigType", + enum: ["project", "toml"], + type: "string", + description: "An enumeration.", +} as const; export const CreateProjectDataSchema = { - title: 'CreateProjectData', + title: "CreateProjectData", required: [ - 'is_bootstrap', - 'project_name', - 'project_dir', - 'mirror_url', - 'drivers', - 'adapters', - 'use_src' + "is_bootstrap", + "project_name", + "project_dir", + "mirror_url", + "drivers", + "adapters", + "use_src", ], - type: 'object', + type: "object", properties: { is_bootstrap: { - title: 'Is Bootstrap', - type: 'boolean' + title: "Is Bootstrap", + type: "boolean", }, project_name: { - title: 'Project Name', - type: 'string' + title: "Project Name", + type: "string", }, project_dir: { - title: 'Project Dir', - type: 'string' + title: "Project Dir", + type: "string", }, mirror_url: { - title: 'Mirror Url', - type: 'string' + title: "Mirror Url", + type: "string", }, drivers: { - title: 'Drivers', - type: 'array', + title: "Drivers", + type: "array", items: { - $ref: '#/components/schemas/nb_cli_plugin_webui__app__models__base__ModuleInfo' - } + $ref: "#/components/schemas/nb_cli_plugin_webui__app__models__base__ModuleInfo", + }, }, adapters: { - title: 'Adapters', - type: 'array', + title: "Adapters", + type: "array", items: { - $ref: '#/components/schemas/nb_cli_plugin_webui__app__models__base__ModuleInfo' - } + $ref: "#/components/schemas/nb_cli_plugin_webui__app__models__base__ModuleInfo", + }, }, use_src: { - title: 'Use Src', - type: 'boolean' - } - } -} as const + title: "Use Src", + type: "boolean", + }, + }, +} as const; export const DriverSchema = { - title: 'Driver', - type: 'object', + title: "Driver", + type: "object", properties: { module_name: { - title: 'Module Name', - type: 'string', - default: 'unknown' + title: "Module Name", + type: "string", + default: "unknown", }, project_link: { - title: 'Project Link', - type: 'string', - default: 'unknown' + title: "Project Link", + type: "string", + default: "unknown", }, name: { - title: 'Name', - type: 'string', - default: 'unknown' + title: "Name", + type: "string", + default: "unknown", }, desc: { - title: 'Desc', - type: 'string', - default: 'unknown' + title: "Desc", + type: "string", + default: "unknown", }, author: { - title: 'Author', - type: 'string', - default: 'unknown' + title: "Author", + type: "string", + default: "unknown", }, homepage: { - title: 'Homepage', - type: 'string', - default: 'unknown' + title: "Homepage", + type: "string", + default: "unknown", }, usage: { - title: 'Usage', - type: 'string', - default: 'unknown' + title: "Usage", + type: "string", + default: "unknown", }, extra: { - title: 'Extra', - type: 'object' + title: "Extra", + type: "object", }, tags: { - title: 'Tags', - type: 'array', + title: "Tags", + type: "array", items: { - $ref: '#/components/schemas/ModuleTag' - } + $ref: "#/components/schemas/ModuleTag", + }, }, is_official: { - title: 'Is Official', - type: 'boolean', - default: false + title: "Is Official", + type: "boolean", + default: false, }, version: { - title: 'Version', - type: 'string', - default: '0.0.0' + title: "Version", + type: "string", + default: "0.0.0", }, is_download: { - title: 'Is Download', - type: 'boolean', - default: false - } - } -} as const + title: "Is Download", + type: "boolean", + default: false, + }, + }, +} as const; export const FileInfoSchema = { - title: 'FileInfo', - required: ['name', 'is_dir', 'path', 'modified_time', 'absolute_path'], - type: 'object', + title: "FileInfo", + required: ["name", "is_dir", "path", "modified_time", "absolute_path"], + type: "object", properties: { name: { - title: 'Name', - type: 'string' + title: "Name", + type: "string", }, is_dir: { - title: 'Is Dir', - type: 'boolean' + title: "Is Dir", + type: "boolean", }, path: { - title: 'Path', - type: 'string' + title: "Path", + type: "string", }, modified_time: { - title: 'Modified Time', - type: 'string' + title: "Modified Time", + type: "string", }, absolute_path: { - title: 'Absolute Path', - type: 'string' - } - } -} as const + title: "Absolute Path", + type: "string", + }, + }, +} as const; export const FileResponseSchema = { - title: 'FileResponse', - required: ['detail'], - type: 'object', + title: "FileResponse", + required: ["detail"], + type: "object", properties: { detail: { - title: 'Detail', - type: 'array', + title: "Detail", + type: "array", items: { - $ref: '#/components/schemas/FileInfo' - } - } - } -} as const + $ref: "#/components/schemas/FileInfo", + }, + }, + }, +} as const; export const GenericResponse_List_nb_cli_plugin_webui_app_handlers_process_schemas_ProcessLog__Schema = { - title: 'GenericResponse[List[nb_cli_plugin_webui.app.handlers.process.schemas.ProcessLog]]', - required: ['detail'], - type: 'object', + title: + "GenericResponse[List[nb_cli_plugin_webui.app.handlers.process.schemas.ProcessLog]]", + required: ["detail"], + type: "object", properties: { detail: { - title: 'Detail', - type: 'array', + title: "Detail", + type: "array", items: { - $ref: '#/components/schemas/ProcessLog' - } - } - } - } as const + $ref: "#/components/schemas/ProcessLog", + }, + }, + }, + } as const; -export const GenericResponse_List_nb_cli_plugin_webui_app_models_base_ModuleInfo__Schema = { - title: 'GenericResponse[List[nb_cli_plugin_webui.app.models.base.ModuleInfo]]', - required: ['detail'], - type: 'object', - properties: { - detail: { - title: 'Detail', - type: 'array', - items: { - $ref: '#/components/schemas/nb_cli_plugin_webui__app__models__base__ModuleInfo' - } - } - } -} as const +export const GenericResponse_List_nb_cli_plugin_webui_app_models_base_ModuleInfo__Schema = + { + title: "GenericResponse[List[nb_cli_plugin_webui.app.models.base.ModuleInfo]]", + required: ["detail"], + type: "object", + properties: { + detail: { + title: "Detail", + type: "array", + items: { + $ref: "#/components/schemas/nb_cli_plugin_webui__app__models__base__ModuleInfo", + }, + }, + }, + } as const; export const GenericResponse_List_nb_cli_plugin_webui_app_models_base_Plugin__Schema = { - title: 'GenericResponse[List[nb_cli_plugin_webui.app.models.base.Plugin]]', - required: ['detail'], - type: 'object', + title: "GenericResponse[List[nb_cli_plugin_webui.app.models.base.Plugin]]", + required: ["detail"], + type: "object", properties: { detail: { - title: 'Detail', - type: 'array', + title: "Detail", + type: "array", items: { - $ref: '#/components/schemas/nb_cli_plugin_webui__app__models__base__Plugin' - } - } - } -} as const + $ref: "#/components/schemas/nb_cli_plugin_webui__app__models__base__Plugin", + }, + }, + }, +} as const; export const GenericResponse_List_str__Schema = { - title: 'GenericResponse[List[str]]', - required: ['detail'], - type: 'object', + title: "GenericResponse[List[str]]", + required: ["detail"], + type: "object", properties: { detail: { - title: 'Detail', - type: 'array', + title: "Detail", + type: "array", items: { - type: 'string' - } - } - } -} as const + type: "string", + }, + }, + }, +} as const; export const GenericResponse_NoneBotProjectMeta_Schema = { - title: 'GenericResponse[NoneBotProjectMeta]', - required: ['detail'], - type: 'object', + title: "GenericResponse[NoneBotProjectMeta]", + required: ["detail"], + type: "object", properties: { detail: { - $ref: '#/components/schemas/NoneBotProjectMeta' - } - } -} as const + $ref: "#/components/schemas/NoneBotProjectMeta", + }, + }, +} as const; export const GenericResponse_ProjectTomlDetail_Schema = { - title: 'GenericResponse[ProjectTomlDetail]', - required: ['detail'], - type: 'object', + title: "GenericResponse[ProjectTomlDetail]", + required: ["detail"], + type: "object", properties: { detail: { - $ref: '#/components/schemas/ProjectTomlDetail' - } - } -} as const + $ref: "#/components/schemas/ProjectTomlDetail", + }, + }, +} as const; export const GenericResponse_int_Schema = { - title: 'GenericResponse[int]', - required: ['detail'], - type: 'object', + title: "GenericResponse[int]", + required: ["detail"], + type: "object", properties: { detail: { - title: 'Detail', - type: 'integer' - } - } -} as const + title: "Detail", + type: "integer", + }, + }, +} as const; export const GenericResponse_str_Schema = { - title: 'GenericResponse[str]', - required: ['detail'], - type: 'object', + title: "GenericResponse[str]", + required: ["detail"], + type: "object", properties: { detail: { - title: 'Detail', - type: 'string' - } - } -} as const + title: "Detail", + type: "string", + }, + }, +} as const; export const HTTPValidationErrorSchema = { - title: 'HTTPValidationError', - type: 'object', + title: "HTTPValidationError", + type: "object", properties: { detail: { - title: 'Detail', - type: 'array', + title: "Detail", + type: "array", items: { - $ref: '#/components/schemas/ValidationError' - } - } - } -} as const + $ref: "#/components/schemas/ValidationError", + }, + }, + }, +} as const; export const ItemSchema = { - title: 'Item', - required: ['type'], - type: 'object', + title: "Item", + required: ["type"], + type: "object", properties: { enum: { - title: 'Enum', - type: 'array', - items: {} + title: "Enum", + type: "array", + items: {}, }, type: { - title: 'Type', - type: 'string' - } - } -} as const + title: "Type", + type: "string", + }, + }, +} as const; export const ListProjectResponseSchema = { - title: 'ListProjectResponse', - required: ['detail'], - type: 'object', + title: "ListProjectResponse", + required: ["detail"], + type: "object", properties: { detail: { - title: 'Detail', - type: 'object', + title: "Detail", + type: "object", additionalProperties: { - $ref: '#/components/schemas/NoneBotProjectMeta' - } - } - } -} as const + $ref: "#/components/schemas/NoneBotProjectMeta", + }, + }, + }, +} as const; export const LogLevelSchema = { - title: 'LogLevel', - enum: ['STDOUT', 'INFO', 'WARNING', 'ERROR', 'DEBUG'], - type: 'string', - description: 'An enumeration.' -} as const + title: "LogLevel", + enum: ["STDOUT", "INFO", "WARNING", "ERROR", "DEBUG"], + type: "string", + description: "An enumeration.", +} as const; export const LoginRequestSchema = { - title: 'LoginRequest', - required: ['token', 'mark'], - type: 'object', + title: "LoginRequest", + required: ["token", "mark"], + type: "object", properties: { token: { - title: 'Token', - type: 'string' + title: "Token", + type: "string", }, mark: { - title: 'Mark', - type: 'string' - } - } -} as const + title: "Mark", + type: "string", + }, + }, +} as const; export const ModuleConfigChildSchema = { - title: 'ModuleConfigChild', - required: ['title', 'name', 'conf_type', 'unique_items', 'is_secret'], - type: 'object', + title: "ModuleConfigChild", + required: ["title", "name", "conf_type", "unique_items", "is_secret"], + type: "object", properties: { title: { - title: 'Title', - type: 'string' + title: "Title", + type: "string", }, description: { - title: 'Description', - type: 'string' + title: "Description", + type: "string", }, name: { - title: 'Name', - type: 'string' + title: "Name", + type: "string", }, default: { - title: 'Default' + title: "Default", }, conf_type: { - title: 'Conf Type', - type: 'string' + title: "Conf Type", + type: "string", }, enum: { - title: 'Enum', - type: 'array', - items: {} + title: "Enum", + type: "array", + items: {}, }, configured: { - title: 'Configured' + title: "Configured", }, items: { - $ref: '#/components/schemas/Item' + $ref: "#/components/schemas/Item", }, unique_items: { - title: 'Unique Items', - type: 'boolean' + title: "Unique Items", + type: "boolean", }, is_secret: { - title: 'Is Secret', - type: 'boolean' + title: "Is Secret", + type: "boolean", }, latest_change: { - title: 'Latest Change', - type: 'string', - default: '.env' - } - } -} as const + title: "Latest Change", + type: "string", + default: ".env", + }, + }, +} as const; export const ModuleConfigFatherSchema = { - title: 'ModuleConfigFather', - required: ['title', 'name', 'module_type', 'properties'], - type: 'object', + title: "ModuleConfigFather", + required: ["title", "name", "module_type", "properties"], + type: "object", properties: { title: { - title: 'Title', - type: 'string' + title: "Title", + type: "string", }, description: { - title: 'Description', - type: 'string' + title: "Description", + type: "string", }, name: { - title: 'Name', - type: 'string' + title: "Name", + type: "string", }, module_type: { - title: 'Module Type', + title: "Module Type", anyOf: [ { - $ref: '#/components/schemas/ModuleType' + $ref: "#/components/schemas/ModuleType", }, { - $ref: '#/components/schemas/ConfigType' - } - ] + $ref: "#/components/schemas/ConfigType", + }, + ], }, properties: { - title: 'Properties', - type: 'array', + title: "Properties", + type: "array", items: { - $ref: '#/components/schemas/ModuleConfigChild' - } - } - } -} as const + $ref: "#/components/schemas/ModuleConfigChild", + }, + }, + }, +} as const; export const ModuleConfigResponseSchema = { - title: 'ModuleConfigResponse', - required: ['detail'], - type: 'object', + title: "ModuleConfigResponse", + required: ["detail"], + type: "object", properties: { detail: { - title: 'Detail', - type: 'array', + title: "Detail", + type: "array", items: { - $ref: '#/components/schemas/ModuleConfigFather' - } - } - } -} as const + $ref: "#/components/schemas/ModuleConfigFather", + }, + }, + }, +} as const; export const ModuleConfigUpdateRequestSchema = { - title: 'ModuleConfigUpdateRequest', - required: ['env', 'conf_type', 'k'], - type: 'object', + title: "ModuleConfigUpdateRequest", + required: ["env", "conf_type", "k"], + type: "object", properties: { env: { - title: 'Env', - type: 'string' + title: "Env", + type: "string", }, conf_type: { - title: 'Conf Type', - type: 'string' + title: "Conf Type", + type: "string", }, k: { - title: 'K', - type: 'string' + title: "K", + type: "string", }, v: { - title: 'V' - } - } -} as const + title: "V", + }, + }, +} as const; export const ModuleTagSchema = { - title: 'ModuleTag', - required: ['label', 'color'], - type: 'object', + title: "ModuleTag", + required: ["label", "color"], + type: "object", properties: { label: { - title: 'Label', - type: 'string' + title: "Label", + type: "string", }, color: { - title: 'Color', - type: 'string' - } - } -} as const + title: "Color", + type: "string", + }, + }, +} as const; export const ModuleTypeSchema = { - title: 'ModuleType', - enum: ['module', 'plugin', 'adapter', 'driver'], - type: 'string', - description: 'An enumeration.' -} as const + title: "ModuleType", + enum: ["module", "plugin", "adapter", "driver"], + type: "string", + description: "An enumeration.", +} as const; export const NoneBotProjectMetaSchema = { - title: 'NoneBotProjectMeta', + title: "NoneBotProjectMeta", required: [ - 'project_id', - 'project_name', - 'project_dir', - 'mirror_url', - 'adapters', - 'drivers', - 'plugins', - 'plugin_dirs', - 'builtin_plugins' + "project_id", + "project_name", + "project_dir", + "mirror_url", + "adapters", + "drivers", + "plugins", + "plugin_dirs", + "builtin_plugins", ], - type: 'object', + type: "object", properties: { project_id: { - title: 'Project Id', - type: 'string' + title: "Project Id", + type: "string", }, project_name: { - title: 'Project Name', - type: 'string' + title: "Project Name", + type: "string", }, project_dir: { - title: 'Project Dir', - type: 'string' + title: "Project Dir", + type: "string", }, mirror_url: { - title: 'Mirror Url', - type: 'string' + title: "Mirror Url", + type: "string", }, adapters: { - title: 'Adapters', - type: 'array', + title: "Adapters", + type: "array", items: { - $ref: '#/components/schemas/nb_cli_plugin_webui__app__models__base__ModuleInfo' - } + $ref: "#/components/schemas/nb_cli_plugin_webui__app__models__base__ModuleInfo", + }, }, drivers: { - title: 'Drivers', - type: 'array', + title: "Drivers", + type: "array", items: { - $ref: '#/components/schemas/nb_cli_plugin_webui__app__models__base__ModuleInfo' - } + $ref: "#/components/schemas/nb_cli_plugin_webui__app__models__base__ModuleInfo", + }, }, plugins: { - title: 'Plugins', - type: 'array', + title: "Plugins", + type: "array", items: { - $ref: '#/components/schemas/nb_cli_plugin_webui__app__models__base__Plugin' - } + $ref: "#/components/schemas/nb_cli_plugin_webui__app__models__base__Plugin", + }, }, plugin_dirs: { - title: 'Plugin Dirs', - type: 'array', + title: "Plugin Dirs", + type: "array", items: { - type: 'string' - } + type: "string", + }, }, builtin_plugins: { - title: 'Builtin Plugins', - type: 'array', + title: "Builtin Plugins", + type: "array", items: { - type: 'string' - } + type: "string", + }, }, is_running: { - title: 'Is Running', - type: 'boolean', - default: false + title: "Is Running", + type: "boolean", + default: false, }, use_env: { - title: 'Use Env', - type: 'string', - default: '.env' + title: "Use Env", + type: "string", + default: ".env", }, use_run_script: { - title: 'Use Run Script', - type: 'boolean', - default: false + title: "Use Run Script", + type: "boolean", + default: false, }, run_script_name: { - title: 'Run Script Name', - type: 'string', - default: 'bot.py' - } - } -} as const + title: "Run Script Name", + type: "string", + default: "bot.py", + }, + }, +} as const; export const PluginTypeSchema = { - title: 'PluginType', - enum: ['application', 'library'], - type: 'string', + title: "PluginType", + enum: ["application", "library"], + type: "string", description: `类型参考: -- https://github.com/nonebot/noneflow/blob/main/src/utils/validation/constants.py#L17` -} as const +- https://github.com/nonebot/noneflow/blob/main/src/utils/validation/constants.py#L17`, +} as const; export const ProcessLogSchema = { - title: 'ProcessLog', - required: ['message'], - type: 'object', + title: "ProcessLog", + required: ["message"], + type: "object", properties: { time: { - title: 'Time', + title: "Time", anyOf: [ { - type: 'string', - format: 'date-time' + type: "string", + format: "date-time", }, { - type: 'string' - } - ] + type: "string", + }, + ], }, level: { allOf: [ { - $ref: '#/components/schemas/LogLevel' - } + $ref: "#/components/schemas/LogLevel", + }, ], - default: 'STDOUT' + default: "STDOUT", }, message: { - title: 'Message', - type: 'string' - } - } -} as const + title: "Message", + type: "string", + }, + }, +} as const; export const ProjectTomlDetailSchema = { - title: 'ProjectTomlDetail', - required: ['project_name', 'adapters', 'plugins', 'plugin_dirs', 'builtin_plugins'], - type: 'object', + title: "ProjectTomlDetail", + required: ["project_name", "adapters", "plugins", "plugin_dirs", "builtin_plugins"], + type: "object", properties: { project_name: { - title: 'Project Name', - type: 'string' + title: "Project Name", + type: "string", }, adapters: { - title: 'Adapters', - type: 'array', + title: "Adapters", + type: "array", items: { - type: 'object', + type: "object", additionalProperties: { - type: 'string' - } - } + type: "string", + }, + }, }, plugins: { - title: 'Plugins', - type: 'array', + title: "Plugins", + type: "array", items: { - type: 'string' - } + type: "string", + }, }, plugin_dirs: { - title: 'Plugin Dirs', - type: 'array', + title: "Plugin Dirs", + type: "array", items: { - type: 'string' - } + type: "string", + }, }, builtin_plugins: { - title: 'Builtin Plugins', - type: 'array', + title: "Builtin Plugins", + type: "array", items: { - type: 'string' - } - } - } -} as const + type: "string", + }, + }, + }, +} as const; export const SearchRequestSchema = { - title: 'SearchRequest', - required: ['module_type', 'content'], - type: 'object', + title: "SearchRequest", + required: ["module_type", "content"], + type: "object", properties: { module_type: { - $ref: '#/components/schemas/ModuleType' + $ref: "#/components/schemas/ModuleType", }, tags: { - title: 'Tags', - type: 'array', + title: "Tags", + type: "array", items: { - $ref: '#/components/schemas/nb_cli_plugin_webui__app__models__store__SearchTag' + $ref: "#/components/schemas/nb_cli_plugin_webui__app__models__store__SearchTag", }, - default: [] + default: [], }, content: { - title: 'Content', - type: 'string' - } - } -} as const + title: "Content", + type: "string", + }, + }, +} as const; export const SimpleModelSchema = { - title: 'SimpleModel', - required: ['name', 'is_dir', 'path'], - type: 'object', + title: "SimpleModel", + required: ["name", "is_dir", "path"], + type: "object", properties: { name: { - title: 'Name', - type: 'string' + title: "Name", + type: "string", }, is_dir: { - title: 'Is Dir', - type: 'boolean' + title: "Is Dir", + type: "boolean", }, path: { - title: 'Path', - type: 'string' - } - } -} as const + title: "Path", + type: "string", + }, + }, +} as const; export const StoreListResponseSchema = { - title: 'StoreListResponse', - required: ['detail', 'now_page', 'total_page', 'total_item'], - type: 'object', + title: "StoreListResponse", + required: ["detail", "now_page", "total_page", "total_item"], + type: "object", properties: { detail: { - title: 'Detail', + title: "Detail", anyOf: [ { - type: 'array', + type: "array", items: { - $ref: '#/components/schemas/nb_cli_plugin_webui__app__models__store__Plugin' - } + $ref: "#/components/schemas/nb_cli_plugin_webui__app__models__store__Plugin", + }, }, { - type: 'array', + type: "array", items: { - $ref: '#/components/schemas/Adapter' - } + $ref: "#/components/schemas/Adapter", + }, }, { - type: 'array', + type: "array", items: { - $ref: '#/components/schemas/Driver' - } - } - ] + $ref: "#/components/schemas/Driver", + }, + }, + ], }, now_page: { - title: 'Now Page', - type: 'integer' + title: "Now Page", + type: "integer", }, total_page: { - title: 'Total Page', - type: 'integer' + title: "Total Page", + type: "integer", }, total_item: { - title: 'Total Item', - type: 'integer' - } - } -} as const + title: "Total Item", + type: "integer", + }, + }, +} as const; export const ValidationErrorSchema = { - title: 'ValidationError', - required: ['loc', 'msg', 'type'], - type: 'object', + title: "ValidationError", + required: ["loc", "msg", "type"], + type: "object", properties: { loc: { - title: 'Location', - type: 'array', + title: "Location", + type: "array", items: { anyOf: [ { - type: 'string' + type: "string", }, { - type: 'integer' - } - ] - } + type: "integer", + }, + ], + }, }, msg: { - title: 'Message', - type: 'string' + title: "Message", + type: "string", }, type: { - title: 'Error Type', - type: 'string' - } - } -} as const + title: "Error Type", + type: "string", + }, + }, +} as const; export const VerifyRequestSchema = { - title: 'VerifyRequest', - required: ['jwt_token'], - type: 'object', + title: "VerifyRequest", + required: ["jwt_token"], + type: "object", properties: { jwt_token: { - title: 'Jwt Token', - type: 'string' - } - } -} as const + title: "Jwt Token", + type: "string", + }, + }, +} as const; export const nb_cli_plugin_webui__app__models__base__ModuleInfoSchema = { - title: 'ModuleInfo', - type: 'object', + title: "ModuleInfo", + type: "object", properties: { module_name: { - title: 'Module Name', - type: 'string', - default: 'unknown' + title: "Module Name", + type: "string", + default: "unknown", }, project_link: { - title: 'Project Link', - type: 'string', - default: 'unknown' + title: "Project Link", + type: "string", + default: "unknown", }, name: { - title: 'Name', - type: 'string', - default: 'unknown' + title: "Name", + type: "string", + default: "unknown", }, desc: { - title: 'Desc', - type: 'string', - default: 'unknown' + title: "Desc", + type: "string", + default: "unknown", }, author: { - title: 'Author', - type: 'string', - default: 'unknown' + title: "Author", + type: "string", + default: "unknown", }, homepage: { - title: 'Homepage', - type: 'string', - default: 'unknown' + title: "Homepage", + type: "string", + default: "unknown", }, usage: { - title: 'Usage', - type: 'string', - default: 'unknown' + title: "Usage", + type: "string", + default: "unknown", }, extra: { - title: 'Extra', - type: 'object' + title: "Extra", + type: "object", }, tags: { - title: 'Tags', - type: 'array', + title: "Tags", + type: "array", items: { - $ref: '#/components/schemas/ModuleTag' - } + $ref: "#/components/schemas/ModuleTag", + }, }, is_official: { - title: 'Is Official', - type: 'boolean', - default: false + title: "Is Official", + type: "boolean", + default: false, }, version: { - title: 'Version', - type: 'string', - default: '0.0.0' + title: "Version", + type: "string", + default: "0.0.0", }, is_download: { - title: 'Is Download', - type: 'boolean', - default: false - } - } -} as const + title: "Is Download", + type: "boolean", + default: false, + }, + }, +} as const; export const nb_cli_plugin_webui__app__models__base__PluginSchema = { - title: 'Plugin', - type: 'object', + title: "Plugin", + type: "object", properties: { module_name: { - title: 'Module Name', - type: 'string', - default: 'unknown' + title: "Module Name", + type: "string", + default: "unknown", }, project_link: { - title: 'Project Link', - type: 'string', - default: 'unknown' + title: "Project Link", + type: "string", + default: "unknown", }, name: { - title: 'Name', - type: 'string', - default: 'unknown' + title: "Name", + type: "string", + default: "unknown", }, desc: { - title: 'Desc', - type: 'string', - default: 'unknown' + title: "Desc", + type: "string", + default: "unknown", }, author: { - title: 'Author', - type: 'string', - default: 'unknown' + title: "Author", + type: "string", + default: "unknown", }, homepage: { - title: 'Homepage', - type: 'string', - default: 'unknown' + title: "Homepage", + type: "string", + default: "unknown", }, usage: { - title: 'Usage', - type: 'string', - default: 'unknown' + title: "Usage", + type: "string", + default: "unknown", }, extra: { - title: 'Extra', - type: 'object' + title: "Extra", + type: "object", }, tags: { - title: 'Tags', - type: 'array', + title: "Tags", + type: "array", items: { - $ref: '#/components/schemas/ModuleTag' - } + $ref: "#/components/schemas/ModuleTag", + }, }, is_official: { - title: 'Is Official', - type: 'boolean', - default: false + title: "Is Official", + type: "boolean", + default: false, }, version: { - title: 'Version', - type: 'string', - default: '0.0.0' + title: "Version", + type: "string", + default: "0.0.0", }, is_download: { - title: 'Is Download', - type: 'boolean', - default: false + title: "Is Download", + type: "boolean", + default: false, }, config: { - title: 'Config', - type: 'object', - default: {} - } - } -} as const + title: "Config", + type: "object", + default: {}, + }, + }, +} as const; export const nb_cli_plugin_webui__app__models__store__ModuleInfoSchema = { - title: 'ModuleInfo', - type: 'object', + title: "ModuleInfo", + type: "object", properties: { module_name: { - title: 'Module Name', - type: 'string', - default: 'unknown' + title: "Module Name", + type: "string", + default: "unknown", }, project_link: { - title: 'Project Link', - type: 'string', - default: 'unknown' + title: "Project Link", + type: "string", + default: "unknown", }, name: { - title: 'Name', - type: 'string', - default: 'unknown' + title: "Name", + type: "string", + default: "unknown", }, desc: { - title: 'Desc', - type: 'string', - default: 'unknown' + title: "Desc", + type: "string", + default: "unknown", }, author: { - title: 'Author', - type: 'string', - default: 'unknown' + title: "Author", + type: "string", + default: "unknown", }, homepage: { - title: 'Homepage', - type: 'string', - default: 'unknown' + title: "Homepage", + type: "string", + default: "unknown", }, usage: { - title: 'Usage', - type: 'string', - default: 'unknown' + title: "Usage", + type: "string", + default: "unknown", }, extra: { - title: 'Extra', - type: 'object' + title: "Extra", + type: "object", }, tags: { - title: 'Tags', - type: 'array', + title: "Tags", + type: "array", items: { - $ref: '#/components/schemas/ModuleTag' - } + $ref: "#/components/schemas/ModuleTag", + }, }, is_official: { - title: 'Is Official', - type: 'boolean', - default: false + title: "Is Official", + type: "boolean", + default: false, }, version: { - title: 'Version', - type: 'string', - default: '0.0.0' + title: "Version", + type: "string", + default: "0.0.0", }, is_download: { - title: 'Is Download', - type: 'boolean', - default: false + title: "Is Download", + type: "boolean", + default: false, }, module_type: { - title: 'Module Type', - enum: ['module'], - type: 'string', - default: 'module' - } - } -} as const + title: "Module Type", + enum: ["module"], + type: "string", + default: "module", + }, + }, +} as const; export const nb_cli_plugin_webui__app__models__store__PluginSchema = { - title: 'Plugin', - required: ['version', 'valid', 'time', 'skip_test'], - type: 'object', + title: "Plugin", + required: ["version", "valid", "time", "skip_test"], + type: "object", properties: { module_name: { - title: 'Module Name', - type: 'string', - default: 'unknown' + title: "Module Name", + type: "string", + default: "unknown", }, project_link: { - title: 'Project Link', - type: 'string', - default: 'unknown' + title: "Project Link", + type: "string", + default: "unknown", }, name: { - title: 'Name', - type: 'string', - default: 'unknown' + title: "Name", + type: "string", + default: "unknown", }, desc: { - title: 'Desc', - type: 'string', - default: 'unknown' + title: "Desc", + type: "string", + default: "unknown", }, author: { - title: 'Author', - type: 'string', - default: 'unknown' + title: "Author", + type: "string", + default: "unknown", }, homepage: { - title: 'Homepage', - type: 'string', - default: 'unknown' + title: "Homepage", + type: "string", + default: "unknown", }, usage: { - title: 'Usage', - type: 'string', - default: 'unknown' + title: "Usage", + type: "string", + default: "unknown", }, extra: { - title: 'Extra', - type: 'object' + title: "Extra", + type: "object", }, tags: { - title: 'Tags', - type: 'array', + title: "Tags", + type: "array", items: { - $ref: '#/components/schemas/ModuleTag' - } + $ref: "#/components/schemas/ModuleTag", + }, }, is_official: { - title: 'Is Official', - type: 'boolean', - default: false + title: "Is Official", + type: "boolean", + default: false, }, version: { - title: 'Version', - type: 'string' + title: "Version", + type: "string", }, is_download: { - title: 'Is Download', - type: 'boolean', - default: false + title: "Is Download", + type: "boolean", + default: false, }, config: { - title: 'Config', - type: 'object', - default: {} + title: "Config", + type: "object", + default: {}, }, type: { - $ref: '#/components/schemas/PluginType' + $ref: "#/components/schemas/PluginType", }, supported_adapters: { - title: 'Supported Adapters', - type: 'array', + title: "Supported Adapters", + type: "array", items: { - type: 'string' - } + type: "string", + }, }, valid: { - title: 'Valid', - type: 'boolean' + title: "Valid", + type: "boolean", }, time: { - title: 'Time', - type: 'string' + title: "Time", + type: "string", }, skip_test: { - title: 'Skip Test', - type: 'boolean' + title: "Skip Test", + type: "boolean", }, module_type: { - title: 'Module Type', - enum: ['plugin'], - type: 'string', - default: 'plugin' - } + title: "Module Type", + enum: ["plugin"], + type: "string", + default: "plugin", + }, }, description: `结构参考: -- https://github.com/nonebot/noneflow/blob/main/src/utils/store_test/models.py#L14` -} as const +- https://github.com/nonebot/noneflow/blob/main/src/utils/store_test/models.py#L14`, +} as const; export const nb_cli_plugin_webui__app__models__store__SearchTagSchema = { - title: 'SearchTag', - required: ['label'], - type: 'object', + title: "SearchTag", + required: ["label"], + type: "object", properties: { label: { - $ref: '#/components/schemas/nb_cli_plugin_webui__app__models__types__SearchTag' + $ref: "#/components/schemas/nb_cli_plugin_webui__app__models__types__SearchTag", }, text: { - title: 'Text', - type: 'string', - default: '' - } - } -} as const + title: "Text", + type: "string", + default: "", + }, + }, +} as const; export const nb_cli_plugin_webui__app__models__types__SearchTagSchema = { - title: 'SearchTag', - enum: ['official', 'valid', 'latest', 'downloaded', 'author', 'tag'], - type: 'string', - description: 'An enumeration.' -} as const + title: "SearchTag", + enum: ["official", "valid", "latest", "downloaded", "author", "tag"], + type: "string", + description: "An enumeration.", +} as const; diff --git a/frontend/src/client/api/services.gen.ts b/frontend/src/client/api/services.gen.ts index 3292094..c1f1095 100644 --- a/frontend/src/client/api/services.gen.ts +++ b/frontend/src/client/api/services.gen.ts @@ -1,6 +1,6 @@ // This file is auto-generated by @hey-api/openapi-ts -import { createClient, createConfig, type Options } from '@hey-api/client-fetch' +import { createClient, createConfig, type Options } from "@hey-api/client-fetch"; import type { AuthTokenV1AuthLoginPostData, AuthTokenV1AuthLoginPostError, @@ -96,10 +96,10 @@ import type { GetAdaptersV1ProjectAdaptersGetResponse, GetDriversV1ProjectDriversGetData, GetDriversV1ProjectDriversGetError, - GetDriversV1ProjectDriversGetResponse -} from './types.gen' + GetDriversV1ProjectDriversGetResponse, +} from "./types.gen"; -export const client = createClient(createConfig()) +export const client = createClient(createConfig()); export class AuthService { /** @@ -107,7 +107,7 @@ export class AuthService { * - 登录, 成功后返回 JWT 密钥 */ public static authTokenV1AuthLoginPost( - options: Options + options: Options, ) { return (options?.client ?? client).post< AuthTokenV1AuthLoginPostResponse, @@ -115,8 +115,8 @@ export class AuthService { ThrowOnError >({ ...options, - url: '/v1/auth/login' - }) + url: "/v1/auth/login", + }); } /** @@ -124,7 +124,7 @@ export class AuthService { * - 验证 JWT 密钥是否可用, 返回到期时间戳 */ public static verifyTokenV1AuthVerifyPost( - options: Options + options: Options, ) { return (options?.client ?? client).post< VerifyTokenV1AuthVerifyPostResponse, @@ -132,8 +132,8 @@ export class AuthService { ThrowOnError >({ ...options, - url: '/v1/auth/verify' - }) + url: "/v1/auth/verify", + }); } } @@ -143,7 +143,7 @@ export class FileService { * - 根据提供的路径, 基于 base_dir 返回文件列表 */ public static getFileListV1FileListGet( - options: Options + options: Options, ) { return (options?.client ?? client).get< GetFileListV1FileListGetResponse, @@ -151,8 +151,8 @@ export class FileService { ThrowOnError >({ ...options, - url: '/v1/file/list' - }) + url: "/v1/file/list", + }); } /** @@ -160,7 +160,7 @@ export class FileService { * - 根据提供的路径, 基于 base_dir 创建文件 */ public static createFileV1FileCreatePost( - options: Options + options: Options, ) { return (options?.client ?? client).post< CreateFileV1FileCreatePostResponse, @@ -168,8 +168,8 @@ export class FileService { ThrowOnError >({ ...options, - url: '/v1/file/create' - }) + url: "/v1/file/create", + }); } /** @@ -177,7 +177,7 @@ export class FileService { * - 根据提供的路径, 基于 base_dir 删除文件 */ public static deleteFileV1FileDeleteDelete( - options: Options + options: Options, ) { return (options?.client ?? client).delete< DeleteFileV1FileDeleteDeleteResponse, @@ -185,8 +185,8 @@ export class FileService { ThrowOnError >({ ...options, - url: '/v1/file/delete' - }) + url: "/v1/file/delete", + }); } } @@ -195,17 +195,17 @@ export class StoreService { * Install Nonebot Module * - 安装模块至 NoneBot 实例 */ - public static installNonebotModuleV1StoreNonebotInstallPost( - options: Options - ) { + public static installNonebotModuleV1StoreNonebotInstallPost< + ThrowOnError extends boolean = false, + >(options: Options) { return (options?.client ?? client).post< InstallNonebotModuleV1StoreNonebotInstallPostResponse, InstallNonebotModuleV1StoreNonebotInstallPostError, ThrowOnError >({ ...options, - url: '/v1/store/nonebot/install' - }) + url: "/v1/store/nonebot/install", + }); } /** @@ -213,33 +213,35 @@ export class StoreService { * - 卸载 NoneBot 实例中的模块 */ public static uninstallNonebotModuleV1StoreNonebotUninstallPost< - ThrowOnError extends boolean = false - >(options: Options) { + ThrowOnError extends boolean = false, + >( + options: Options, + ) { return (options?.client ?? client).post< UninstallNonebotModuleV1StoreNonebotUninstallPostResponse, UninstallNonebotModuleV1StoreNonebotUninstallPostError, ThrowOnError >({ ...options, - url: '/v1/store/nonebot/uninstall' - }) + url: "/v1/store/nonebot/uninstall", + }); } /** * Get Nonebot Store Items * - 获取 NoneBot Store 中的模块列表 */ - public static getNonebotStoreItemsV1StoreNonebotListGet( - options: Options - ) { + public static getNonebotStoreItemsV1StoreNonebotListGet< + ThrowOnError extends boolean = false, + >(options: Options) { return (options?.client ?? client).get< GetNonebotStoreItemsV1StoreNonebotListGetResponse, GetNonebotStoreItemsV1StoreNonebotListGetError, ThrowOnError >({ ...options, - url: '/v1/store/nonebot/list' - }) + url: "/v1/store/nonebot/list", + }); } /** @@ -247,7 +249,7 @@ export class StoreService { * - 搜索 NoneBot Store 中的模块 */ public static searchNonebotStoreItemV1StoreNonebotSearchPost< - ThrowOnError extends boolean = false + ThrowOnError extends boolean = false, >(options: Options) { return (options?.client ?? client).post< SearchNonebotStoreItemV1StoreNonebotSearchPostResponse, @@ -255,8 +257,8 @@ export class StoreService { ThrowOnError >({ ...options, - url: '/v1/store/nonebot/search' - }) + url: "/v1/store/nonebot/search", + }); } } @@ -266,7 +268,7 @@ export class ProcessService { * - 运行 NoneBot 实例 */ public static runProcessV1ProcessRunPost( - options: Options + options: Options, ) { return (options?.client ?? client).post< RunProcessV1ProcessRunPostResponse, @@ -274,8 +276,8 @@ export class ProcessService { ThrowOnError >({ ...options, - url: '/v1/process/run' - }) + url: "/v1/process/run", + }); } /** @@ -283,7 +285,7 @@ export class ProcessService { * - 终止 NoneBot 实例 */ public static stopProcessV1ProcessStopPost( - options: Options + options: Options, ) { return (options?.client ?? client).post< StopProcessV1ProcessStopPostResponse, @@ -291,8 +293,8 @@ export class ProcessService { ThrowOnError >({ ...options, - url: '/v1/process/stop' - }) + url: "/v1/process/stop", + }); } /** @@ -300,7 +302,7 @@ export class ProcessService { * - 向 NoneBot 实例进程写入数据 */ public static writeToProcessV1ProcessWritePost( - options: Options + options: Options, ) { return (options?.client ?? client).post< WriteToProcessV1ProcessWritePostResponse, @@ -308,8 +310,8 @@ export class ProcessService { ThrowOnError >({ ...options, - url: '/v1/process/write' - }) + url: "/v1/process/write", + }); } /** @@ -317,7 +319,7 @@ export class ProcessService { * - 获取历史进程日志 */ public static getLogHistoryV1ProcessLogHistoryGet( - options: Options + options: Options, ) { return (options?.client ?? client).get< GetLogHistoryV1ProcessLogHistoryGetResponse, @@ -325,8 +327,8 @@ export class ProcessService { ThrowOnError >({ ...options, - url: '/v1/process/log/history' - }) + url: "/v1/process/log/history", + }); } } @@ -335,34 +337,34 @@ export class ProjectService { * Get Project Env List * - 获取 NoneBot 实例中的环境文件列表 */ - public static getProjectEnvListV1ProjectConfigEnvListGet( - options: Options - ) { + public static getProjectEnvListV1ProjectConfigEnvListGet< + ThrowOnError extends boolean = false, + >(options: Options) { return (options?.client ?? client).get< GetProjectEnvListV1ProjectConfigEnvListGetResponse, GetProjectEnvListV1ProjectConfigEnvListGetError, ThrowOnError >({ ...options, - url: '/v1/project/config/env/list' - }) + url: "/v1/project/config/env/list", + }); } /** * Create Project Env * - 创建 NoneBot 实例中的环境文件 */ - public static createProjectEnvV1ProjectConfigEnvCreatePost( - options: Options - ) { + public static createProjectEnvV1ProjectConfigEnvCreatePost< + ThrowOnError extends boolean = false, + >(options: Options) { return (options?.client ?? client).post< CreateProjectEnvV1ProjectConfigEnvCreatePostResponse, CreateProjectEnvV1ProjectConfigEnvCreatePostError, ThrowOnError >({ ...options, - url: '/v1/project/config/env/create' - }) + url: "/v1/project/config/env/create", + }); } /** @@ -370,7 +372,7 @@ export class ProjectService { * - 删除 NoneBot 实例中的环境文件 */ public static deleteProjectEnvV1ProjectConfigEnvDeleteDelete< - ThrowOnError extends boolean = false + ThrowOnError extends boolean = false, >(options: Options) { return (options?.client ?? client).delete< DeleteProjectEnvV1ProjectConfigEnvDeleteDeleteResponse, @@ -378,25 +380,25 @@ export class ProjectService { ThrowOnError >({ ...options, - url: '/v1/project/config/env/delete' - }) + url: "/v1/project/config/env/delete", + }); } /** * Use Project Env * - 切换 NoneBot 实例所应用的环境文件 */ - public static useProjectEnvV1ProjectConfigEnvUsePost( - options: Options - ) { + public static useProjectEnvV1ProjectConfigEnvUsePost< + ThrowOnError extends boolean = false, + >(options: Options) { return (options?.client ?? client).post< UseProjectEnvV1ProjectConfigEnvUsePostResponse, UseProjectEnvV1ProjectConfigEnvUsePostError, ThrowOnError >({ ...options, - url: '/v1/project/config/env/use' - }) + url: "/v1/project/config/env/use", + }); } /** @@ -404,16 +406,18 @@ export class ProjectService { * - 获取 NoneBot 实例在 .toml 中的配置信息 */ public static getProjectMetaConfigV1ProjectConfigMetaDetailGet< - ThrowOnError extends boolean = false - >(options: Options) { + ThrowOnError extends boolean = false, + >( + options: Options, + ) { return (options?.client ?? client).get< GetProjectMetaConfigV1ProjectConfigMetaDetailGetResponse, GetProjectMetaConfigV1ProjectConfigMetaDetailGetError, ThrowOnError >({ ...options, - url: '/v1/project/config/meta/detail' - }) + url: "/v1/project/config/meta/detail", + }); } /** @@ -421,16 +425,21 @@ export class ProjectService { * - 获取 NoneBot 实例配置信息 */ public static getProjectNonebotConfigV1ProjectConfigNonebotDetailGet< - ThrowOnError extends boolean = false - >(options: Options) { + ThrowOnError extends boolean = false, + >( + options: Options< + GetProjectNonebotConfigV1ProjectConfigNonebotDetailGetData, + ThrowOnError + >, + ) { return (options?.client ?? client).get< GetProjectNonebotConfigV1ProjectConfigNonebotDetailGetResponse, GetProjectNonebotConfigV1ProjectConfigNonebotDetailGetError, ThrowOnError >({ ...options, - url: '/v1/project/config/nonebot/detail' - }) + url: "/v1/project/config/nonebot/detail", + }); } /** @@ -438,12 +447,12 @@ export class ProjectService { * - 获取 NoneBot 实例中所有 NoneBot 插件设置信息 */ public static getProjectNonebotPluginConfigV1ProjectConfigNonebotPluginDetailGet< - ThrowOnError extends boolean = false + ThrowOnError extends boolean = false, >( options: Options< GetProjectNonebotPluginConfigV1ProjectConfigNonebotPluginDetailGetData, ThrowOnError - > + >, ) { return (options?.client ?? client).get< GetProjectNonebotPluginConfigV1ProjectConfigNonebotPluginDetailGetResponse, @@ -451,8 +460,8 @@ export class ProjectService { ThrowOnError >({ ...options, - url: '/v1/project/config/nonebot/plugin/detail' - }) + url: "/v1/project/config/nonebot/plugin/detail", + }); } /** @@ -461,51 +470,51 @@ export class ProjectService { * - 说明: * * `module_type` 仅作 WebUI 更新自身存储的实例信息,不会影响实例本体 */ - public static updateProjectConfigV1ProjectConfigUpdatePost( - options: Options - ) { + public static updateProjectConfigV1ProjectConfigUpdatePost< + ThrowOnError extends boolean = false, + >(options: Options) { return (options?.client ?? client).post< UpdateProjectConfigV1ProjectConfigUpdatePostResponse, UpdateProjectConfigV1ProjectConfigUpdatePostError, ThrowOnError >({ ...options, - url: '/v1/project/config/update' - }) + url: "/v1/project/config/update", + }); } /** * Get Dotenv File * - 获取环境文件内容 */ - public static getDotenvFileV1ProjectConfigDotenvGet( - options: Options - ) { + public static getDotenvFileV1ProjectConfigDotenvGet< + ThrowOnError extends boolean = false, + >(options: Options) { return (options?.client ?? client).get< GetDotenvFileV1ProjectConfigDotenvGetResponse, GetDotenvFileV1ProjectConfigDotenvGetError, ThrowOnError >({ ...options, - url: '/v1/project/config/dotenv' - }) + url: "/v1/project/config/dotenv", + }); } /** * Update Dotenv File * - 更新环境文件内容 */ - public static updateDotenvFileV1ProjectConfigDotenvPut( - options: Options - ) { + public static updateDotenvFileV1ProjectConfigDotenvPut< + ThrowOnError extends boolean = false, + >(options: Options) { return (options?.client ?? client).put< UpdateDotenvFileV1ProjectConfigDotenvPutResponse, UpdateDotenvFileV1ProjectConfigDotenvPutError, ThrowOnError >({ ...options, - url: '/v1/project/config/dotenv' - }) + url: "/v1/project/config/dotenv", + }); } /** @@ -514,7 +523,7 @@ export class ProjectService { * - 返回对应的日志密钥, 用于日志展现 */ public static createProjectV1ProjectCreatePost( - options: Options + options: Options, ) { return (options?.client ?? client).post< CreateProjectV1ProjectCreatePostResponse, @@ -522,8 +531,8 @@ export class ProjectService { ThrowOnError >({ ...options, - url: '/v1/project/create' - }) + url: "/v1/project/create", + }); } /** @@ -532,7 +541,7 @@ export class ProjectService { * - 返回对应的日志密钥, 用于日志展现 */ public static addProjectV1ProjectAddPost( - options: Options + options: Options, ) { return (options?.client ?? client).post< AddProjectV1ProjectAddPostResponse, @@ -540,25 +549,25 @@ export class ProjectService { ThrowOnError >({ ...options, - url: '/v1/project/add' - }) + url: "/v1/project/add", + }); } /** * Get Project Profile * - 获取 NoneBot 实例的配置信息 */ - public static getProjectProfileV1ProjectProfileGet( - options: Options - ) { + public static getProjectProfileV1ProjectProfileGet< + ThrowOnError extends boolean = false, + >(options: Options) { return (options?.client ?? client).get< GetProjectProfileV1ProjectProfileGetResponse, GetProjectProfileV1ProjectProfileGetError, ThrowOnError >({ ...options, - url: '/v1/project/profile' - }) + url: "/v1/project/profile", + }); } /** @@ -566,7 +575,7 @@ export class ProjectService { * - 删除 NoneBot 实例 */ public static deleteProjectV1ProjectDeleteDelete( - options: Options + options: Options, ) { return (options?.client ?? client).delete< DeleteProjectV1ProjectDeleteDeleteResponse, @@ -574,8 +583,8 @@ export class ProjectService { ThrowOnError >({ ...options, - url: '/v1/project/delete' - }) + url: "/v1/project/delete", + }); } /** @@ -583,7 +592,7 @@ export class ProjectService { * - 获取所有 NoneBot 实例基本信息 */ public static listProjectV1ProjectListGet( - options?: Options + options?: Options, ) { return (options?.client ?? client).get< ListProjectV1ProjectListGetResponse, @@ -591,25 +600,25 @@ export class ProjectService { ThrowOnError >({ ...options, - url: '/v1/project/list' - }) + url: "/v1/project/list", + }); } /** * Check Project Toml * - 检查 NoneBot 实例的 toml 文件并从中获取所需信息 */ - public static checkProjectTomlV1ProjectCheckTomlPost( - options: Options - ) { + public static checkProjectTomlV1ProjectCheckTomlPost< + ThrowOnError extends boolean = false, + >(options: Options) { return (options?.client ?? client).post< CheckProjectTomlV1ProjectCheckTomlPostResponse, CheckProjectTomlV1ProjectCheckTomlPostError, ThrowOnError >({ ...options, - url: '/v1/project/check_toml' - }) + url: "/v1/project/check_toml", + }); } /** @@ -617,7 +626,7 @@ export class ProjectService { * - 获取实例的插件列表 */ public static getPluginsV1ProjectPluginsGet( - options: Options + options: Options, ) { return (options?.client ?? client).get< GetPluginsV1ProjectPluginsGetResponse, @@ -625,8 +634,8 @@ export class ProjectService { ThrowOnError >({ ...options, - url: '/v1/project/plugins' - }) + url: "/v1/project/plugins", + }); } /** @@ -634,7 +643,7 @@ export class ProjectService { * - 获取实例的适配器列表 */ public static getAdaptersV1ProjectAdaptersGet( - options: Options + options: Options, ) { return (options?.client ?? client).get< GetAdaptersV1ProjectAdaptersGetResponse, @@ -642,8 +651,8 @@ export class ProjectService { ThrowOnError >({ ...options, - url: '/v1/project/adapters' - }) + url: "/v1/project/adapters", + }); } /** @@ -651,7 +660,7 @@ export class ProjectService { * - 获取实例的驱动器列表 */ public static getDriversV1ProjectDriversGet( - options: Options + options: Options, ) { return (options?.client ?? client).get< GetDriversV1ProjectDriversGetResponse, @@ -659,7 +668,7 @@ export class ProjectService { ThrowOnError >({ ...options, - url: '/v1/project/drivers' - }) + url: "/v1/project/drivers", + }); } } diff --git a/frontend/src/client/api/types.gen.ts b/frontend/src/client/api/types.gen.ts index de836a2..c7d534a 100644 --- a/frontend/src/client/api/types.gen.ts +++ b/frontend/src/client/api/types.gen.ts @@ -1,682 +1,693 @@ // This file is auto-generated by @hey-api/openapi-ts export type Adapter = { - module_name?: string - project_link?: string - name?: string - desc?: string - author?: string - homepage?: string - usage?: string + module_name?: string; + project_link?: string; + name?: string; + desc?: string; + author?: string; + homepage?: string; + usage?: string; extra?: { - [key: string]: unknown - } - tags?: Array - is_official?: boolean - version?: string - is_download?: boolean -} + [key: string]: unknown; + }; + tags?: Array; + is_official?: boolean; + version?: string; + is_download?: boolean; +}; export type AddProjectData = { - project_name: string - project_dir: string - mirror_url: string - adapters?: Array - plugins?: Array - plugin_dirs?: Array - builtin_plugins?: Array -} + project_name: string; + project_dir: string; + mirror_url: string; + adapters?: Array; + plugins?: Array; + plugin_dirs?: Array; + builtin_plugins?: Array; +}; export type Body_search_nonebot_store_item_v1_store_nonebot_search_post = { - data: SearchRequest -} + data: SearchRequest; +}; /** * An enumeration. */ -export type ConfigType = 'project' | 'toml' +export type ConfigType = "project" | "toml"; export type CreateProjectData = { - is_bootstrap: boolean - project_name: string - project_dir: string - mirror_url: string - drivers: Array - adapters: Array - use_src: boolean -} + is_bootstrap: boolean; + project_name: string; + project_dir: string; + mirror_url: string; + drivers: Array; + adapters: Array; + use_src: boolean; +}; export type Driver = { - module_name?: string - project_link?: string - name?: string - desc?: string - author?: string - homepage?: string - usage?: string + module_name?: string; + project_link?: string; + name?: string; + desc?: string; + author?: string; + homepage?: string; + usage?: string; extra?: { - [key: string]: unknown - } - tags?: Array - is_official?: boolean - version?: string - is_download?: boolean -} + [key: string]: unknown; + }; + tags?: Array; + is_official?: boolean; + version?: string; + is_download?: boolean; +}; export type FileInfo = { - name: string - is_dir: boolean - path: string - modified_time: string - absolute_path: string -} + name: string; + is_dir: boolean; + path: string; + modified_time: string; + absolute_path: string; +}; export type FileResponse = { - detail: Array -} + detail: Array; +}; -export type GenericResponse_List_nb_cli_plugin_webui_app_handlers_process_schemas_ProcessLog__ = { - detail: Array -} +export type GenericResponse_List_nb_cli_plugin_webui_app_handlers_process_schemas_ProcessLog__ = + { + detail: Array; + }; export type GenericResponse_List_nb_cli_plugin_webui_app_models_base_ModuleInfo__ = { - detail: Array -} + detail: Array; +}; export type GenericResponse_List_nb_cli_plugin_webui_app_models_base_Plugin__ = { - detail: Array -} + detail: Array; +}; export type GenericResponse_List_str__ = { - detail: Array -} + detail: Array; +}; export type GenericResponse_NoneBotProjectMeta_ = { - detail: NoneBotProjectMeta -} + detail: NoneBotProjectMeta; +}; export type GenericResponse_ProjectTomlDetail_ = { - detail: ProjectTomlDetail -} + detail: ProjectTomlDetail; +}; export type GenericResponse_int_ = { - detail: number -} + detail: number; +}; export type GenericResponse_str_ = { - detail: string -} + detail: string; +}; export type HTTPValidationError = { - detail?: Array -} + detail?: Array; +}; export type Item = { - enum?: Array - type: string -} + enum?: Array; + type: string; +}; export type ListProjectResponse = { detail: { - [key: string]: NoneBotProjectMeta - } -} + [key: string]: NoneBotProjectMeta; + }; +}; /** * An enumeration. */ -export type LogLevel = 'STDOUT' | 'INFO' | 'WARNING' | 'ERROR' | 'DEBUG' +export type LogLevel = "STDOUT" | "INFO" | "WARNING" | "ERROR" | "DEBUG"; export type LoginRequest = { - token: string - mark: string -} + token: string; + mark: string; +}; export type ModuleConfigChild = { - title: string - description?: string - name: string - default?: unknown - conf_type: string - enum?: Array - configured?: unknown - items?: Item - unique_items: boolean - is_secret: boolean - latest_change?: string -} + title: string; + description?: string; + name: string; + default?: unknown; + conf_type: string; + enum?: Array; + configured?: unknown; + items?: Item; + unique_items: boolean; + is_secret: boolean; + latest_change?: string; +}; export type ModuleConfigFather = { - title: string - description?: string - name: string - module_type: ModuleType | ConfigType - properties: Array -} + title: string; + description?: string; + name: string; + module_type: ModuleType | ConfigType; + properties: Array; +}; export type ModuleConfigResponse = { - detail: Array -} + detail: Array; +}; export type ModuleConfigUpdateRequest = { - env: string - conf_type: string - k: string - v?: unknown -} + env: string; + conf_type: string; + k: string; + v?: unknown; +}; export type ModuleTag = { - label: string - color: string -} + label: string; + color: string; +}; /** * An enumeration. */ -export type ModuleType = 'module' | 'plugin' | 'adapter' | 'driver' +export type ModuleType = "module" | "plugin" | "adapter" | "driver"; export type NoneBotProjectMeta = { - project_id: string - project_name: string - project_dir: string - mirror_url: string - adapters: Array - drivers: Array - plugins: Array - plugin_dirs: Array - builtin_plugins: Array - is_running?: boolean - use_env?: string - use_run_script?: boolean - run_script_name?: string -} + project_id: string; + project_name: string; + project_dir: string; + mirror_url: string; + adapters: Array; + drivers: Array; + plugins: Array; + plugin_dirs: Array; + builtin_plugins: Array; + is_running?: boolean; + use_env?: string; + use_run_script?: boolean; + run_script_name?: string; +}; /** * 类型参考: * - https://github.com/nonebot/noneflow/blob/main/src/utils/validation/constants.py#L17 */ -export type PluginType = 'application' | 'library' +export type PluginType = "application" | "library"; export type ProcessLog = { - time?: string - level?: LogLevel - message: string -} + time?: string; + level?: LogLevel; + message: string; +}; export type ProjectTomlDetail = { - project_name: string + project_name: string; adapters: Array<{ - [key: string]: string - }> - plugins: Array - plugin_dirs: Array - builtin_plugins: Array -} + [key: string]: string; + }>; + plugins: Array; + plugin_dirs: Array; + builtin_plugins: Array; +}; export type SearchRequest = { - module_type: ModuleType - tags?: Array - content: string -} + module_type: ModuleType; + tags?: Array; + content: string; +}; export type SimpleModel = { - name: string - is_dir: boolean - path: string -} + name: string; + is_dir: boolean; + path: string; +}; export type StoreListResponse = { - detail: Array | Array | Array - now_page: number - total_page: number - total_item: number -} + detail: + | Array + | Array + | Array; + now_page: number; + total_page: number; + total_item: number; +}; export type ValidationError = { - loc: Array - msg: string - type: string -} + loc: Array; + msg: string; + type: string; +}; export type VerifyRequest = { - jwt_token: string -} + jwt_token: string; +}; export type nb_cli_plugin_webui__app__models__base__ModuleInfo = { - module_name?: string - project_link?: string - name?: string - desc?: string - author?: string - homepage?: string - usage?: string + module_name?: string; + project_link?: string; + name?: string; + desc?: string; + author?: string; + homepage?: string; + usage?: string; extra?: { - [key: string]: unknown - } - tags?: Array - is_official?: boolean - version?: string - is_download?: boolean -} + [key: string]: unknown; + }; + tags?: Array; + is_official?: boolean; + version?: string; + is_download?: boolean; +}; export type nb_cli_plugin_webui__app__models__base__Plugin = { - module_name?: string - project_link?: string - name?: string - desc?: string - author?: string - homepage?: string - usage?: string + module_name?: string; + project_link?: string; + name?: string; + desc?: string; + author?: string; + homepage?: string; + usage?: string; extra?: { - [key: string]: unknown - } - tags?: Array - is_official?: boolean - version?: string - is_download?: boolean + [key: string]: unknown; + }; + tags?: Array; + is_official?: boolean; + version?: string; + is_download?: boolean; config?: { - [key: string]: unknown - } -} + [key: string]: unknown; + }; +}; export type nb_cli_plugin_webui__app__models__store__ModuleInfo = { - module_name?: string - project_link?: string - name?: string - desc?: string - author?: string - homepage?: string - usage?: string + module_name?: string; + project_link?: string; + name?: string; + desc?: string; + author?: string; + homepage?: string; + usage?: string; extra?: { - [key: string]: unknown - } - tags?: Array - is_official?: boolean - version?: string - is_download?: boolean - module_type?: 'module' -} + [key: string]: unknown; + }; + tags?: Array; + is_official?: boolean; + version?: string; + is_download?: boolean; + module_type?: "module"; +}; -export type module_type = 'module' +export type module_type = "module"; /** * 结构参考: * - https://github.com/nonebot/noneflow/blob/main/src/utils/store_test/models.py#L14 */ export type nb_cli_plugin_webui__app__models__store__Plugin = { - module_name?: string - project_link?: string - name?: string - desc?: string - author?: string - homepage?: string - usage?: string + module_name?: string; + project_link?: string; + name?: string; + desc?: string; + author?: string; + homepage?: string; + usage?: string; extra?: { - [key: string]: unknown - } - tags?: Array - is_official?: boolean - version: string - is_download?: boolean + [key: string]: unknown; + }; + tags?: Array; + is_official?: boolean; + version: string; + is_download?: boolean; config?: { - [key: string]: unknown - } - type?: PluginType - supported_adapters?: Array - valid: boolean - time: string - skip_test: boolean - module_type?: 'plugin' -} - -export type module_type2 = 'plugin' + [key: string]: unknown; + }; + type?: PluginType; + supported_adapters?: Array; + valid: boolean; + time: string; + skip_test: boolean; + module_type?: "plugin"; +}; + +export type module_type2 = "plugin"; export type nb_cli_plugin_webui__app__models__store__SearchTag = { - label: nb_cli_plugin_webui__app__models__types__SearchTag - text?: string -} + label: nb_cli_plugin_webui__app__models__types__SearchTag; + text?: string; +}; /** * An enumeration. */ export type nb_cli_plugin_webui__app__models__types__SearchTag = - | 'official' - | 'valid' - | 'latest' - | 'downloaded' - | 'author' - | 'tag' + | "official" + | "valid" + | "latest" + | "downloaded" + | "author" + | "tag"; export type AuthTokenV1AuthLoginPostData = { - body: LoginRequest -} + body: LoginRequest; +}; -export type AuthTokenV1AuthLoginPostResponse = GenericResponse_str_ +export type AuthTokenV1AuthLoginPostResponse = GenericResponse_str_; -export type AuthTokenV1AuthLoginPostError = HTTPValidationError +export type AuthTokenV1AuthLoginPostError = HTTPValidationError; export type VerifyTokenV1AuthVerifyPostData = { - body: VerifyRequest -} + body: VerifyRequest; +}; -export type VerifyTokenV1AuthVerifyPostResponse = GenericResponse_str_ +export type VerifyTokenV1AuthVerifyPostResponse = GenericResponse_str_; -export type VerifyTokenV1AuthVerifyPostError = HTTPValidationError +export type VerifyTokenV1AuthVerifyPostError = HTTPValidationError; export type GetFileListV1FileListGetData = { query: { - path: string - } -} + path: string; + }; +}; -export type GetFileListV1FileListGetResponse = FileResponse +export type GetFileListV1FileListGetResponse = FileResponse; -export type GetFileListV1FileListGetError = HTTPValidationError +export type GetFileListV1FileListGetError = HTTPValidationError; export type CreateFileV1FileCreatePostData = { - body: SimpleModel -} + body: SimpleModel; +}; -export type CreateFileV1FileCreatePostResponse = FileResponse +export type CreateFileV1FileCreatePostResponse = FileResponse; -export type CreateFileV1FileCreatePostError = HTTPValidationError +export type CreateFileV1FileCreatePostError = HTTPValidationError; export type DeleteFileV1FileDeleteDeleteData = { query: { - path: string - } -} + path: string; + }; +}; -export type DeleteFileV1FileDeleteDeleteResponse = FileResponse +export type DeleteFileV1FileDeleteDeleteResponse = FileResponse; -export type DeleteFileV1FileDeleteDeleteError = HTTPValidationError +export type DeleteFileV1FileDeleteDeleteError = HTTPValidationError; export type InstallNonebotModuleV1StoreNonebotInstallPostData = { body: | nb_cli_plugin_webui__app__models__store__ModuleInfo - | nb_cli_plugin_webui__app__models__store__Plugin + | nb_cli_plugin_webui__app__models__store__Plugin; query: { - env: string - project_id: string - } -} + env: string; + project_id: string; + }; +}; -export type InstallNonebotModuleV1StoreNonebotInstallPostResponse = GenericResponse_str_ +export type InstallNonebotModuleV1StoreNonebotInstallPostResponse = GenericResponse_str_; -export type InstallNonebotModuleV1StoreNonebotInstallPostError = HTTPValidationError +export type InstallNonebotModuleV1StoreNonebotInstallPostError = HTTPValidationError; export type UninstallNonebotModuleV1StoreNonebotUninstallPostData = { body: | nb_cli_plugin_webui__app__models__store__ModuleInfo - | nb_cli_plugin_webui__app__models__store__Plugin + | nb_cli_plugin_webui__app__models__store__Plugin; query: { - env: string - project_id: string - } -} + env: string; + project_id: string; + }; +}; -export type UninstallNonebotModuleV1StoreNonebotUninstallPostResponse = GenericResponse_str_ +export type UninstallNonebotModuleV1StoreNonebotUninstallPostResponse = + GenericResponse_str_; -export type UninstallNonebotModuleV1StoreNonebotUninstallPostError = HTTPValidationError +export type UninstallNonebotModuleV1StoreNonebotUninstallPostError = HTTPValidationError; export type GetNonebotStoreItemsV1StoreNonebotListGetData = { query: { - is_search?: boolean - module_type: ModuleType - page: number - project_id?: string - show_all?: boolean - } -} + is_search?: boolean; + module_type: ModuleType; + page: number; + project_id?: string; + show_all?: boolean; + }; +}; -export type GetNonebotStoreItemsV1StoreNonebotListGetResponse = StoreListResponse +export type GetNonebotStoreItemsV1StoreNonebotListGetResponse = StoreListResponse; -export type GetNonebotStoreItemsV1StoreNonebotListGetError = HTTPValidationError +export type GetNonebotStoreItemsV1StoreNonebotListGetError = HTTPValidationError; export type SearchNonebotStoreItemV1StoreNonebotSearchPostData = { - body: Body_search_nonebot_store_item_v1_store_nonebot_search_post + body: Body_search_nonebot_store_item_v1_store_nonebot_search_post; query: { - project_id: string - } -} + project_id: string; + }; +}; -export type SearchNonebotStoreItemV1StoreNonebotSearchPostResponse = StoreListResponse +export type SearchNonebotStoreItemV1StoreNonebotSearchPostResponse = StoreListResponse; -export type SearchNonebotStoreItemV1StoreNonebotSearchPostError = HTTPValidationError +export type SearchNonebotStoreItemV1StoreNonebotSearchPostError = HTTPValidationError; export type RunProcessV1ProcessRunPostData = { query: { - project_id: string - } -} + project_id: string; + }; +}; -export type RunProcessV1ProcessRunPostResponse = GenericResponse_str_ +export type RunProcessV1ProcessRunPostResponse = GenericResponse_str_; -export type RunProcessV1ProcessRunPostError = HTTPValidationError +export type RunProcessV1ProcessRunPostError = HTTPValidationError; export type StopProcessV1ProcessStopPostData = { query: { - project_id: string - } -} + project_id: string; + }; +}; -export type StopProcessV1ProcessStopPostResponse = GenericResponse_str_ +export type StopProcessV1ProcessStopPostResponse = GenericResponse_str_; -export type StopProcessV1ProcessStopPostError = HTTPValidationError +export type StopProcessV1ProcessStopPostError = HTTPValidationError; export type WriteToProcessV1ProcessWritePostData = { query: { - content: string - project_id: string - } -} + content: string; + project_id: string; + }; +}; -export type WriteToProcessV1ProcessWritePostResponse = GenericResponse_int_ +export type WriteToProcessV1ProcessWritePostResponse = GenericResponse_int_; -export type WriteToProcessV1ProcessWritePostError = HTTPValidationError +export type WriteToProcessV1ProcessWritePostError = HTTPValidationError; export type GetLogHistoryV1ProcessLogHistoryGetData = { query: { - log_count: number - log_id: string - } -} + log_count: number; + log_id: string; + }; +}; export type GetLogHistoryV1ProcessLogHistoryGetResponse = - GenericResponse_List_nb_cli_plugin_webui_app_handlers_process_schemas_ProcessLog__ + GenericResponse_List_nb_cli_plugin_webui_app_handlers_process_schemas_ProcessLog__; -export type GetLogHistoryV1ProcessLogHistoryGetError = HTTPValidationError +export type GetLogHistoryV1ProcessLogHistoryGetError = HTTPValidationError; export type GetProjectEnvListV1ProjectConfigEnvListGetData = { query: { - project_id: string - } -} + project_id: string; + }; +}; -export type GetProjectEnvListV1ProjectConfigEnvListGetResponse = GenericResponse_List_str__ +export type GetProjectEnvListV1ProjectConfigEnvListGetResponse = + GenericResponse_List_str__; -export type GetProjectEnvListV1ProjectConfigEnvListGetError = HTTPValidationError +export type GetProjectEnvListV1ProjectConfigEnvListGetError = HTTPValidationError; export type CreateProjectEnvV1ProjectConfigEnvCreatePostData = { query: { - env: string - project_id: string - } -} + env: string; + project_id: string; + }; +}; -export type CreateProjectEnvV1ProjectConfigEnvCreatePostResponse = GenericResponse_str_ +export type CreateProjectEnvV1ProjectConfigEnvCreatePostResponse = GenericResponse_str_; -export type CreateProjectEnvV1ProjectConfigEnvCreatePostError = HTTPValidationError +export type CreateProjectEnvV1ProjectConfigEnvCreatePostError = HTTPValidationError; export type DeleteProjectEnvV1ProjectConfigEnvDeleteDeleteData = { query: { - env: string - project_id: string - } -} + env: string; + project_id: string; + }; +}; -export type DeleteProjectEnvV1ProjectConfigEnvDeleteDeleteResponse = GenericResponse_str_ +export type DeleteProjectEnvV1ProjectConfigEnvDeleteDeleteResponse = GenericResponse_str_; -export type DeleteProjectEnvV1ProjectConfigEnvDeleteDeleteError = HTTPValidationError +export type DeleteProjectEnvV1ProjectConfigEnvDeleteDeleteError = HTTPValidationError; export type UseProjectEnvV1ProjectConfigEnvUsePostData = { query: { - env: string - project_id: string - } -} + env: string; + project_id: string; + }; +}; -export type UseProjectEnvV1ProjectConfigEnvUsePostResponse = GenericResponse_str_ +export type UseProjectEnvV1ProjectConfigEnvUsePostResponse = GenericResponse_str_; -export type UseProjectEnvV1ProjectConfigEnvUsePostError = HTTPValidationError +export type UseProjectEnvV1ProjectConfigEnvUsePostError = HTTPValidationError; export type GetProjectMetaConfigV1ProjectConfigMetaDetailGetData = { query: { - project_id: string - } -} + project_id: string; + }; +}; -export type GetProjectMetaConfigV1ProjectConfigMetaDetailGetResponse = ModuleConfigResponse +export type GetProjectMetaConfigV1ProjectConfigMetaDetailGetResponse = + ModuleConfigResponse; -export type GetProjectMetaConfigV1ProjectConfigMetaDetailGetError = HTTPValidationError +export type GetProjectMetaConfigV1ProjectConfigMetaDetailGetError = HTTPValidationError; export type GetProjectNonebotConfigV1ProjectConfigNonebotDetailGetData = { query: { - project_id: string - } -} + project_id: string; + }; +}; -export type GetProjectNonebotConfigV1ProjectConfigNonebotDetailGetResponse = ModuleConfigResponse +export type GetProjectNonebotConfigV1ProjectConfigNonebotDetailGetResponse = + ModuleConfigResponse; -export type GetProjectNonebotConfigV1ProjectConfigNonebotDetailGetError = HTTPValidationError +export type GetProjectNonebotConfigV1ProjectConfigNonebotDetailGetError = + HTTPValidationError; export type GetProjectNonebotPluginConfigV1ProjectConfigNonebotPluginDetailGetData = { query: { - project_id: string - } -} + project_id: string; + }; +}; export type GetProjectNonebotPluginConfigV1ProjectConfigNonebotPluginDetailGetResponse = - ModuleConfigResponse + ModuleConfigResponse; export type GetProjectNonebotPluginConfigV1ProjectConfigNonebotPluginDetailGetError = - HTTPValidationError + HTTPValidationError; export type UpdateProjectConfigV1ProjectConfigUpdatePostData = { - body: ModuleConfigUpdateRequest + body: ModuleConfigUpdateRequest; query: { - module_type: ModuleType | ConfigType - project_id: string - } -} + module_type: ModuleType | ConfigType; + project_id: string; + }; +}; -export type UpdateProjectConfigV1ProjectConfigUpdatePostResponse = GenericResponse_str_ +export type UpdateProjectConfigV1ProjectConfigUpdatePostResponse = GenericResponse_str_; -export type UpdateProjectConfigV1ProjectConfigUpdatePostError = HTTPValidationError +export type UpdateProjectConfigV1ProjectConfigUpdatePostError = HTTPValidationError; export type GetDotenvFileV1ProjectConfigDotenvGetData = { query: { - env: string - project_id: string - } -} + env: string; + project_id: string; + }; +}; -export type GetDotenvFileV1ProjectConfigDotenvGetResponse = GenericResponse_str_ +export type GetDotenvFileV1ProjectConfigDotenvGetResponse = GenericResponse_str_; -export type GetDotenvFileV1ProjectConfigDotenvGetError = HTTPValidationError +export type GetDotenvFileV1ProjectConfigDotenvGetError = HTTPValidationError; export type UpdateDotenvFileV1ProjectConfigDotenvPutData = { query: { - data: string - env: string - project_id: string - } -} + data: string; + env: string; + project_id: string; + }; +}; -export type UpdateDotenvFileV1ProjectConfigDotenvPutResponse = GenericResponse_str_ +export type UpdateDotenvFileV1ProjectConfigDotenvPutResponse = GenericResponse_str_; -export type UpdateDotenvFileV1ProjectConfigDotenvPutError = HTTPValidationError +export type UpdateDotenvFileV1ProjectConfigDotenvPutError = HTTPValidationError; export type CreateProjectV1ProjectCreatePostData = { - body: CreateProjectData -} + body: CreateProjectData; +}; -export type CreateProjectV1ProjectCreatePostResponse = GenericResponse_str_ +export type CreateProjectV1ProjectCreatePostResponse = GenericResponse_str_; -export type CreateProjectV1ProjectCreatePostError = HTTPValidationError +export type CreateProjectV1ProjectCreatePostError = HTTPValidationError; export type AddProjectV1ProjectAddPostData = { - body: AddProjectData -} + body: AddProjectData; +}; -export type AddProjectV1ProjectAddPostResponse = GenericResponse_str_ +export type AddProjectV1ProjectAddPostResponse = GenericResponse_str_; -export type AddProjectV1ProjectAddPostError = HTTPValidationError +export type AddProjectV1ProjectAddPostError = HTTPValidationError; export type GetProjectProfileV1ProjectProfileGetData = { query: { - project_id: string - } -} + project_id: string; + }; +}; -export type GetProjectProfileV1ProjectProfileGetResponse = GenericResponse_NoneBotProjectMeta_ +export type GetProjectProfileV1ProjectProfileGetResponse = + GenericResponse_NoneBotProjectMeta_; -export type GetProjectProfileV1ProjectProfileGetError = HTTPValidationError +export type GetProjectProfileV1ProjectProfileGetError = HTTPValidationError; export type DeleteProjectV1ProjectDeleteDeleteData = { query: { - delete_fully?: boolean - project_id: string - } -} + delete_fully?: boolean; + project_id: string; + }; +}; -export type DeleteProjectV1ProjectDeleteDeleteResponse = GenericResponse_str_ +export type DeleteProjectV1ProjectDeleteDeleteResponse = GenericResponse_str_; -export type DeleteProjectV1ProjectDeleteDeleteError = HTTPValidationError +export type DeleteProjectV1ProjectDeleteDeleteError = HTTPValidationError; -export type ListProjectV1ProjectListGetResponse = ListProjectResponse +export type ListProjectV1ProjectListGetResponse = ListProjectResponse; -export type ListProjectV1ProjectListGetError = unknown +export type ListProjectV1ProjectListGetError = unknown; export type CheckProjectTomlV1ProjectCheckTomlPostData = { query: { - project_dir: string - } -} + project_dir: string; + }; +}; -export type CheckProjectTomlV1ProjectCheckTomlPostResponse = GenericResponse_ProjectTomlDetail_ +export type CheckProjectTomlV1ProjectCheckTomlPostResponse = + GenericResponse_ProjectTomlDetail_; -export type CheckProjectTomlV1ProjectCheckTomlPostError = HTTPValidationError +export type CheckProjectTomlV1ProjectCheckTomlPostError = HTTPValidationError; export type GetPluginsV1ProjectPluginsGetData = { query: { - project_id: string - } -} + project_id: string; + }; +}; export type GetPluginsV1ProjectPluginsGetResponse = - GenericResponse_List_nb_cli_plugin_webui_app_models_base_Plugin__ + GenericResponse_List_nb_cli_plugin_webui_app_models_base_Plugin__; -export type GetPluginsV1ProjectPluginsGetError = HTTPValidationError +export type GetPluginsV1ProjectPluginsGetError = HTTPValidationError; export type GetAdaptersV1ProjectAdaptersGetData = { query: { - project_id: string - } -} + project_id: string; + }; +}; export type GetAdaptersV1ProjectAdaptersGetResponse = - GenericResponse_List_nb_cli_plugin_webui_app_models_base_ModuleInfo__ + GenericResponse_List_nb_cli_plugin_webui_app_models_base_ModuleInfo__; -export type GetAdaptersV1ProjectAdaptersGetError = HTTPValidationError +export type GetAdaptersV1ProjectAdaptersGetError = HTTPValidationError; export type GetDriversV1ProjectDriversGetData = { query: { - project_id: string - } -} + project_id: string; + }; +}; export type GetDriversV1ProjectDriversGetResponse = - GenericResponse_List_nb_cli_plugin_webui_app_models_base_ModuleInfo__ + GenericResponse_List_nb_cli_plugin_webui_app_models_base_ModuleInfo__; -export type GetDriversV1ProjectDriversGetError = HTTPValidationError +export type GetDriversV1ProjectDriversGetError = HTTPValidationError; diff --git a/frontend/src/client/init.ts b/frontend/src/client/init.ts index 907a8ff..e3477c8 100644 --- a/frontend/src/client/init.ts +++ b/frontend/src/client/init.ts @@ -1,65 +1,65 @@ -import { createApp, type App as VueAPP } from 'vue' -import { createPinia } from 'pinia' -import router from '@/router' -import { client, AuthService } from './api' -import { useNoneBotStore, useToastStore } from '@/stores' -import App from '@/App.vue' -import './useMonacoWorker' +import { createApp, type App as VueAPP } from "vue"; +import { createPinia } from "pinia"; +import router from "@/router"; +import { client, AuthService } from "./api"; +import { useNoneBotStore, useToastStore } from "@/stores"; +import App from "@/App.vue"; +import "./useMonacoWorker"; const installVuePlugins = (app: VueAPP) => { - app.use(createPinia()) - app.use(router) -} + app.use(createPinia()); + app.use(router); +}; export const initWebUI = async () => { - const app = createApp(App) - installVuePlugins(app) - app.mount('#app') + const app = createApp(App); + installVuePlugins(app); + app.mount("#app"); - const token = localStorage.getItem('token') || '' - const base = localStorage.getItem('debugUrl') || '' + const token = localStorage.getItem("token") || ""; + const base = localStorage.getItem("debugUrl") || ""; if (!token) { - router.push('/login') - return + router.push("/login"); + return; } client.setConfig({ - baseUrl: base - }) + baseUrl: base, + }); client.interceptors.request.use((request) => { - request.headers.set('Authorization', `Bearer ${token}`) - return request - }) + request.headers.set("Authorization", `Bearer ${token}`); + return request; + }); - const toast = useToastStore() + const toast = useToastStore(); const { data, error, response } = await AuthService.verifyTokenV1AuthVerifyPost({ body: { - jwt_token: token - } - }) + jwt_token: token, + }, + }); if (error && response.status === 403) { - localStorage.clear() - router.push('/login') - toast.add('warning', 'Token 已失效, 请重新登陆', '', 5000) - return + localStorage.clear(); + router.push("/login"); + toast.add("warning", "Token 已失效, 请重新登陆", "", 5000); + return; } if (data) { - const expire = Number(data.detail) - const now = Date.now() / 1000 - const diff = expire - now + const expire = Number(data.detail); + const now = Date.now() / 1000; + const diff = expire - now; toast.add( - 'info', + "info", `Token 有效还剩: ${Math.floor((diff % 86400) / 3600)}h${Math.floor( - (diff % 3600) / 60 + (diff % 3600) / 60, )}m${Math.floor(diff % 60)}s`, - '', - 10000 - ) + "", + 10000, + ); } - const store = useNoneBotStore() - await store.loadBots() -} + const store = useNoneBotStore(); + await store.loadBots(); +}; diff --git a/frontend/src/client/useMonacoWorker.ts b/frontend/src/client/useMonacoWorker.ts index 03e8aef..c76757e 100644 --- a/frontend/src/client/useMonacoWorker.ts +++ b/frontend/src/client/useMonacoWorker.ts @@ -1,7 +1,7 @@ -import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js' +import * as monaco from "monaco-editor/esm/vs/editor/editor.api.js"; self.MonacoEnvironment = { getWorkerUrl: () => { - return './editor.worker.bundle.js' - } -} + return "./editor.worker.bundle.js"; + }, +}; diff --git a/frontend/src/client/utils.ts b/frontend/src/client/utils.ts index 507e89a..5a09e30 100644 --- a/frontend/src/client/utils.ts +++ b/frontend/src/client/utils.ts @@ -1,62 +1,62 @@ -import { client } from './api' +import { client } from "./api"; export const covertTimestampToDateString = ( timestamp: string, options: any = { - year: 'numeric', - month: '2-digit', - day: '2-digit', - hour: '2-digit', - minute: '2-digit', - second: '2-digit' - } + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + }, ) => { - const fixedTimestamp = Number(timestamp) * 1000 - const date = new Date(fixedTimestamp) - return date.toLocaleDateString(navigator.language, options) -} + const fixedTimestamp = Number(timestamp) * 1000; + const date = new Date(fixedTimestamp); + return date.toLocaleDateString(navigator.language, options); +}; export const limitContentShow = (content: string, limit: number) => { if (content.length <= limit) { - return content + return content; } - return content.slice(0, limit) + '...' -} + return content.slice(0, limit) + "..."; +}; export const generateURLForWebUI = (path: string, isWebsocket = false) => { - const base = client.getConfig().baseUrl! - const protocol = isWebsocket ? 'ws' : 'http' - return `${protocol}://${base}${path}` -} + const base = client.getConfig().baseUrl!; + const protocol = isWebsocket ? "ws" : "http"; + return `${protocol}://${base}${path}`; +}; export const sleep = (ms: number) => { - return new Promise((resolve) => setTimeout(resolve, ms)) -} + return new Promise((resolve) => setTimeout(resolve, ms)); +}; export const compareSemanticVersion = (v1: string, v2: string) => { const parseVersion = (v: string) => { - const [main, pre] = v.split('-') - const parts = main.split('.').map(Number) - return { parts, pre: pre || null } - } + const [main, pre] = v.split("-"); + const parts = main.split(".").map(Number); + return { parts, pre: pre || null }; + }; - const v1Parsed = parseVersion(v1) - const v2Parsed = parseVersion(v2) + const v1Parsed = parseVersion(v1); + const v2Parsed = parseVersion(v2); // 逐位比较主版本号 - const maxLength = Math.max(v1Parsed.parts.length, v2Parsed.parts.length) + const maxLength = Math.max(v1Parsed.parts.length, v2Parsed.parts.length); for (let i = 0; i < maxLength; i++) { - const part1 = v1Parsed.parts[i] || 0 - const part2 = v2Parsed.parts[i] || 0 + const part1 = v1Parsed.parts[i] || 0; + const part2 = v2Parsed.parts[i] || 0; - if (part1 > part2) return 1 - if (part1 < part2) return -1 + if (part1 > part2) return 1; + if (part1 < part2) return -1; } // 比较预发行版本 - if (!v1Parsed.pre && v2Parsed.pre) return 1 // v1 是正式版,v2 是预发行版 - if (v1Parsed.pre && !v2Parsed.pre) return -1 // v1 是预发行版,v2 是正式版 - if (v1Parsed.pre && v2Parsed.pre) return v1Parsed.pre.localeCompare(v2Parsed.pre) // 按字典顺序比较预发行版本 + if (!v1Parsed.pre && v2Parsed.pre) return 1; // v1 是正式版,v2 是预发行版 + if (v1Parsed.pre && !v2Parsed.pre) return -1; // v1 是预发行版,v2 是正式版 + if (v1Parsed.pre && v2Parsed.pre) return v1Parsed.pre.localeCompare(v2Parsed.pre); // 按字典顺序比较预发行版本 - return 0 // 完全相等 -} + return 0; // 完全相等 +}; diff --git a/frontend/src/components/ChartItem.vue b/frontend/src/components/ChartItem.vue index ece3c5a..e79c87c 100644 --- a/frontend/src/components/ChartItem.vue +++ b/frontend/src/components/ChartItem.vue @@ -1,82 +1,84 @@ diff --git a/frontend/src/components/DrawerItem.vue b/frontend/src/components/DrawerItem.vue index ca3f600..3b07482 100644 --- a/frontend/src/components/DrawerItem.vue +++ b/frontend/src/components/DrawerItem.vue @@ -1,21 +1,21 @@ @@ -36,7 +36,7 @@ const hiddenDrawer = () => { 'fixed top-0 right-0 z-50 h-screen bg-base-100 shadow-2xl transition shrink-0 flex flex-col': true, 'w-full md:w-2/5 xl:w-1/4 ': true, 'translate-x-0 opacity-100': isShow, - 'translate-x-full opacity-0': !isShow + 'translate-x-full opacity-0': !isShow, }" > @@ -75,9 +75,9 @@ const hiddenDrawer = () => { .material-symbols-outlined { font-variation-settings: - 'FILL' 0, - 'wght' 300, - 'GRAD' 0, - 'opsz' 24; + "FILL" 0, + "wght" 300, + "GRAD" 0, + "opsz" 24; } diff --git a/frontend/src/components/EditorItem.vue b/frontend/src/components/EditorItem.vue index e4875c6..2c44d36 100644 --- a/frontend/src/components/EditorItem.vue +++ b/frontend/src/components/EditorItem.vue @@ -1,35 +1,35 @@ diff --git a/frontend/src/components/Modals/AddBot/AddBotIndex.vue b/frontend/src/components/Modals/AddBot/AddBotIndex.vue index 35568ee..829ca33 100644 --- a/frontend/src/components/Modals/AddBot/AddBotIndex.vue +++ b/frontend/src/components/Modals/AddBot/AddBotIndex.vue @@ -1,58 +1,62 @@ - + 添加 NoneBot 实例 -import { ProjectService } from '@/client/api' -import { ref } from 'vue' -import { useAddBotStore } from '.' +import { ProjectService } from "@/client/api"; +import { ref } from "vue"; +import { useAddBotStore } from "."; -const store = useAddBotStore() +const store = useAddBotStore(); -const inputValue = ref('') +const inputValue = ref(""); const search = async () => { if (!inputValue.value) { - store.warningMessage = '请输入实例路径' - return + store.warningMessage = "请输入实例路径"; + return; } const { data, error } = await ProjectService.checkProjectTomlV1ProjectCheckTomlPost({ query: { - project_dir: inputValue.value - } - }) + project_dir: inputValue.value, + }, + }); if (error) { - store.warningMessage = error.detail?.toString() ?? '' + store.warningMessage = error.detail?.toString() ?? ""; } if (data) { - const detail = data.detail - store.projectName = detail.project_name - store.adapters = detail.adapters - store.plugins = detail.plugins - store.pluginDirs = detail.plugin_dirs - store.projectPath = inputValue.value + const detail = data.detail; + store.projectName = detail.project_name; + store.adapters = detail.adapters; + store.plugins = detail.plugins; + store.pluginDirs = detail.plugin_dirs; + store.projectPath = inputValue.value; - store.searchBotSuccess = true - store.warningMessage = '' - inputValue.value = '' + store.searchBotSuccess = true; + store.warningMessage = ""; + inputValue.value = ""; } -} +}; - + 实例绝对路径 @@ -64,11 +67,11 @@ const search = async () => { - {{ store.adapters.length ? '已有适配器:' : '未找到适配器' }} + {{ store.adapters.length ? "已有适配器:" : "未找到适配器" }} { - {{ store.plugins.length ? '已有插件:' : '未找到插件' }} + {{ store.plugins.length ? "已有插件:" : "未找到插件" }} { - {{ store.pluginDirs.length ? '已有插件目录:' : '未找到插件目录' }} + {{ store.pluginDirs.length ? "已有插件目录:" : "未找到插件目录" }} { 重新扫描 @@ -144,7 +147,7 @@ const search = async () => { diff --git a/frontend/src/components/Modals/AddBot/InstallationItem.vue b/frontend/src/components/Modals/AddBot/InstallationItem.vue index c935497..ee16f4e 100644 --- a/frontend/src/components/Modals/AddBot/InstallationItem.vue +++ b/frontend/src/components/Modals/AddBot/InstallationItem.vue @@ -1,34 +1,34 @@ @@ -128,7 +128,9 @@ onUnmounted(() => { > {{ adapter.name }} - 未找到适配器 + + 未找到适配器 + @@ -141,7 +143,9 @@ onUnmounted(() => { > {{ plugin }} - 未找到插件 + + 未找到插件 + @@ -170,7 +174,7 @@ onUnmounted(() => { :class="{ 'flex font-mono': true, 'bg-error/50': log.level === 'ERROR', - 'bg-warning/50': log.level === 'WARNING' + 'bg-warning/50': log.level === 'WARNING', }" > @@ -187,7 +191,7 @@ onUnmounted(() => { @@ -199,7 +203,7 @@ onUnmounted(() => { 取消 @@ -207,17 +211,19 @@ onUnmounted(() => { - 完成 + + 完成 + - {{ isFailed ? '重试' : '安装' }} + {{ isFailed ? "重试" : "安装" }} diff --git a/frontend/src/components/Modals/AddBot/MirrorSelect.vue b/frontend/src/components/Modals/AddBot/MirrorSelect.vue index 34a2c48..537d947 100644 --- a/frontend/src/components/Modals/AddBot/MirrorSelect.vue +++ b/frontend/src/components/Modals/AddBot/MirrorSelect.vue @@ -1,41 +1,41 @@ @@ -74,11 +74,13 @@ const mirrors: MirrorItem[] = [ - 上一步 + + 上一步 + diff --git a/frontend/src/components/Modals/AddBot/index.ts b/frontend/src/components/Modals/AddBot/index.ts index 9425725..4e0636f 100644 --- a/frontend/src/components/Modals/AddBot/index.ts +++ b/frontend/src/components/Modals/AddBot/index.ts @@ -1,32 +1,32 @@ -import { defineStore } from 'pinia' -import { ref } from 'vue' +import { defineStore } from "pinia"; +import { ref } from "vue"; -export const useAddBotStore = defineStore('addBotStore', () => { - const step = ref(0) - const warningMessage = ref('') - const projectName = ref('') - const projectPath = ref('') - const pythonMirror = ref('') - const adapters = ref[]>([]) - const plugins = ref([]) - const pluginDirs = ref([]) - const isInstalling = ref(false) - const addBotSuccess = ref(false) - const searchBotSuccess = ref(false) +export const useAddBotStore = defineStore("addBotStore", () => { + const step = ref(0); + const warningMessage = ref(""); + const projectName = ref(""); + const projectPath = ref(""); + const pythonMirror = ref(""); + const adapters = ref[]>([]); + const plugins = ref([]); + const pluginDirs = ref([]); + const isInstalling = ref(false); + const addBotSuccess = ref(false); + const searchBotSuccess = ref(false); const reset = () => { - step.value = 0 - warningMessage.value = '' - projectName.value = '' - projectPath.value = '' - pythonMirror.value = '' - adapters.value = [] - plugins.value = [] - pluginDirs.value = [] - isInstalling.value = false - addBotSuccess.value = false - searchBotSuccess.value = false - } + step.value = 0; + warningMessage.value = ""; + projectName.value = ""; + projectPath.value = ""; + pythonMirror.value = ""; + adapters.value = []; + plugins.value = []; + pluginDirs.value = []; + isInstalling.value = false; + addBotSuccess.value = false; + searchBotSuccess.value = false; + }; return { step, @@ -40,6 +40,6 @@ export const useAddBotStore = defineStore('addBotStore', () => { isInstalling, addBotSuccess, searchBotSuccess, - reset - } -}) + reset, + }; +}); diff --git a/frontend/src/components/Modals/CreateBot/AdapterSelect.vue b/frontend/src/components/Modals/CreateBot/AdapterSelect.vue index b443dd4..529ef49 100644 --- a/frontend/src/components/Modals/CreateBot/AdapterSelect.vue +++ b/frontend/src/components/Modals/CreateBot/AdapterSelect.vue @@ -1,24 +1,24 @@ @@ -27,12 +27,14 @@ if (data) { - 上一步 + + 上一步 + diff --git a/frontend/src/components/Modals/CreateBot/BotBasic.vue b/frontend/src/components/Modals/CreateBot/BotBasic.vue index ecc82f4..cd60597 100644 --- a/frontend/src/components/Modals/CreateBot/BotBasic.vue +++ b/frontend/src/components/Modals/CreateBot/BotBasic.vue @@ -1,16 +1,16 @@ @@ -38,7 +38,10 @@ const acceptModalData = (data: string) => { 选择文件夹 - + 当前选择: (Base Dir)/{{ limitContentShow(store.projectPath, 30) }} @@ -46,14 +49,16 @@ const acceptModalData = (data: string) => { - 上一步 + + 上一步 + diff --git a/frontend/src/components/Modals/CreateBot/CreateBotIndex.vue b/frontend/src/components/Modals/CreateBot/CreateBotIndex.vue index 759343d..9abff90 100644 --- a/frontend/src/components/Modals/CreateBot/CreateBotIndex.vue +++ b/frontend/src/components/Modals/CreateBot/CreateBotIndex.vue @@ -1,65 +1,67 @@ - + 创建 NoneBot 实例 @@ -67,12 +69,14 @@ const steps: StepItem[] = [ v-for="(step, index) in steps" :key="step.title" :role=" - step.pass() && !store.isInstalling && !store.createBotSuccess ? 'button' : undefined + step.pass() && !store.isInstalling && !store.createBotSuccess + ? 'button' + : undefined " :data-content="index < store.step ? '✓' : index + 1" :class="{ step: true, - 'step-primary': index <= store.step + 'step-primary': index <= store.step, }" @click=" step.pass() && !store.isInstalling && !store.createBotSuccess diff --git a/frontend/src/components/Modals/CreateBot/DriverSelect.vue b/frontend/src/components/Modals/CreateBot/DriverSelect.vue index 5066c16..1de9e13 100644 --- a/frontend/src/components/Modals/CreateBot/DriverSelect.vue +++ b/frontend/src/components/Modals/CreateBot/DriverSelect.vue @@ -1,24 +1,24 @@ @@ -27,12 +27,14 @@ if (data) { - 上一步 + + 上一步 + diff --git a/frontend/src/components/Modals/CreateBot/InstallationItem.vue b/frontend/src/components/Modals/CreateBot/InstallationItem.vue index 99a8d5f..9e47b4c 100644 --- a/frontend/src/components/Modals/CreateBot/InstallationItem.vue +++ b/frontend/src/components/Modals/CreateBot/InstallationItem.vue @@ -1,105 +1,105 @@ @@ -113,11 +113,11 @@ onUnmounted(() => { 实例类型 - {{ store.template === 'bootstrap' ? '初学者 / 普通用户' : '开发者' }} + {{ store.template === "bootstrap" ? "初学者 / 普通用户" : "开发者" }} 实例插件加载位置 - {{ store.useSrc ? '/src' : `/${store.projectName}` }} + {{ store.useSrc ? "/src" : `/${store.projectName}` }} 实例路径 @@ -154,10 +154,12 @@ onUnmounted(() => { :class="{ 'flex font-mono': true, 'bg-error/50': item.level === 'ERROR', - 'bg-warning/50': item.level === 'WARNING' + 'bg-warning/50': item.level === 'WARNING', }" > - {{ item.time }} + + {{ item.time }} + {{ item.level }} {{ item.message }} @@ -169,7 +171,7 @@ onUnmounted(() => { @@ -181,7 +183,7 @@ onUnmounted(() => { 取消 @@ -189,17 +191,19 @@ onUnmounted(() => { - 完成 + + 完成 + - {{ isFailed ? '重试' : '安装' }} + {{ isFailed ? "重试" : "安装" }} diff --git a/frontend/src/components/Modals/CreateBot/ItemSelect.vue b/frontend/src/components/Modals/CreateBot/ItemSelect.vue index 0b5bf5b..c6e2ff9 100644 --- a/frontend/src/components/Modals/CreateBot/ItemSelect.vue +++ b/frontend/src/components/Modals/CreateBot/ItemSelect.vue @@ -1,55 +1,55 @@ @@ -58,8 +58,11 @@ const updateItem = (data: T) => { expand_less @@ -67,9 +70,9 @@ const updateItem = (data: T) => { expand_more @@ -96,8 +99,14 @@ const updateItem = (data: T) => { > {{ limitContentShow(item.name!, 10) }} - - check_circle + + + check_circle + {{ limitContentShow(item.desc!, 20) }} @@ -138,9 +147,9 @@ const updateItem = (data: T) => { diff --git a/frontend/src/components/Modals/CreateBot/MirrorSelect.vue b/frontend/src/components/Modals/CreateBot/MirrorSelect.vue index eb443e6..26afd2f 100644 --- a/frontend/src/components/Modals/CreateBot/MirrorSelect.vue +++ b/frontend/src/components/Modals/CreateBot/MirrorSelect.vue @@ -1,41 +1,41 @@ @@ -80,7 +80,7 @@ const mirrors: MirrorItem[] = [ diff --git a/frontend/src/components/Modals/CreateBot/TemplateSelect.vue b/frontend/src/components/Modals/CreateBot/TemplateSelect.vue index 906d2be..abbb118 100644 --- a/frontend/src/components/Modals/CreateBot/TemplateSelect.vue +++ b/frontend/src/components/Modals/CreateBot/TemplateSelect.vue @@ -1,23 +1,23 @@ @@ -31,7 +31,7 @@ const options: OptionItem[] = [ :key="i.text" :class="{ 'w-full md:w-1/3 btn btn-primary font-normal text-base-100': true, - 'btn-outline': store.template !== i.value + 'btn-outline': store.template !== i.value, }" @click="store.template = i.value" > @@ -76,7 +76,7 @@ const options: OptionItem[] = [ diff --git a/frontend/src/components/Modals/CreateBot/index.ts b/frontend/src/components/Modals/CreateBot/index.ts index db51661..d3fad6f 100644 --- a/frontend/src/components/Modals/CreateBot/index.ts +++ b/frontend/src/components/Modals/CreateBot/index.ts @@ -1,33 +1,33 @@ -import type { Adapter, Driver } from '@/client/api' -import { defineStore } from 'pinia' -import { ref } from 'vue' +import type { Adapter, Driver } from "@/client/api"; +import { defineStore } from "pinia"; +import { ref } from "vue"; -export const useCreateBotStore = defineStore('createBotStore', () => { - const step = ref(0) - const warningMessage = ref('') - const template = ref('') - const useSrc = ref(false) - const projectName = ref('') - const projectPath = ref('') - const pythonMirror = ref('') - const drivers = ref([]) - const adapters = ref([]) - const isInstalling = ref(false) - const createBotSuccess = ref(false) +export const useCreateBotStore = defineStore("createBotStore", () => { + const step = ref(0); + const warningMessage = ref(""); + const template = ref(""); + const useSrc = ref(false); + const projectName = ref(""); + const projectPath = ref(""); + const pythonMirror = ref(""); + const drivers = ref([]); + const adapters = ref([]); + const isInstalling = ref(false); + const createBotSuccess = ref(false); const reset = () => { - step.value = 0 - warningMessage.value = '' - template.value = '' - useSrc.value = false - projectName.value = '' - projectPath.value = '' - pythonMirror.value = '' - drivers.value = [] - adapters.value = [] - isInstalling.value = false - createBotSuccess.value = false - } + step.value = 0; + warningMessage.value = ""; + template.value = ""; + useSrc.value = false; + projectName.value = ""; + projectPath.value = ""; + pythonMirror.value = ""; + drivers.value = []; + adapters.value = []; + isInstalling.value = false; + createBotSuccess.value = false; + }; return { step, @@ -41,6 +41,6 @@ export const useCreateBotStore = defineStore('createBotStore', () => { adapters, isInstalling, createBotSuccess, - reset - } -}) + reset, + }; +}); diff --git a/frontend/src/components/Modals/Global/FolderSelect.vue b/frontend/src/components/Modals/Global/FolderSelect.vue index 4fb1178..9e40ec2 100644 --- a/frontend/src/components/Modals/Global/FolderSelect.vue +++ b/frontend/src/components/Modals/Global/FolderSelect.vue @@ -1,83 +1,83 @@ @@ -99,7 +99,7 @@ const selectFolder = (path: string, isFolder: boolean) => { .split('/') .slice(0, index + 1) .join('/'), - true + true, ) " > @@ -129,7 +129,7 @@ const selectFolder = (path: string, isFolder: boolean) => { > - {{ file.is_dir ? 'folder' : 'draft' }} + {{ file.is_dir ? "folder" : "draft" }} {{ limitContentShow(file.name, 10) }} @@ -138,12 +138,14 @@ const selectFolder = (path: string, isFolder: boolean) => { {{ covertTimestampToDateString(file.modified_time) }} - {{ file.is_dir ? '文件夹' : '文件' }} + {{ file.is_dir ? "文件夹" : "文件" }} - check + + check + { - 刷新 - 新建文件夹 - 选中当前目录 + + 刷新 + + + 新建文件夹 + + + 选中当前目录 + @@ -181,9 +189,9 @@ const selectFolder = (path: string, isFolder: boolean) => { 确认 @@ -204,11 +212,17 @@ const selectFolder = (path: string, isFolder: boolean) => { /> - + 取消 确认 @@ -221,9 +235,9 @@ const selectFolder = (path: string, isFolder: boolean) => { diff --git a/frontend/src/components/Modals/Global/LogView.vue b/frontend/src/components/Modals/Global/LogView.vue index 5e1302e..fd461e8 100644 --- a/frontend/src/components/Modals/Global/LogView.vue +++ b/frontend/src/components/Modals/Global/LogView.vue @@ -1,91 +1,91 @@ @@ -102,10 +102,12 @@ watch( :class="{ 'flex font-mono': true, 'bg-error/50': log.level === 'ERROR', - 'bg-warning/50': log.level === 'WARNING' + 'bg-warning/50': log.level === 'WARNING', }" > - {{ log.time }} + + {{ log.time }} + {{ log.level }} {{ log.message }} @@ -132,9 +134,9 @@ watch( 完成 diff --git a/frontend/src/components/ToastItem.vue b/frontend/src/components/ToastItem.vue index 81c86ad..6a33d99 100644 --- a/frontend/src/components/ToastItem.vue +++ b/frontend/src/components/ToastItem.vue @@ -1,25 +1,37 @@ - + check_circle - + cancel - + info - + error @@ -37,9 +49,9 @@ const store = useToastStore() diff --git a/frontend/src/components/header/BotChoose.vue b/frontend/src/components/header/BotChoose.vue index d8dc760..2f98911 100644 --- a/frontend/src/components/header/BotChoose.vue +++ b/frontend/src/components/header/BotChoose.vue @@ -1,13 +1,13 @@ @@ -45,7 +45,9 @@ const drawerRef = ref | null>(null) > 选择中 - 运行中 + + 运行中 + @@ -72,9 +74,9 @@ const drawerRef = ref | null>(null) diff --git a/frontend/src/components/header/HeaderIndex.vue b/frontend/src/components/header/HeaderIndex.vue index b0ac264..6f36952 100644 --- a/frontend/src/components/header/HeaderIndex.vue +++ b/frontend/src/components/header/HeaderIndex.vue @@ -1,6 +1,6 @@ @@ -14,9 +14,9 @@ import TabBar from '@/components/header/TabBar.vue' diff --git a/frontend/src/components/header/NotificationItem.vue b/frontend/src/components/header/NotificationItem.vue index b91fd7d..760fcab 100644 --- a/frontend/src/components/header/NotificationItem.vue +++ b/frontend/src/components/header/NotificationItem.vue @@ -1,12 +1,12 @@ @@ -70,7 +70,7 @@ const drawerRef = ref | null>(null) - {{ toast.from ? `From: ${toast.from}` : '' }} + {{ toast.from ? `From: ${toast.from}` : "" }} @@ -91,9 +91,9 @@ const drawerRef = ref | null>(null) diff --git a/frontend/src/components/header/StatusItem.vue b/frontend/src/components/header/StatusItem.vue index 87d67f0..aac82fb 100644 --- a/frontend/src/components/header/StatusItem.vue +++ b/frontend/src/components/header/StatusItem.vue @@ -1,7 +1,7 @@ diff --git a/frontend/src/components/header/TabBar.vue b/frontend/src/components/header/TabBar.vue index 7bd6644..db2f1bf 100644 --- a/frontend/src/components/header/TabBar.vue +++ b/frontend/src/components/header/TabBar.vue @@ -1,46 +1,46 @@ @@ -52,7 +52,7 @@ const operation = (route: NavItem) => { role="tab" :class="{ 'tab flex gap-2 hover:bg-primary/[.2] transition !border-b-0 shrink-0': true, - '[--tab-bg:oklch(var(--b2))] tab-active': isCurrentRoute(i.routeData.path) + '[--tab-bg:oklch(var(--b2))] tab-active': isCurrentRoute(i.routeData.path), }" @click="operation(i)" draggable="true" @@ -78,10 +78,10 @@ const operation = (route: NavItem) => { diff --git a/frontend/src/components/header/WebUISettings.vue b/frontend/src/components/header/WebUISettings.vue index e08aced..3f57978 100644 --- a/frontend/src/components/header/WebUISettings.vue +++ b/frontend/src/components/header/WebUISettings.vue @@ -1,11 +1,11 @@ @@ -63,9 +63,9 @@ const drawerRef = ref | null>() diff --git a/frontend/src/components/sidebar/SideMenu.vue b/frontend/src/components/sidebar/SideMenu.vue index 3972f0c..34a215a 100644 --- a/frontend/src/components/sidebar/SideMenu.vue +++ b/frontend/src/components/sidebar/SideMenu.vue @@ -1,38 +1,45 @@ - + {{ route.googleIcon }} - {{ route.name }} + {{ + route.name + }} @@ -41,10 +48,10 @@ const recordView = (route: NavItem) => { diff --git a/frontend/src/views/Login/LoginForm.vue b/frontend/src/views/Login/LoginForm.vue index eb85715..375c0c1 100644 --- a/frontend/src/views/Login/LoginForm.vue +++ b/frontend/src/views/Login/LoginForm.vue @@ -1,51 +1,51 @@ diff --git a/frontend/src/views/Login/LoginIndex.vue b/frontend/src/views/Login/LoginIndex.vue index ef76dae..26640ec 100644 --- a/frontend/src/views/Login/LoginIndex.vue +++ b/frontend/src/views/Login/LoginIndex.vue @@ -1,15 +1,19 @@ - circle + + circle + NoneBot - + 跨平台 PYTHON 异步机器人框架 @@ -23,9 +27,9 @@ import Footer from '@/components/FooterItem.vue' diff --git a/frontend/src/views/NotFound.vue b/frontend/src/views/NotFound.vue index f439140..0c1e9c7 100644 --- a/frontend/src/views/NotFound.vue +++ b/frontend/src/views/NotFound.vue @@ -1,8 +1,8 @@ diff --git a/frontend/src/views/Operation/BotDetails.vue b/frontend/src/views/Operation/BotDetails.vue index 17c138e..c9fb00e 100644 --- a/frontend/src/views/Operation/BotDetails.vue +++ b/frontend/src/views/Operation/BotDetails.vue @@ -1,67 +1,73 @@ @@ -80,14 +86,16 @@ const openModal = (key: string) => { 管理 - 关闭 + + 关闭 + @@ -116,7 +124,9 @@ const openModal = (key: string) => { {{ item.details?.value.length }} 个 - 详细 + + 详细 + diff --git a/frontend/src/views/Operation/OperationBar.vue b/frontend/src/views/Operation/OperationBar.vue index 73f1f74..54a8c60 100644 --- a/frontend/src/views/Operation/OperationBar.vue +++ b/frontend/src/views/Operation/OperationBar.vue @@ -1,110 +1,110 @@ @@ -118,7 +118,9 @@ const deleteBot = async (isFully: boolean = false) => { 仅删除信息 - 取消 + + 取消 + @@ -129,7 +131,9 @@ const deleteBot = async (isFully: boolean = false) => { {{ store.selectedBot?.project_name }} - {{ store.selectedBot?.project_id }} + + {{ store.selectedBot?.project_id }} + { @@ -154,7 +158,7 @@ const deleteBot = async (isFully: boolean = false) => { @@ -163,7 +167,7 @@ const deleteBot = async (isFully: boolean = false) => { @@ -173,7 +177,9 @@ const deleteBot = async (isFully: boolean = false) => { :class="{ 'btn btn-sm btn-outline btn-primary shadow-none font-normal': true, 'btn-disabled': - store.selectedBot?.is_running || Object.values(store.bots).length <= 1 || oLock + store.selectedBot?.is_running || + Object.values(store.bots).length <= 1 || + oLock, }" @click="deleteConfirmModal?.showModal()" > diff --git a/frontend/src/views/Operation/OperationIndex.vue b/frontend/src/views/Operation/OperationIndex.vue index 5f1ce00..1f939bf 100644 --- a/frontend/src/views/Operation/OperationIndex.vue +++ b/frontend/src/views/Operation/OperationIndex.vue @@ -1,7 +1,7 @@ diff --git a/frontend/src/views/Operation/TerminalItem.vue b/frontend/src/views/Operation/TerminalItem.vue index 56c827b..117f0c1 100644 --- a/frontend/src/views/Operation/TerminalItem.vue +++ b/frontend/src/views/Operation/TerminalItem.vue @@ -1,118 +1,129 @@ @@ -126,7 +137,9 @@ const retry = () => { > 已连接 - 未连接 + + 未连接 + @@ -139,7 +152,10 @@ const retry = () => { - + { :class="{ 'flex font-mono': true, 'bg-error/50': item.level === 'ERROR', - 'bg-warning/50': item.level === 'WARNING' + 'bg-warning/50': item.level === 'WARNING', }" > - + {{ item.time }} {{ item.level }} diff --git a/frontend/src/views/Settings/DotenvEditorModal.vue b/frontend/src/views/Settings/DotenvEditorModal.vue index 63ae1ce..99e21d6 100644 --- a/frontend/src/views/Settings/DotenvEditorModal.vue +++ b/frontend/src/views/Settings/DotenvEditorModal.vue @@ -1,87 +1,92 @@ @@ -98,16 +103,16 @@ const updateDotenvFile = async () => { minimap: { enabled: false }, accessibilitySupport: 'off', automaticLayout: true, - lineNumbers: 'off' + lineNumbers: 'off', }" v-on:editor=" (event) => { - editor = event + editor = event; } " v-on:update-value=" (value) => { - returnEditorValue = value + returnEditorValue = value; } " /> diff --git a/frontend/src/views/Settings/DotenvManageModal.vue b/frontend/src/views/Settings/DotenvManageModal.vue index e7e2390..14c896e 100644 --- a/frontend/src/views/Settings/DotenvManageModal.vue +++ b/frontend/src/views/Settings/DotenvManageModal.vue @@ -1,100 +1,104 @@ @@ -110,7 +114,11 @@ const cancel = () => { - + {{ i }} { close @@ -137,7 +148,11 @@ const cancel = () => { + 添加 - + 确认 取消 diff --git a/frontend/src/views/Settings/InputTemplate/ArrayInput.vue b/frontend/src/views/Settings/InputTemplate/ArrayInput.vue index 502f1ef..d4ab68a 100644 --- a/frontend/src/views/Settings/InputTemplate/ArrayInput.vue +++ b/frontend/src/views/Settings/InputTemplate/ArrayInput.vue @@ -1,70 +1,77 @@ @@ -78,7 +85,11 @@ const cancel = () => { - + {{ i }} diff --git a/frontend/src/views/Settings/InputTemplate/BooleanInput.vue b/frontend/src/views/Settings/InputTemplate/BooleanInput.vue index 9a707d9..ff74c4c 100644 --- a/frontend/src/views/Settings/InputTemplate/BooleanInput.vue +++ b/frontend/src/views/Settings/InputTemplate/BooleanInput.vue @@ -1,8 +1,8 @@ @@ -12,9 +12,11 @@ defineProps<{ moduleType: ModuleType | ConfigType; data: ModuleConfigChild }>() :checked="data.configured as boolean" @click=" async () => { - await updateConfig(moduleType, data.conf_type, data.name, !data.configured).then(() => { - data.configured! = !data.configured - }) + await updateConfig(moduleType, data.conf_type, data.name, !data.configured).then( + () => { + data.configured! = !data.configured; + }, + ); } " /> diff --git a/frontend/src/views/Settings/InputTemplate/NumberInput.vue b/frontend/src/views/Settings/InputTemplate/NumberInput.vue index f1c93d0..385fa34 100644 --- a/frontend/src/views/Settings/InputTemplate/NumberInput.vue +++ b/frontend/src/views/Settings/InputTemplate/NumberInput.vue @@ -1,32 +1,33 @@ @@ -45,7 +46,10 @@ watch(inputValue, (value) => { - + refresh @@ -54,7 +58,12 @@ watch(inputValue, (value) => { data-tip="编辑" @click="inEditing = !inEditing" > - + edit diff --git a/frontend/src/views/Settings/InputTemplate/SelectInput.vue b/frontend/src/views/Settings/InputTemplate/SelectInput.vue index a88e872..c468a72 100644 --- a/frontend/src/views/Settings/InputTemplate/SelectInput.vue +++ b/frontend/src/views/Settings/InputTemplate/SelectInput.vue @@ -1,26 +1,29 @@ @@ -43,7 +46,12 @@ watch(selectedValue, async () => { data-tip="编辑" @click="inEditing = !inEditing" > - + edit diff --git a/frontend/src/views/Settings/InputTemplate/StringInput.vue b/frontend/src/views/Settings/InputTemplate/StringInput.vue index d19844f..f0d8e71 100644 --- a/frontend/src/views/Settings/InputTemplate/StringInput.vue +++ b/frontend/src/views/Settings/InputTemplate/StringInput.vue @@ -1,31 +1,31 @@ @@ -60,7 +60,10 @@ const update = async () => { visibility - + refresh @@ -69,7 +72,12 @@ const update = async () => { data-tip="编辑" @click="inEditing = !inEditing" > - + edit diff --git a/frontend/src/views/Settings/SearchBar.vue b/frontend/src/views/Settings/SearchBar.vue index 97776a6..606f249 100644 --- a/frontend/src/views/Settings/SearchBar.vue +++ b/frontend/src/views/Settings/SearchBar.vue @@ -1,79 +1,79 @@ @@ -82,7 +82,9 @@ const moduleItems: moduleItem[] = [ - + - + menu - 当前环境:{{ nonebotStore.selectedBot?.use_env || '未知' }} + 当前环境:{{ nonebotStore.selectedBot?.use_env || "未知" }} - 编辑文件 + + 编辑文件 + diff --git a/frontend/src/views/Settings/SettingCard.vue b/frontend/src/views/Settings/SettingCard.vue index 9c98588..c6644fb 100644 --- a/frontend/src/views/Settings/SettingCard.vue +++ b/frontend/src/views/Settings/SettingCard.vue @@ -1,12 +1,12 @@ @@ -50,7 +50,11 @@ const props = defineProps<{ data: ModuleConfigFather }>() :data="i" :module-type="data.module_type" /> - + -import SettingCard from './SettingCard.vue' -import SearchBar from './SearchBar.vue' -import { useSettingsStore } from './client' +import SettingCard from "./SettingCard.vue"; +import SearchBar from "./SearchBar.vue"; +import { useSettingsStore } from "./client"; -const settingsStore = useSettingsStore() +const settingsStore = useSettingsStore(); -settingsStore.init() +settingsStore.init(); diff --git a/frontend/src/views/Settings/client.ts b/frontend/src/views/Settings/client.ts index bddc240..b679a37 100644 --- a/frontend/src/views/Settings/client.ts +++ b/frontend/src/views/Settings/client.ts @@ -4,156 +4,172 @@ import { type ModuleConfigFather, ProjectService, ConfigTypeSchema, - ModuleTypeSchema -} from '@/client/api' -import { useNoneBotStore, useToastStore } from '@/stores' -import { defineStore } from 'pinia' -import { ref } from 'vue' + ModuleTypeSchema, +} from "@/client/api"; +import { useNoneBotStore, useToastStore } from "@/stores"; +import { defineStore } from "pinia"; +import { ref } from "vue"; -const store = useNoneBotStore() -const toast = useToastStore() +const store = useNoneBotStore(); +const toast = useToastStore(); -export type ModuleConfigType = ModuleType | ConfigType | 'all' +export type ModuleConfigType = ModuleType | ConfigType | "all"; export const updateConfig = async ( moduleType: ModuleType | ConfigType, confType: string, k: string, - v: any + v: any, ) => { if (!store.selectedBot) { - toast.add('warning', '未选择实例', '', 5000) - return + toast.add("warning", "未选择实例", "", 5000); + return; } - const { data, error } = await ProjectService.updateProjectConfigV1ProjectConfigUpdatePost({ - query: { - module_type: moduleType, - project_id: store.selectedBot.project_id - }, - body: { - env: store.selectedBot.use_env!, - conf_type: confType, - k: k, - v: v - } - }) + const { data, error } = + await ProjectService.updateProjectConfigV1ProjectConfigUpdatePost({ + query: { + module_type: moduleType, + project_id: store.selectedBot.project_id, + }, + body: { + env: store.selectedBot.use_env!, + conf_type: confType, + k: k, + v: v, + }, + }); if (error) { - toast.add('error', `更新失败, 原因:${error.detail?.toString()}`, '', 5000) + toast.add("error", `更新失败, 原因:${error.detail?.toString()}`, "", 5000); } if (data) { - toast.add('success', '更新成功', '', 5000) + toast.add("success", "更新成功", "", 5000); } - return { data, error } -} + return { data, error }; +}; -export const useSettingsStore = defineStore('settingsStore', () => { - const viewModule = ref('all') - const settingsData = ref([]) - const viewData = ref([]) - const isRequesting = ref(false) - const searchInput = ref('') +export const useSettingsStore = defineStore("settingsStore", () => { + const viewModule = ref("all"); + const settingsData = ref([]); + const viewData = ref([]); + const isRequesting = ref(false); + const searchInput = ref(""); const getTomlConf = async (projectID: string) => { - isRequesting.value = true - const { data, error } = await ProjectService.getProjectMetaConfigV1ProjectConfigMetaDetailGet({ - query: { - project_id: projectID - } - }) + isRequesting.value = true; + const { data, error } = + await ProjectService.getProjectMetaConfigV1ProjectConfigMetaDetailGet({ + query: { + project_id: projectID, + }, + }); if (error) { - toast.add('error', `获取实例 toml 配置失败, 原因:${error.detail?.toString()}`, '', 5000) + toast.add( + "error", + `获取实例 toml 配置失败, 原因:${error.detail?.toString()}`, + "", + 5000, + ); } if (data) { - settingsData.value = settingsData.value.concat(data.detail) + settingsData.value = settingsData.value.concat(data.detail); } - isRequesting.value = false - } + isRequesting.value = false; + }; const getNoneBotConf = async (projectID: string) => { - isRequesting.value = true + isRequesting.value = true; const { data, error } = await ProjectService.getProjectNonebotConfigV1ProjectConfigNonebotDetailGet({ query: { - project_id: projectID - } - }) + project_id: projectID, + }, + }); if (error) { - toast.add('error', `获取实例 NoneBot 配置失败, 原因:${error.detail?.toString()}`, '', 5000) + toast.add( + "error", + `获取实例 NoneBot 配置失败, 原因:${error.detail?.toString()}`, + "", + 5000, + ); } if (data) { - settingsData.value = settingsData.value.concat(data.detail) + settingsData.value = settingsData.value.concat(data.detail); } - isRequesting.value = false - } + isRequesting.value = false; + }; const getNoneBotPluginConf = async (projectID: string) => { - isRequesting.value = true + isRequesting.value = true; const { data, error } = - await ProjectService.getProjectNonebotPluginConfigV1ProjectConfigNonebotPluginDetailGet({ - query: { - project_id: projectID - } - }) + await ProjectService.getProjectNonebotPluginConfigV1ProjectConfigNonebotPluginDetailGet( + { + query: { + project_id: projectID, + }, + }, + ); if (error) { - toast.add('error', `获取实例配置失败, 原因:${error.detail?.toString()}`, '', 5000) + toast.add("error", `获取实例配置失败, 原因:${error.detail?.toString()}`, "", 5000); } if (data) { - settingsData.value = settingsData.value.concat(data.detail) + settingsData.value = settingsData.value.concat(data.detail); } - isRequesting.value = false - } + isRequesting.value = false; + }; const updateViewData = (searchText?: string) => { viewData.value = settingsData.value.filter((item) => { - if (!searchText) return true + if (!searchText) return true; return ( item.title.includes(searchText) || item.name.includes(searchText) || - (item.description ?? '').includes(searchText) - ) - }) - - const filter = [...ConfigTypeSchema.enum, ...ModuleTypeSchema.enum] - if (viewModule.value !== 'all' && Object.values(filter).includes(viewModule.value)) { - viewData.value = viewData.value.filter((item) => item.module_type === viewModule.value) + (item.description ?? "").includes(searchText) + ); + }); + + const filter = [...ConfigTypeSchema.enum, ...ModuleTypeSchema.enum]; + if (viewModule.value !== "all" && Object.values(filter).includes(viewModule.value)) { + viewData.value = viewData.value.filter( + (item) => item.module_type === viewModule.value, + ); } - } + }; const init = async () => { if (!store.selectedBot) { - toast.add('warning', '未选择实例', '', 5000) - return + toast.add("warning", "未选择实例", "", 5000); + return; } - settingsData.value = [] + settingsData.value = []; - const projectID = store.selectedBot.project_id + const projectID = store.selectedBot.project_id; - await getTomlConf(projectID) - await getNoneBotConf(projectID) - await getNoneBotPluginConf(projectID) + await getTomlConf(projectID); + await getNoneBotConf(projectID); + await getNoneBotPluginConf(projectID); - updateViewData(searchInput.value) - } + updateViewData(searchInput.value); + }; const setViewModule = (module: ModuleConfigType) => { - viewModule.value = module - searchInput.value = '' - updateViewData() - } + viewModule.value = module; + searchInput.value = ""; + updateViewData(); + }; return { viewModule, @@ -163,6 +179,6 @@ export const useSettingsStore = defineStore('settingsStore', () => { searchInput, init, updateViewData, - setViewModule - } -}) + setViewModule, + }; +}); diff --git a/frontend/src/views/Store/ExtensionCard.vue b/frontend/src/views/Store/ExtensionCard.vue index 472f51f..e9f1d19 100644 --- a/frontend/src/views/Store/ExtensionCard.vue +++ b/frontend/src/views/Store/ExtensionCard.vue @@ -10,137 +10,139 @@ import { StoreService, type nb_cli_plugin_webui__app__models__base__ModuleInfo, - type nb_cli_plugin_webui__app__models__store__Plugin -} from '@/client/api' -import type { PypiInfo } from '@/views/Store/types' -import { useFetch } from '@vueuse/core' -import { computed, ref } from 'vue' -import { useSearchStore } from './client' -import { useNoneBotStore, useToastStore } from '@/stores' -import LogView from '@/components/Modals/Global/LogView.vue' -import router from '@/router' + type nb_cli_plugin_webui__app__models__store__Plugin, +} from "@/client/api"; +import type { PypiInfo } from "@/views/Store/types"; +import { useFetch } from "@vueuse/core"; +import { computed, ref } from "vue"; +import { useSearchStore } from "./client"; +import { useNoneBotStore, useToastStore } from "@/stores"; +import LogView from "@/components/Modals/Global/LogView.vue"; +import router from "@/router"; const store = useSearchStore(), - nonebotStore = useNoneBotStore() + nonebotStore = useNoneBotStore(); -const toast = useToastStore() +const toast = useToastStore(); const props = defineProps<{ - data: T -}>() + data: T; +}>(); const extensionCardModal = ref(), pypiData = ref(), logViewModal = ref | null>(), - installLogKey = ref(''), - extensionUninstallConfirmModal = ref() + installLogKey = ref(""), + extensionUninstallConfirmModal = ref(); const open = async () => { - extensionCardModal.value?.showModal() + extensionCardModal.value?.showModal(); - const pypiURL = `https://pypi.org/pypi/${props.data.project_link}/json` - const { data } = await useFetch(pypiURL).json() - if (data.value) pypiData.value = data.value -} + const pypiURL = `https://pypi.org/pypi/${props.data.project_link}/json`; + const { data } = await useFetch(pypiURL).json(); + if (data.value) pypiData.value = data.value; +}; const isTestPassed = (data: T): boolean => { - if ('valid' in data && 'skip_test' in data) { - return data.valid && !data.skip_test + if ("valid" in data && "skip_test" in data) { + return data.valid && !data.skip_test; } - return false -} + return false; +}; const installModule = async (module: T) => { - if (!nonebotStore.selectedBot || !module) return + if (!nonebotStore.selectedBot || !module) return; - const moduleType = 'valid' in module ? 'plugin' : 'module' + const moduleType = "valid" in module ? "plugin" : "module"; - const { data, error } = await StoreService.installNonebotModuleV1StoreNonebotInstallPost({ - query: { - env: nonebotStore.selectedBot.use_env!, - project_id: nonebotStore.selectedBot.project_id - }, + const { data, error } = + await StoreService.installNonebotModuleV1StoreNonebotInstallPost({ + query: { + env: nonebotStore.selectedBot.use_env!, + project_id: nonebotStore.selectedBot.project_id, + }, - // TODO: 正常 Module 同 Plugin 拓展数据冲突, 待修复 - // @ts-ignore - body: { - ...module, - module_type: moduleType - } - }) + // TODO: 正常 Module 同 Plugin 拓展数据冲突, 待修复 + // @ts-ignore + body: { + ...module, + module_type: moduleType, + }, + }); if (error) { - toast.add('error', `提交安装失败, 原因:${error.detail?.toString()}`, '', 5000) + toast.add("error", `提交安装失败, 原因:${error.detail?.toString()}`, "", 5000); } if (data) { - installLogKey.value = data.detail - logViewModal.value?.openModal() + installLogKey.value = data.detail; + logViewModal.value?.openModal(); } -} +}; const uninstallModule = async (module: T) => { - if (!nonebotStore.selectedBot || !module) return - if (!module.is_download) return - - const moduleType = 'valid' in module ? 'plugin' : 'module' - - const { data, error } = await StoreService.uninstallNonebotModuleV1StoreNonebotUninstallPost({ - query: { - env: nonebotStore.selectedBot.use_env!, - project_id: nonebotStore.selectedBot.project_id - }, - - // TODO: 正常 Module 同 Plugin 拓展数据冲突, 待修复 - // @ts-ignore - body: { - ...module, - module_type: moduleType - } - }) + if (!nonebotStore.selectedBot || !module) return; + if (!module.is_download) return; + + const moduleType = "valid" in module ? "plugin" : "module"; + + const { data, error } = + await StoreService.uninstallNonebotModuleV1StoreNonebotUninstallPost({ + query: { + env: nonebotStore.selectedBot.use_env!, + project_id: nonebotStore.selectedBot.project_id, + }, + + // TODO: 正常 Module 同 Plugin 拓展数据冲突, 待修复 + // @ts-ignore + body: { + ...module, + module_type: moduleType, + }, + }); if (error) { - toast.add('error', `卸载失败, 原因:${error.detail?.toString()}`, '', 5000) + toast.add("error", `卸载失败, 原因:${error.detail?.toString()}`, "", 5000); } if (data) { - extensionUninstallConfirmModal.value?.close() - await store.updateData(nonebotStore.selectedBot.project_id, false) - toast.add('success', '卸载成功', '', 5000) + extensionUninstallConfirmModal.value?.close(); + await store.updateData(nonebotStore.selectedBot.project_id, false); + toast.add("success", "卸载成功", "", 5000); } -} +}; const isRetry = () => { - installModule(props.data) -} + installModule(props.data); +}; const isFinished = async () => { - await store.updateData(nonebotStore.selectedBot!.project_id, false) -} + await store.updateData(nonebotStore.selectedBot!.project_id, false); +}; const getUpdateTime = computed(() => { - if (!('time' in props.data)) return 'ignore' + if (!("time" in props.data)) return "ignore"; - const time = new Date(props.data.time) - const now = new Date() - const diff = now.getTime() - time.getTime() - const diffHours = diff / (1000 * 60 * 60) - const diffDays = diff / (1000 * 60 * 60 * 24) - const diffMonths = diff / (1000 * 60 * 60 * 24 * 30) - const diffYears = diff / (1000 * 60 * 60 * 24 * 365) + const time = new Date(props.data.time); + const now = new Date(); + const diff = now.getTime() - time.getTime(); + const diffHours = diff / (1000 * 60 * 60); + const diffDays = diff / (1000 * 60 * 60 * 24); + const diffMonths = diff / (1000 * 60 * 60 * 24 * 30); + const diffYears = diff / (1000 * 60 * 60 * 24 * 365); if (diffYears >= 1) { - return `${Math.floor(diffYears)}年前` + return `${Math.floor(diffYears)}年前`; } else if (diffMonths >= 1) { - return `${Math.floor(diffMonths)}个月前` + return `${Math.floor(diffMonths)}个月前`; } else if (diffDays >= 1) { - return `${Math.floor(diffDays)}天前` + return `${Math.floor(diffDays)}天前`; } else if (diffHours >= 1) { - return `${Math.floor(diffHours)}小时前` + return `${Math.floor(diffHours)}小时前`; } else { - return '刚刚' + return "刚刚"; } -}) +}); @@ -157,7 +159,9 @@ const getUpdateTime = computed(() => { 确定 - 取消 + + 取消 + @@ -208,7 +212,9 @@ const getUpdateTime = computed(() => { > 卸载 - 安装 + + 安装 + @@ -218,7 +224,10 @@ const getUpdateTime = computed(() => { {{ props.data.desc }} - + { file_save - {{ (pypiData?.releases[Object.keys(pypiData.releases).pop()!][1].size ?? 0) / 1000 }} + {{ + (pypiData?.releases[Object.keys(pypiData.releases).pop()!][1].size ?? 0) / + 1000 + }} K @@ -348,7 +360,7 @@ const getUpdateTime = computed(() => { @click=" store.updateTag({ label: 'author', - text: props.data.author + text: props.data.author, }) " > @@ -369,7 +381,7 @@ const getUpdateTime = computed(() => { @click=" store.updateTag({ label: 'tag', - text: tag.label + text: tag.label, }) " > @@ -407,7 +419,9 @@ const getUpdateTime = computed(() => { > 设置 - 安装 + + 安装 + diff --git a/frontend/src/views/Store/ExtensionContainer.vue b/frontend/src/views/Store/ExtensionContainer.vue index fe549df..002bac7 100644 --- a/frontend/src/views/Store/ExtensionContainer.vue +++ b/frontend/src/views/Store/ExtensionContainer.vue @@ -1,8 +1,8 @@ diff --git a/frontend/src/views/Store/Pagination.vue b/frontend/src/views/Store/Pagination.vue index f041118..4078952 100644 --- a/frontend/src/views/Store/Pagination.vue +++ b/frontend/src/views/Store/Pagination.vue @@ -1,45 +1,49 @@ @@ -49,12 +53,14 @@ watch( :class="{ 'btn btn-sm shadow-none px-1': true, 'btn-disabled': store.nowPage <= 1, - hidden: store.storeData.length <= 0 + hidden: store.storeData.length <= 0, }" > chevron_left @@ -65,12 +71,12 @@ watch( :key="page" :class="{ 'btn btn-sm shadow-none': true, - 'btn-primary text-base-100': Number(page) === store.nowPage + 'btn-primary text-base-100': Number(page) === store.nowPage, }" @click=" () => { if (typeof page === 'number' && nonebotStore.selectedBot) { - store.turnPage(page, nonebotStore.selectedBot?.project_id) + store.turnPage(page, nonebotStore.selectedBot?.project_id); } } " @@ -82,9 +88,11 @@ watch( :class="{ 'btn btn-sm shadow-none px-1': true, 'btn-disabled': store.nowPage >= store.totalPage, - hidden: store.storeData.length <= 0 + hidden: store.storeData.length <= 0, }" - @click="store.turnPage(store.nowPage + 1, nonebotStore.selectedBot?.project_id ?? '')" + @click=" + store.turnPage(store.nowPage + 1, nonebotStore.selectedBot?.project_id ?? '') + " > chevron_right @@ -95,9 +103,9 @@ watch( diff --git a/frontend/src/views/Store/SearchBar.vue b/frontend/src/views/Store/SearchBar.vue index 897ebde..41b3a29 100644 --- a/frontend/src/views/Store/SearchBar.vue +++ b/frontend/src/views/Store/SearchBar.vue @@ -1,121 +1,129 @@ - + - + {{ filter.tip }} @@ -202,11 +217,11 @@ const filterItems: filterItem[] = [ placeholder="请键入" class="input input-sm input-bordered" @keydown.enter=" - store.updateTag({ + (store.updateTag({ label: 'author', - text: authorInput + text: authorInput, }), - (authorInput = '') + (authorInput = '')) " /> @@ -225,11 +240,11 @@ const filterItems: filterItem[] = [ placeholder="请键入" class="input input-sm input-bordered" @keydown.enter=" - store.updateTag({ + (store.updateTag({ label: 'tag', - text: labelInput + text: labelInput, }), - (labelInput = '') + (labelInput = '')) " /> diff --git a/frontend/src/views/Store/StoreIndex.vue b/frontend/src/views/Store/StoreIndex.vue index 7408b9b..f2538be 100644 --- a/frontend/src/views/Store/StoreIndex.vue +++ b/frontend/src/views/Store/StoreIndex.vue @@ -1,23 +1,23 @@ diff --git a/frontend/src/views/Store/client.ts b/frontend/src/views/Store/client.ts index abe67cf..776e650 100644 --- a/frontend/src/views/Store/client.ts +++ b/frontend/src/views/Store/client.ts @@ -4,122 +4,127 @@ import { type nb_cli_plugin_webui__app__models__store__Plugin, StoreService, type ModuleType, - type nb_cli_plugin_webui__app__models__store__SearchTag -} from '@/client/api' -import { useToastStore } from '@/stores' -import { defineStore } from 'pinia' -import { ref } from 'vue' + type nb_cli_plugin_webui__app__models__store__SearchTag, +} from "@/client/api"; +import { useToastStore } from "@/stores"; +import { defineStore } from "pinia"; +import { ref } from "vue"; -const toast = useToastStore() +const toast = useToastStore(); -export const useSearchStore = defineStore('storeSearchStore', () => { - const searchInput = ref(''), +export const useSearchStore = defineStore("storeSearchStore", () => { + const searchInput = ref(""), searchTags = ref([]), - storeData = ref<(nb_cli_plugin_webui__app__models__store__Plugin | Adapter | Driver)[]>([]), + storeData = ref< + (nb_cli_plugin_webui__app__models__store__Plugin | Adapter | Driver)[] + >([]), nowPage = ref(1), totalPage = ref(1), totalItem = ref(0), - viewModule = ref('plugin'), - isRequesting = ref(false) + viewModule = ref("plugin"), + isRequesting = ref(false); const clear = () => { - searchInput.value = '' - searchTags.value = [] - storeData.value = [] - nowPage.value = 1 - totalPage.value = 1 - totalItem.value = 0 - } + searchInput.value = ""; + searchTags.value = []; + storeData.value = []; + nowPage.value = 1; + totalPage.value = 1; + totalItem.value = 0; + }; const isTagExisted = (tag: nb_cli_plugin_webui__app__models__store__SearchTag) => { - return searchTags.value.some((t) => t.label === tag.label && t.text === tag.text) - } + return searchTags.value.some((t) => t.label === tag.label && t.text === tag.text); + }; const removeTag = (tag: nb_cli_plugin_webui__app__models__store__SearchTag) => { - const index = searchTags.value.findIndex((t) => t.label === tag.label && t.text === tag.text) + const index = searchTags.value.findIndex( + (t) => t.label === tag.label && t.text === tag.text, + ); if (index !== -1) { - searchTags.value.splice(index, 1) + searchTags.value.splice(index, 1); } - } + }; const updateTag = (tag: nb_cli_plugin_webui__app__models__store__SearchTag) => { if (isTagExisted(tag)) { - removeTag(tag) + removeTag(tag); } else { - searchTags.value.push(tag) + searchTags.value.push(tag); } - } + }; const updateData = async (projectID: string, isShowAll: boolean) => { - isRequesting.value = true - const isSearch = searchInput.value !== '' || searchTags.value.length > 0 + isRequesting.value = true; + const isSearch = searchInput.value !== "" || searchTags.value.length > 0; const { data, error } = await StoreService.getNonebotStoreItemsV1StoreNonebotListGet({ query: { module_type: viewModule.value, page: nowPage.value, is_search: isSearch, show_all: isShowAll, - project_id: projectID - } - }) + project_id: projectID, + }, + }); if (error) { - toast.add('error', `获取商店数据失败, 原因:${error.detail?.toString()}`, '', 5000) + toast.add("error", `获取商店数据失败, 原因:${error.detail?.toString()}`, "", 5000); } if (data) { - storeData.value = data.detail - totalPage.value = data.total_page - totalItem.value = data.total_item + storeData.value = data.detail; + totalPage.value = data.total_page; + totalItem.value = data.total_item; } - isRequesting.value = false - } + isRequesting.value = false; + }; const selectModule = async (module: ModuleType, projectID: string) => { - viewModule.value = module - clear() - await updateData(projectID, false) - } + viewModule.value = module; + clear(); + await updateData(projectID, false); + }; const turnPage = async (page: number, projectID: string) => { - nowPage.value = page >= 0 ? page : 0 + nowPage.value = page >= 0 ? page : 0; if (page >= totalPage.value) { - nowPage.value = totalPage.value + nowPage.value = totalPage.value; } - await updateData(projectID, false) - } + await updateData(projectID, false); + }; const upDataBySearch = async (projectID: string) => { - isRequesting.value = true - const { data, error } = await StoreService.searchNonebotStoreItemV1StoreNonebotSearchPost({ - query: { - project_id: projectID - }, - body: { - data: { - module_type: viewModule.value, - tags: searchTags.value, - content: searchInput.value - } - } - }) + isRequesting.value = true; + const { data, error } = + await StoreService.searchNonebotStoreItemV1StoreNonebotSearchPost({ + query: { + project_id: projectID, + }, + body: { + data: { + module_type: viewModule.value, + tags: searchTags.value, + content: searchInput.value, + }, + }, + }); if (error) { - toast.add('error', `搜索失败, 原因:${error.detail?.toString()}`, '', 5000) + toast.add("error", `搜索失败, 原因:${error.detail?.toString()}`, "", 5000); } if (data) { - nowPage.value = 1 + nowPage.value = 1; - storeData.value = data.detail - totalPage.value = data.total_page - totalItem.value = data.total_item + storeData.value = data.detail; + totalPage.value = data.total_page; + totalItem.value = data.total_item; } - isRequesting.value = false - } + isRequesting.value = false; + }; return { searchInput, @@ -137,6 +142,6 @@ export const useSearchStore = defineStore('storeSearchStore', () => { updateData, selectModule, turnPage, - upDataBySearch - } -}) + upDataBySearch, + }; +}); diff --git a/frontend/src/views/Store/types.ts b/frontend/src/views/Store/types.ts index be75cdd..06ed7fa 100644 --- a/frontend/src/views/Store/types.ts +++ b/frontend/src/views/Store/types.ts @@ -1,96 +1,96 @@ export interface PypiInfo { - info: Info - last_serial: number - releases: Releases - urls: Url[] - vulnerabilities: any[] + info: Info; + last_serial: number; + releases: Releases; + urls: Url[]; + vulnerabilities: any[]; } interface Info { - author: string - author_email: string - bugtrack_url: any - classifiers: string[] - description: string - description_content_type: string - docs_url: any - download_url: string - downloads: Downloads - dynamic: any - home_page: string - keywords: string - license: string - maintainer: string - maintainer_email: string - name: string - package_url: string - platform: any - project_url: string - project_urls: ProjectUrls - provides_extra: any - release_url: string - requires_dist: string[] - requires_python: string - summary: string - version: string - yanked: boolean - yanked_reason: any + author: string; + author_email: string; + bugtrack_url: any; + classifiers: string[]; + description: string; + description_content_type: string; + docs_url: any; + download_url: string; + downloads: Downloads; + dynamic: any; + home_page: string; + keywords: string; + license: string; + maintainer: string; + maintainer_email: string; + name: string; + package_url: string; + platform: any; + project_url: string; + project_urls: ProjectUrls; + provides_extra: any; + release_url: string; + requires_dist: string[]; + requires_python: string; + summary: string; + version: string; + yanked: boolean; + yanked_reason: any; } interface Downloads { - last_day: number - last_month: number - last_week: number + last_day: number; + last_month: number; + last_week: number; } interface ProjectUrls { - Documentation: string - Homepage: string - Repository: string + Documentation: string; + Homepage: string; + Repository: string; } interface Releases { - [key: string]: ReleaseInfo[] + [key: string]: ReleaseInfo[]; } interface ReleaseInfo { - comment_text: string - digests: Digests - downloads: number - filename: string - has_sig: boolean - md5_digest: string - packagetype: string - python_version: string - requires_python: string - size: number - upload_time: string - upload_time_iso_8601: string - url: string - yanked: boolean - yanked_reason: any + comment_text: string; + digests: Digests; + downloads: number; + filename: string; + has_sig: boolean; + md5_digest: string; + packagetype: string; + python_version: string; + requires_python: string; + size: number; + upload_time: string; + upload_time_iso_8601: string; + url: string; + yanked: boolean; + yanked_reason: any; } interface Digests { - blake2b_256: string - md5: string - sha256: string + blake2b_256: string; + md5: string; + sha256: string; } interface Url { - comment_text: string - digests: Digests - downloads: number - filename: string - has_sig: boolean - md5_digest: string - packagetype: string - python_version: string - requires_python: string - size: number - upload_time: string - upload_time_iso_8601: string - url: string - yanked: boolean - yanked_reason: any + comment_text: string; + digests: Digests; + downloads: number; + filename: string; + has_sig: boolean; + md5_digest: string; + packagetype: string; + python_version: string; + requires_python: string; + size: number; + upload_time: string; + upload_time_iso_8601: string; + url: string; + yanked: boolean; + yanked_reason: any; } diff --git a/frontend/src/views/ViewIndex.vue b/frontend/src/views/ViewIndex.vue index 858d6aa..c7df28e 100644 --- a/frontend/src/views/ViewIndex.vue +++ b/frontend/src/views/ViewIndex.vue @@ -1,8 +1,8 @@ diff --git a/frontend/src/views/WelcomeItem.vue b/frontend/src/views/WelcomeItem.vue index aa1426f..44d1f55 100644 --- a/frontend/src/views/WelcomeItem.vue +++ b/frontend/src/views/WelcomeItem.vue @@ -1,13 +1,13 @@ @@ -31,7 +31,9 @@ const addBotModal = ref | null>() class="p-4 border border-base-content/25 rounded-box flex flex-col gap-2 md:gap-4 transition hover:shadow-lg" > 阅读文档 - 查看文档以解决有关 NoneBot 的大部分疑问。 + + 查看文档以解决有关 NoneBot 的大部分疑问。 + str: diff --git a/nb_cli_plugin_webui/app/handlers/process/utils.py b/nb_cli_plugin_webui/app/handlers/process/utils.py index a943fd5..587f51f 100644 --- a/nb_cli_plugin_webui/app/handlers/process/utils.py +++ b/nb_cli_plugin_webui/app/handlers/process/utils.py @@ -9,9 +9,9 @@ class ProcessFuncWithLog: def __init__(self, log: LogStorage) -> None: self.log = log - self.queue: List[ - Tuple[Callable[..., Any], Tuple[Any, ...], Dict[str, Any]] - ] = list() + self.queue: List[Tuple[Callable[..., Any], Tuple[Any, ...], Dict[str, Any]]] = ( + list() + ) async def _err_parse( self, err: Exception, additional_err_msg: Optional[str] = None diff --git a/nb_cli_plugin_webui/app/handlers/store.py b/nb_cli_plugin_webui/app/handlers/store.py index 622a904..1c179e5 100644 --- a/nb_cli_plugin_webui/app/handlers/store.py +++ b/nb_cli_plugin_webui/app/handlers/store.py @@ -32,25 +32,21 @@ @overload async def load_module_data( module_type: Literal[ModuleType.PLUGIN], - ) -> List[Plugin]: - ... + ) -> List[Plugin]: ... @overload async def load_module_data( module_type: Literal[ModuleType.ADAPTER], - ) -> List[Adapter]: - ... + ) -> List[Adapter]: ... @overload async def load_module_data( module_type: Literal[ModuleType.DRIVER], - ) -> List[Driver]: - ... + ) -> List[Driver]: ... async def load_module_data( module_type: ModuleType, - ) -> Union[List[Plugin], List[Adapter], List[Driver]]: - ... + ) -> Union[List[Plugin], List[Adapter], List[Driver]]: ... else:
+
跨平台 PYTHON 异步机器人框架