mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-17 21:08:25 +08:00
feat: Add hint messages for compose environment variables (#11351)
This commit is contained in:
parent
c6376541ed
commit
184a214bff
2 changed files with 13 additions and 3 deletions
|
|
@ -299,7 +299,11 @@ func loadAppImage(list []dto.DataTree) []dto.DataTree {
|
||||||
|
|
||||||
for i := 0; i < len(list); i++ {
|
for i := 0; i < len(list); i++ {
|
||||||
itemAppImage := dto.DataTree{ID: uuid.NewString(), Label: "appImage"}
|
itemAppImage := dto.DataTree{ID: uuid.NewString(), Label: "appImage"}
|
||||||
stdout, err := cmd.RunDefaultWithStdoutBashCf("cat %s | grep image: ", list[i].Path)
|
appPath := path.Join(global.Dir.DataDir, "apps", list[i].Key, list[i].Name)
|
||||||
|
if list[i].IsLocal {
|
||||||
|
appPath = path.Join(global.Dir.AppDir, "local", strings.TrimPrefix(list[i].Key, "local"), list[i].Name)
|
||||||
|
}
|
||||||
|
stdout, err := cmd.RunDefaultWithStdoutBashCf("cat %s | grep image: ", path.Join(appPath, "docker-compose.yml"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
list[i].Children = append(list[i].Children, itemAppImage)
|
list[i].Children = append(list[i].Children, itemAppImage)
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,17 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #default="{ read }">
|
<template #default="{ read }">
|
||||||
<el-input class="p-w-300" v-model="tmpLabels[index]" @blur="read" />
|
<el-input
|
||||||
|
clearable
|
||||||
|
placeholder="key=value"
|
||||||
|
class="p-w-300"
|
||||||
|
v-model="tmpLabels[index]"
|
||||||
|
@blur="read"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</fu-read-write-switch>
|
</fu-read-write-switch>
|
||||||
</div>
|
</div>
|
||||||
<el-input v-if="showAdd" v-model="labelItem">
|
<el-input v-if="showAdd" clearable placeholder="key=value" v-model="labelItem">
|
||||||
<template #append>
|
<template #append>
|
||||||
<el-button icon="Check" @click="save()" />
|
<el-button icon="Check" @click="save()" />
|
||||||
<el-button icon="Close" @click="cancel()" />
|
<el-button icon="Close" @click="cancel()" />
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue