Skip to content

Commit

Permalink
feat: enhance dependency setup and UI components
Browse files Browse the repository at this point in the history
- Removed unnecessary condition from confirm button in DependencySetupDialog.
- Adjusted CSS in NavActionGroup to prevent wrapping of items.
- Added custom scrollbar styles in NavActions for better visibility.
- Introduced new 'Install Envs' action in dependency management with corresponding labels and tooltips in English and Chinese.
- Updated interface definitions to include 'installEnvironments' for better type safety.
- Refined label selector in ListLayout for improved styling consistency.
- Added a new button for installing environments in useDependencyList with appropriate actions.
  • Loading branch information
tikazyq committed Dec 21, 2024
1 parent b1d23f5 commit 304422e
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/components/core/dependency/DependencySetupDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const loading = computed(() => state.setupLoading);
const confirmButtonDisabled = computed(() => {
if (loading.value) return true;
if (!activeConfigSetup.value?._id) return true;
return toInstallNodes.value.length === 0;
});
const onConfirm = async () => {
Expand Down
1 change: 0 additions & 1 deletion src/components/ui/nav/NavActionGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ defineOptions({ name: 'ClNavActionGroup' });
align-items: start;
gap: 10px;
box-sizing: border-box;
flex-wrap: wrap;
position: relative;
margin-right: 10px;
Expand Down
24 changes: 24 additions & 0 deletions src/components/ui/nav/NavActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,29 @@ defineOptions({ name: 'ClNavActions' });
&.unmounted {
position: absolute;
}
&:hover {
&::-webkit-scrollbar {
display: block;
}
}
&::-webkit-scrollbar {
height: 4px;
display: none;
}
&::-webkit-scrollbar-thumb {
border-radius: 2px;
background-color: var(
--el-scrollbar-bg-color,
var(--el-text-color-secondary)
);
}
&::-webkit-scrollbar-track {
border-radius: 2px;
background-color: var(--el-fill-color-light);
}
}
</style>
4 changes: 4 additions & 0 deletions src/i18n/lang/en/views/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const env: LViewsEnv = {
label: 'Search Dependencies',
tooltip: 'Search and install dependencies',
},
installEnvironments: {
label: 'Install Envs',
tooltip: 'Install dependency environments (or programming languages)',
},
},
tabs: {
installed: 'Installed',
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/lang/zh/views/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const env: LViewsEnv = {
label: '搜索依赖',
tooltip: '搜索并安装依赖',
},
installEnvironments: {
label: '安装环境',
tooltip: '安装依赖环境(或编程语言)',
},
},
tabs: {
installed: '已安装',
Expand Down
4 changes: 4 additions & 0 deletions src/interfaces/i18n/views/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ interface LViewsEnv {
label: string;
tooltip: string;
};
installEnvironments: {
label: string;
tooltip: string;
};
};
tabs: {
installed: string;
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/content/list/ListLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ defineOptions({ name: 'ClListLayout' });
width: 200px;
}
&:deep(.label) {
&:deep(label.label) {
margin-right: 5px;
font-size: 14px;
}
Expand Down
16 changes: 16 additions & 0 deletions src/views/dependency/list/useDependencyList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,22 @@ const useDependencyList = () => {
store.commit(`${ns}/showDialog`, 'config');
},
},
{
className: 'setup-btn',
buttonType: 'label',
label: t('views.env.deps.repos.actions.installEnvironments.label'),
tooltip: t(
'views.env.deps.repos.actions.installEnvironments.tooltip'
),
icon: ['fa', 'server'],
onClick: async () => {
store.commit(`${ns}/setSetupForm`, {
mode: 'all',
version: state.config?.default_version,
});
store.commit(`${ns}/showDialog`, 'setup');
},
},
],
},
]);
Expand Down

0 comments on commit 304422e

Please sign in to comment.