From eecb87a325c9740c697b893cae586e3fd6f0e2f9 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Sat, 16 Nov 2024 11:15:55 +0800 Subject: [PATCH] chore: added *.d.ts files --- src/layouts/content/list/ListLayout.vue | 2 - typings/interfaces/i18n/components/role.d.ts | 7 ++ typings/interfaces/i18n/views/roles.d.ts | 11 +++ typings/interfaces/models/dependency.d.ts | 73 +++++++++++++++ typings/interfaces/models/role.d.ts | 9 ++ .../interfaces/store/modules/dependency.d.ts | 92 +++++++++++++++++++ typings/interfaces/store/modules/role.d.ts | 23 +++++ 7 files changed, 215 insertions(+), 2 deletions(-) create mode 100644 typings/interfaces/i18n/components/role.d.ts create mode 100644 typings/interfaces/i18n/views/roles.d.ts create mode 100644 typings/interfaces/models/dependency.d.ts create mode 100644 typings/interfaces/models/role.d.ts create mode 100644 typings/interfaces/store/modules/dependency.d.ts create mode 100644 typings/interfaces/store/modules/role.d.ts diff --git a/src/layouts/content/list/ListLayout.vue b/src/layouts/content/list/ListLayout.vue index 55fdc362dbe7f..fe0d5d3bdc584 100644 --- a/src/layouts/content/list/ListLayout.vue +++ b/src/layouts/content/list/ListLayout.vue @@ -283,8 +283,6 @@ defineOptions({ name: 'ClListLayout' }); .nav-action-group { .nav-action-item { - margin-right: 10px; - #filter-search { width: 200px; } diff --git a/typings/interfaces/i18n/components/role.d.ts b/typings/interfaces/i18n/components/role.d.ts new file mode 100644 index 0000000000000..86fc1d9b3bb21 --- /dev/null +++ b/typings/interfaces/i18n/components/role.d.ts @@ -0,0 +1,7 @@ +interface LComponentsRole { + form: { + name: string; + description: string; + pages: string; + }; +} diff --git a/typings/interfaces/i18n/views/roles.d.ts b/typings/interfaces/i18n/views/roles.d.ts new file mode 100644 index 0000000000000..8d5c4e8537204 --- /dev/null +++ b/typings/interfaces/i18n/views/roles.d.ts @@ -0,0 +1,11 @@ +interface LViewsRoles { + table: { + columns: { + name: string; + description: string; + pages: string; + users: string; + }; + }; + navActions: LNavActions; +} diff --git a/typings/interfaces/models/dependency.d.ts b/typings/interfaces/models/dependency.d.ts new file mode 100644 index 0000000000000..8a1c407f24de8 --- /dev/null +++ b/typings/interfaces/models/dependency.d.ts @@ -0,0 +1,73 @@ +export declare global { + interface DependencySetting extends BaseModel { + key?: string; + name?: string; + description?: string; + enabled?: boolean; + cmd?: string; + proxy?: string; + last_update_ts?: string; + } + + type DependencyStatus = + | 'installing' + | 'installed' + | 'uninstalling' + | 'uninstalled' + | 'error' + | 'abnormal'; + + type DependencyFileType = 'requirements.txt' | 'package.json'; + + interface Dependency extends BaseModel { + node_id?: string; + type?: string; + name?: string; + version?: string; + latest_version?: string; + description?: string; + status?: DependencyStatus; + error?: string; + } + + interface DependencyRepo { + name?: string; + node_ids?: string[]; + versions?: string[]; + latest_version?: string; + type?: DependencyLang; + dependencies?: Dependency[]; + } + + interface DependencyRequirement { + name?: string; + version?: string; + dependencies?: Dependency[]; + latest_version?: string; + type?: DependencyLang; + } + + type DependencyRepoTabName = 'installed' | 'search'; + + interface DependencyLog extends BaseModel { + dependency_id?: string; + content?: string; + } + + interface DependencyInstallForm { + mode?: 'all' | 'selected-nodes'; + name?: string; + version?: string; + node_ids?: string[]; + nodes?: CNode[]; + } + + interface DependencyUninstallForm { + mode?: string; + names?: string[]; + node_ids?: string[]; + nodes?: CNode[]; + } + + type DependencyLang = 'python' | 'node'; +} diff --git a/typings/interfaces/models/role.d.ts b/typings/interfaces/models/role.d.ts new file mode 100644 index 0000000000000..421c5c393390f --- /dev/null +++ b/typings/interfaces/models/role.d.ts @@ -0,0 +1,9 @@ +export declare global { + interface Role extends BaseModel { + name?: string; + description?: string; + routes?: string[]; + root_admin?: boolean; + users?: number; + } +} diff --git a/typings/interfaces/store/modules/dependency.d.ts b/typings/interfaces/store/modules/dependency.d.ts new file mode 100644 index 0000000000000..eec18341ff40b --- /dev/null +++ b/typings/interfaces/store/modules/dependency.d.ts @@ -0,0 +1,92 @@ +export declare global { + type DependencyStoreModule = BaseModule< + DependencyStoreState, + DependencyStoreGetters, + DependencyStoreMutations, + DependencyStoreActions + >; + + interface DependencyStoreState extends BaseStoreState { + lang: DependencyLang; + searchQuery: string; + repoTabName: DependencyRepoTabName; + searchRepoTableLoading: boolean; + searchRepoTableData: TableData; + searchRepoTableTotal: number; + searchRepoTablePagination: TablePagination; + installForm: DependencyInstallForm; + installLoading: boolean; + uninstallForm: DependencyUninstallForm; + uninstallLoading: boolean; + versions: string[]; + getVersionsLoading: boolean; + activeDependency?: Dependency; + activeDependencyLogs: DependencyLog[]; + } + + interface DependencyStoreGetters + extends BaseStoreGetters {} + + interface DependencyStoreMutations + extends BaseStoreMutations { + setLang: (state: DependencyStoreState, lang: DependencyLang) => void; + setSearchQuery: (state: DependencyStoreState, query: string) => void; + setRepoTabName: ( + state: DependencyStoreState, + name: DependencyRepoTabName + ) => void; + setSearchRepoTableLoading: ( + state: DependencyStoreState, + loading: boolean + ) => void; + setSearchRepoTableData: ( + state: DependencyStoreState, + data: TableDataWithTotal + ) => void; + resetSearchRepoTableData: (state: DependencyStoreState) => void; + setSearchRepoTablePagination: ( + state: DependencyStoreState, + pagination: TablePagination + ) => void; + resetSearchRepoTablePagination: (state: DependencyStoreState) => void; + setInstallForm: ( + state: DependencyStoreState, + form: DependencyInstallForm + ) => void; + resetInstallForm: (state: DependencyStoreState) => void; + setInstallLoading: (state: DependencyStoreState, loading: boolean) => void; + setUninstallForm: ( + state: DependencyStoreState, + form: DependencyUninstallForm + ) => void; + resetUninstallForm: (state: DependencyStoreState) => void; + setUninstallLoading: ( + state: DependencyStoreState, + loading: boolean + ) => void; + setVersions: (state: DependencyStoreState, versions: string[]) => void; + resetVersions: (state: DependencyStoreState) => void; + setGetVersionsLoading: ( + state: DependencyStoreState, + loading: boolean + ) => void; + setActiveDependency: ( + state: DependencyStoreState, + dependency: Dependency + ) => void; + resetActiveDependency: (state: DependencyStoreState) => void; + setActiveDependencyLogs: ( + state: DependencyStoreState, + logs: DependencyLog[] + ) => void; + resetActiveDependencyLogs: (state: DependencyStoreState) => void; + } + + interface DependencyStoreActions extends BaseStoreActions { + searchRepoList: StoreAction; + getRepoVersions: StoreAction; + installDependency: StoreAction; + uninstallDependency: StoreAction; + getActiveDependencyLogs: StoreAction; + } +} diff --git a/typings/interfaces/store/modules/role.d.ts b/typings/interfaces/store/modules/role.d.ts new file mode 100644 index 0000000000000..1584a3a19989c --- /dev/null +++ b/typings/interfaces/store/modules/role.d.ts @@ -0,0 +1,23 @@ +export declare global { + type RoleStoreModule = BaseModule< + RoleStoreState, + RoleStoreGetters, + RoleStoreMutations, + RoleStoreActions + >; + + interface RoleStoreState extends BaseStoreState { + pagesCheckAllStatus: CheckboxStatus; + } + + interface RoleStoreGetters extends BaseStoreGetters {} + + interface RoleStoreMutations extends BaseStoreMutations { + setPagesCheckAllStatus: ( + state: RoleStoreState, + status: CheckboxStatus + ) => void; + } + + interface RoleStoreActions extends BaseStoreActions {} +}