Skip to content

Commit

Permalink
Fix: Can't display app icon when import from app file or docker run cmd.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrykuku committed Dec 11, 2024
1 parent 37d2d57 commit 014aac4
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 152 deletions.
23 changes: 12 additions & 11 deletions src/components/Apps/ComposeConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ export default {
CommandsInput,
VueSlider,
},
filters: {
duplexDisplay(val) {
if (!val) {
return 256
}
return (isNumber(val) && val) || (val && val.replace(/m/i, ''))
},
},
props: {
state: String,
totalMemory: {
Expand Down Expand Up @@ -244,6 +252,7 @@ export default {
immediate: true,
},
},
created() {
// Set Front-end base url
this.baseUrl = `${document.domain}`
Expand Down Expand Up @@ -325,7 +334,6 @@ export default {
/**
* @description: Validate form async
* @param {object} ref ref of component
* @return {boolean}
*/
async checkStep() {
Expand All @@ -346,7 +354,6 @@ export default {
if (!yaml) {
return
}
// 其他配置
this.volumes = yaml.volumes || {}
Expand Down Expand Up @@ -624,7 +631,7 @@ export default {
makeArray(foo) {
const newArray = typeof foo == 'string' ? [foo] : foo
return newArray == undefined ? [] : newArray
return newArray === undefined ? [] : newArray
},
// ****** migration !!! end !!!
Expand Down Expand Up @@ -741,12 +748,6 @@ export default {
}
return result
},
duplexDisplay(val) {
if (!val) {
return 256 // this.memory_min
}
return (isNumber(val) && val) || (val && val.replace(/M/i, ''))
},
// unused
filteredBeidgePort(service) {
return this.bridgePorts(service).filter((port) => {
Expand Down Expand Up @@ -787,7 +788,7 @@ export default {
<ValidationProvider v-slot="{ errors, valid }" class="is-flex-grow-1 mr-3" name="Image0" rules="required">
<b-field :label="`${$t('Docker Image')} *`" :message="$t(errors)" :type="{ 'is-danger': errors[0], 'is-success': valid }" class="mb-3">
<b-input
:key="service.image" :readonly="state == 'update' || serviceStableVersion !== ''" :value="getFirstField(service.image)" :placeholder="$t('e.g.,hello-world:latest')" @input="(V) => changeIcon(V)" @blur="
:key="service.image" :readonly="state === 'update' || serviceStableVersion !== ''" :value="getFirstField(service.image)" :placeholder="$t('e.g.,hello-world:latest')" @input="(V) => changeIcon(V)" @blur="
(E) => {
return (service.image = service.image.split(':')[1]
? `${E.target._value}:${service.image.split(':')[1]}`
Expand Down Expand Up @@ -895,7 +896,7 @@ export default {
</b-field>
<b-field :label="$t('Memory Limit')" class="mb-5">
<VueSlider :max="totalMemory" :min="memory_min" class="mx-2" :marks="true" :data="markData" :value="duplexDisplay(service.deploy.resources.limits.memory)" @change="(v) => (service.deploy.resources.limits.memory = v)" />
<VueSlider :max="totalMemory" :min="memory_min" class="mx-2" :marks="true" :data="markData" :value="service.deploy.resources.limits.memory | duplexDisplay" @change="(v) => (service.deploy.resources.limits.memory = v)" />
</b-field>
<b-field :label="$t('CPU Shares')">
Expand Down
Loading

0 comments on commit 014aac4

Please sign in to comment.