fix: ipv6 issues with encodeURI
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
parent
be2efac9fd
commit
56d61ce6ae
@ -925,7 +925,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
)
|
||||
|
||||
if (thumbnail && 'relative_path' in thumbnail) {
|
||||
return encodeURI(`${this.apiUrl}/server/files/${this.currentPath}/${thumbnail.relative_path}?timestamp=${item.modified.getTime()}`)
|
||||
return `${this.apiUrl}/server/files/${encodeURI(this.currentPath)}/${encodeURI(thumbnail.relative_path)}?timestamp=${item.modified.getTime()}`
|
||||
}
|
||||
}
|
||||
|
||||
@ -937,7 +937,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
const thumbnail = item.thumbnails.find(thumb => thumb.width >= thumbnailBigMin)
|
||||
|
||||
if (thumbnail && 'relative_path' in thumbnail) {
|
||||
return encodeURI(`${this.apiUrl}/server/files/${this.currentPath}/${thumbnail.relative_path}?timestamp=${item.modified.getTime()}`)
|
||||
return `${this.apiUrl}/server/files/${encodeURI(this.currentPath)}/${encodeURI(thumbnail.relative_path)}?timestamp=${item.modified.getTime()}`
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -596,7 +596,7 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
if (thumbnail && 'relative_path' in thumbnail) {
|
||||
return encodeURI(`${this.apiUrl}/server/files/gcodes/${relative_url+thumbnail.relative_path}?timestamp=${item.metadata.modified}`)
|
||||
return `${this.apiUrl}/server/files/gcodes/${encodeURI(relative_url+thumbnail.relative_path)}?timestamp=${item.metadata.modified}`
|
||||
}
|
||||
}
|
||||
|
||||
@ -617,7 +617,7 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
if (thumbnail && 'relative_path' in thumbnail)
|
||||
return encodeURI(`${this.apiUrl}/server/files/gcodes/${relative_url+thumbnail.relative_path}?timestamp=${item.metadata.modified}`)
|
||||
return `${this.apiUrl}/server/files/gcodes/${encodeURI(relative_url+thumbnail.relative_path)}?timestamp=${item.metadata.modified}`
|
||||
}
|
||||
|
||||
return false
|
||||
|
@ -657,7 +657,7 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
|
||||
downloadFile() {
|
||||
const filename = (this.absolutePath+'/'+this.contextMenu.item.filename)
|
||||
const href = encodeURI(`${this.apiUrl}/server/files${filename}`)
|
||||
const href = `${this.apiUrl}/server/files${encodeURI(filename)}`
|
||||
window.open(href)
|
||||
}
|
||||
|
||||
|
@ -514,7 +514,7 @@ export default class StatusPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
if (thumbnail && 'relative_path' in thumbnail) {
|
||||
return encodeURI(`${this.apiUrl}/server/files/gcodes/${relative_url+thumbnail.relative_path}?timestamp=${this.current_file.modified}`)
|
||||
return `${this.apiUrl}/server/files/gcodes/${encodeURI(relative_url+thumbnail.relative_path)}?timestamp=${this.current_file.modified}`
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -536,7 +536,7 @@ export default class StatusPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
if (thumbnail && 'relative_path' in thumbnail) {
|
||||
return encodeURI(`${this.apiUrl}/server/files/gcodes/${relative_url+thumbnail.relative_path}?timestamp=${this.current_file.modified}`)
|
||||
return `${this.apiUrl}/server/files/gcodes/${encodeURI(relative_url+thumbnail.relative_path)}?timestamp=${this.current_file.modified}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
const filename = item.filename.slice(0, item.filename.lastIndexOf('.'))
|
||||
const preview = this.files?.find((file) => file.filename === filename+'.jpg')
|
||||
if (preview) {
|
||||
return encodeURI(`${this.apiUrl}/server/files/${this.currentPath}/${preview.filename}?timestamp=${preview.modified.getTime()}`)
|
||||
return `${this.apiUrl}/server/files/${encodeURI(this.currentPath)}/${encodeURI(preview.filename)}?timestamp=${preview.modified.getTime()}`
|
||||
}
|
||||
|
||||
return ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user