diff --git a/agent/app/dto/app.go b/agent/app/dto/app.go index ece950c96..db7433236 100644 --- a/agent/app/dto/app.go +++ b/agent/app/dto/app.go @@ -132,19 +132,20 @@ type AppForm struct { } type AppFormFields struct { - Type string `json:"type"` - LabelZh string `json:"labelZh"` - LabelEn string `json:"labelEn"` - Label Locale `json:"label"` - Required bool `json:"required"` - Default interface{} `json:"default"` - EnvKey string `json:"envKey"` - Disabled bool `json:"disabled"` - Edit bool `json:"edit"` - Rule string `json:"rule"` - Multiple bool `json:"multiple"` - Child interface{} `json:"child"` - Values []AppFormValue `json:"values"` + Type string `json:"type"` + LabelZh string `json:"labelZh"` + LabelEn string `json:"labelEn"` + Label Locale `json:"label"` + Description Locale `json:"description"` + Required bool `json:"required"` + Default interface{} `json:"default"` + EnvKey string `json:"envKey"` + Disabled bool `json:"disabled"` + Edit bool `json:"edit"` + Rule string `json:"rule"` + Multiple bool `json:"multiple"` + Child interface{} `json:"child"` + Values []AppFormValue `json:"values"` } type AppFormValue struct { diff --git a/frontend/src/api/interface/app.ts b/frontend/src/api/interface/app.ts index 240daa7e0..7193f9033 100644 --- a/frontend/src/api/interface/app.ts +++ b/frontend/src/api/interface/app.ts @@ -92,6 +92,7 @@ export namespace App { multiple?: boolean; allowCreate?: boolean; label: Locale; + description: Locale; } export interface FromFieldChild extends FromField { diff --git a/frontend/src/utils/util.ts b/frontend/src/utils/util.ts index 532d0852d..8e8a05074 100644 --- a/frontend/src/utils/util.ts +++ b/frontend/src/utils/util.ts @@ -666,6 +666,15 @@ export function getLabel(row: any) { } } +export function getDescription(row: any) { + const language = localStorage.getItem('lang') || 'zh'; + let lang = language == 'tw' ? 'zh-Hant' : language; + if (row.description && row.description[lang] != '') { + return row.description[lang]; + } + return ''; +} + export function emptyLineFilter(str: string, spilt: string) { let list = str.split(spilt); let results = []; diff --git a/frontend/src/views/app-store/detail/params/index.vue b/frontend/src/views/app-store/detail/params/index.vue index d2e3e057a..5732f403d 100644 --- a/frontend/src/views/app-store/detail/params/index.vue +++ b/frontend/src/views/app-store/detail/params/index.vue @@ -116,6 +116,7 @@ + {{ getDescription(p) }} @@ -125,7 +126,7 @@ import { getRandomStr } from '@/utils/util'; import { getAppService } from '@/api/modules/app'; import { Rules } from '@/global/form-rules'; import { App } from '@/api/interface/app'; -import { getDBName, getLabel } from '@/utils/util'; +import { getDBName, getLabel, getDescription } from '@/utils/util'; import { getPathByType } from '@/api/modules/files'; interface ParamObj extends App.FromField {