Skip to content

Commit 1d8ecea

Browse files
authored
Fix: Can't display app icon when import from app file or docker run cmd. (#122)
1 parent 01dae32 commit 1d8ecea

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

src/assets/scss/common/_animate.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,5 @@
177177

178178
.slide-next-half-enter,
179179
.slide-next-half-leave-to {
180-
transform: translateX(-30%);
180+
transform: translateX(-50%);
181181
}

src/components/AppStore/AppDetail/AppInfoTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const categoryIcon = computed(() => {
6464
6565
</script>
6666

67-
<style scoped>
67+
<style lang="scss" scoped>
6868
.level {
6969
position: relative;
7070

src/components/forms/ImportPanel.vue

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -123,36 +123,46 @@ export default {
123123
* @return {*} void
124124
*/
125125
emitSubmit() {
126-
if (this.activeTab == 1) {
127-
const cleanedCommand = this.dockerCliCommands.replace(/`#.*?`/g, '').replace(/#.*$/gm, '').trim();
128-
this.dockerComposeCommands = Composerize(cleanedCommand, null, 'v3x');
129-
this.dockerComposeCommands = this.addTitleToYaml(this.dockerComposeCommands)
130-
this.$emit('update', this.dockerComposeCommands)
131-
this.$emit('close')
132-
} else if (this.activeTab == 0) {
133-
this.dockerComposeCommands = this.addTitleToYaml(this.dockerComposeCommands)
134-
this.errors = ""
135-
this.$emit('update', this.dockerComposeCommands)
136-
this.$emit('close')
137-
} else if (this.activeTab == 2) {
138-
if (this.appFileLoaded) {
139-
this.errors = ""
126+
switch (this.activeTab) {
127+
case 0:
128+
this.dockerComposeCommands = this.addTitleToYaml(this.dockerComposeCommands)
129+
this.errors = ''
130+
this.$emit('update', this.dockerComposeCommands)
140131
this.$emit('close')
141-
} else {
142-
this.errors = this.$t('Please import a valid App file')
143-
this.parseError = true;
132+
break
133+
case 1: {
134+
const cleanedCommand = this.dockerCliCommands.replace(/`#.*?`/g, '').replace(/#.*$/gm, '').trim()
135+
this.dockerComposeCommands = Composerize(cleanedCommand)
136+
this.dockerComposeCommands = this.addTitleToYaml(this.dockerComposeCommands)
137+
this.$emit('update', this.dockerComposeCommands)
138+
this.$emit('close')
139+
break
144140
}
141+
case 2:
142+
if (this.appFileLoaded) {
143+
this.errors = ''
144+
this.$emit('close')
145+
}
146+
else {
147+
this.errors = this.$t('Please import a valid App file')
148+
this.parseError = true
149+
}
150+
break
145151
}
146152
},
147153
148154
addTitleToYaml(yaml) {
149155
const yamlObj = parse(yaml)
156+
if (yamlObj['x-casaos'] !== undefined)
157+
return yaml
158+
150159
const serviceName = Object.keys(yamlObj.services)[0]
151-
if (serviceName == undefined) return stringify(yamlObj)
160+
if (serviceName === undefined)
161+
return stringify(yamlObj)
152162
yamlObj['x-casaos'] = {}
153163
yamlObj['x-casaos'].title = {}
154164
yamlObj['x-casaos'].title.en_us = serviceName
155-
yamlObj['x-casaos'].icon = `https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@main/Apps/${serviceName}/icon.png`
165+
yamlObj['x-casaos'].icon = `https://icon.casaos.io/main/all/${serviceName}.png`
156166
return stringify(yamlObj)
157167
},
158168

0 commit comments

Comments
 (0)