Skip to content

Commit

Permalink
fix: unable to install deps in spider tab
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Jun 15, 2024
1 parent 6bc1c0c commit e20af1b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/views/deps/components/form/InstallForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export default defineComponent({
if (!props.visible) return;
versionsLoading.value = true;
try {
console.debug('getVersions', props.names[0])
const res = await get(`${endpointL}/${props.lang}/${props.names[0]}/versions`)
versions.value = res.data;
if (versions.value.length > 0) {
Expand Down
17 changes: 16 additions & 1 deletion src/views/deps/spider/DependencySpiderTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
/>
<cl-install-form
:visible="dialogVisible.install"
:lang="lang"
:nodes="allNodes"
:names="installForm.names"
@confirm="onInstall"
Expand All @@ -47,7 +48,7 @@
</template>

<script lang="ts">
import {computed, defineComponent, h, onMounted, ref} from 'vue';
import {computed, defineComponent, h, onMounted, ref, watch} from 'vue';
import {useRoute} from 'vue-router';
import {useStore} from 'vuex';
import {ElMessage, ElMessageBox} from 'element-plus';
Expand Down Expand Up @@ -234,6 +235,8 @@ export default defineComponent({
onMounted(getSpiderData);
watch(() => route.params.id, getSpiderData);
const spiderDataDependencyTypeLabel = computed(() => {
switch (spiderData.value.dependency_type) {
case 'requirements.txt':
Expand Down Expand Up @@ -266,6 +269,17 @@ export default defineComponent({
}
});
const lang = computed(() => {
switch (spiderData.value.dependency_type) {
case 'requirements.txt':
return 'python';
case 'package.json':
return 'node';
default:
return '';
}
});
const installForm = ref<EnvDepsInstallPayload>({
names: [],
});
Expand Down Expand Up @@ -362,6 +376,7 @@ export default defineComponent({
onDialogClose,
onInstall,
onUninstall,
lang,
dialogVisible,
installForm,
uninstallForm,
Expand Down

0 comments on commit e20af1b

Please sign in to comment.