Skip to content

Commit

Permalink
refactor: simplify installConfigSetup action and update dependency in…
Browse files Browse the repository at this point in the history
…terface

- Removed the id parameter from the installConfigSetup action in the dependency module.
- Updated the API endpoint in the installConfigSetup action to remove the id from the URL.
- Changed the commit action in useDependencyList to show a dialog instead of setting a tab name.

These changes streamline the dependency installation process and improve the user interface interactions.
  • Loading branch information
tikazyq committed Dec 21, 2024
1 parent 8c8017b commit e20d560
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/interfaces/store/modules/dependency.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@ export declare global {
getDependencyConfig: StoreAction<DependencyStoreState>;
saveDependencyConfig: StoreAction<DependencyStoreState>;
getConfigSetupList: StoreAction<DependencyStoreState>;
installConfigSetup: StoreAction<DependencyStoreState, { id: string }>;
installConfigSetup: StoreAction<DependencyStoreState>;
}
}
10 changes: 5 additions & 5 deletions src/store/modules/dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,10 @@ const actions = {
commit('setConfigSetupTableLoading', false);
}
},
installConfigSetup: async (
{ state, commit }: StoreActionContext<DependencyStoreState>,
{ id }: { id: string }
) => {
installConfigSetup: async ({
state,
commit,
}: StoreActionContext<DependencyStoreState>) => {
const { lang, setupForm } = state;
const { node_id, version, mode, node_ids } = setupForm;
let payload: Record<string, any> = {
Expand All @@ -440,7 +440,7 @@ const actions = {
}
commit('setSetupLoading', true);
try {
await post(`${endpoint}/configs/${lang}/setups/${id}/install`, payload);
await post(`${endpoint}/configs/${lang}/setups/install`, payload);
ElMessage.success(t('common.message.success.startInstall'));
} catch (e: any) {
ElMessage.error(e.message);
Expand Down
2 changes: 1 addition & 1 deletion src/views/dependency/list/useDependencyList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ const useDependencyList = () => {
};

const onClickTableEmptyConfigNotSetup = () => {
store.commit(`${ns}/setRepoTabName`, 'nodes');
store.commit(`${ns}/showDialog`, 'setup');
};

const onClickTableEmptyJava = async () => {
Expand Down

0 comments on commit e20d560

Please sign in to comment.