mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-06-16 21:03:58 +08:00
9fae287148
- Implemented PluginStorePage component for displaying available plugins. - Added functionality to install and update plugins with user confirmation. - Integrated plugin store API for fetching plugin data and handling installations. - Enhanced PluginsPage to navigate to the new Plugin Store. - Updated localization files for new plugin store strings in English, Russian, and Chinese. - Added new types for plugin store entries and responses in TypeScript. - Improved UI components and styles for better user experience in the plugin store.
87 lines
1.6 KiB
TypeScript
87 lines
1.6 KiB
TypeScript
export type PluginConfigFieldType =
|
|
| 'string'
|
|
| 'number'
|
|
| 'integer'
|
|
| 'boolean'
|
|
| 'enum'
|
|
| 'array'
|
|
| 'object';
|
|
|
|
export interface PluginConfigField {
|
|
name: string;
|
|
type: PluginConfigFieldType | string;
|
|
enumValues: string[];
|
|
description: string;
|
|
}
|
|
|
|
export interface PluginMetadata {
|
|
name: string;
|
|
version: string;
|
|
author: string;
|
|
githubRepository: string;
|
|
logo: string;
|
|
configFields: PluginConfigField[];
|
|
}
|
|
|
|
export interface PluginMenu {
|
|
path: string;
|
|
menu: string;
|
|
description: string;
|
|
}
|
|
|
|
export interface PluginListEntry {
|
|
id: string;
|
|
path: string;
|
|
configured: boolean;
|
|
registered: boolean;
|
|
enabled: boolean;
|
|
effectiveEnabled: boolean;
|
|
supportsOAuth: boolean;
|
|
logo: string;
|
|
configFields: PluginConfigField[];
|
|
menus: PluginMenu[];
|
|
metadata: PluginMetadata | null;
|
|
}
|
|
|
|
export interface PluginListResponse {
|
|
pluginsEnabled: boolean;
|
|
pluginsDir: string;
|
|
plugins: PluginListEntry[];
|
|
}
|
|
|
|
export interface PluginStoreEntry {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
author: string;
|
|
version: string;
|
|
repository: string;
|
|
logo: string;
|
|
homepage: string;
|
|
license: string;
|
|
tags: string[];
|
|
installed: boolean;
|
|
installedVersion: string;
|
|
path: string;
|
|
configured: boolean;
|
|
registered: boolean;
|
|
enabled: boolean;
|
|
effectiveEnabled: boolean;
|
|
updateAvailable: boolean;
|
|
}
|
|
|
|
export interface PluginStoreResponse {
|
|
pluginsEnabled: boolean;
|
|
pluginsDir: string;
|
|
plugins: PluginStoreEntry[];
|
|
}
|
|
|
|
export interface PluginStoreInstallResult {
|
|
status: string;
|
|
id: string;
|
|
version: string;
|
|
path: string;
|
|
pluginsEnabled: boolean;
|
|
restartRequired: boolean;
|
|
}
|