From e42dc9c759a8d6c8e4077e1d670e5c33307393f2 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Fri, 3 Jan 2020 10:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BE=9D=E8=B5=96=E5=AE=89?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Node/NodeInstallation.vue | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/Node/NodeInstallation.vue b/frontend/src/components/Node/NodeInstallation.vue index df487434..320b0b7f 100644 --- a/frontend/src/components/Node/NodeInstallation.vue +++ b/frontend/src/components/Node/NodeInstallation.vue @@ -7,7 +7,7 @@ style="width: 240px" :placeholder="$t('Search Dependencies')" :fetchSuggestions="fetchAllDepList" - minlength="2" + :minlength="2" @select="onSearch" /> @@ -134,6 +134,13 @@ export default { }) this.loading = false this.depList = res.data.data.sort((a, b) => a.name > b.name ? 1 : -1) + this.depList.map(async dep => { + this.$set(dep, 'loading', true) + const res = await this.$request.get(`/system/deps/${this.activeLang.executable_name}/${dep.name}/json`) + dep.version = res.data.data.version + dep.description = res.data.data.description + this.$set(dep, 'loading', false) + }) }, async getInstalledDepList () { this.loading = true @@ -144,8 +151,7 @@ export default { this.installedDepList = res.data.data }, async fetchAllDepList (queryString, callback) { - const res = await this.$request.get('/system/deps', { - lang: this.activeLang.executable_name, + const res = await this.$request.get(`/system/deps/${this.activeLang.executable_name}`, { dep_name: queryString }) callback(res.data.data ? res.data.data.map(d => { @@ -229,7 +235,13 @@ export default {