mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 09:37:08 +00:00
Fix retrieval of preplot previews
This commit is contained in:
@@ -519,17 +519,18 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
async getHead () {
|
async getHead () {
|
||||||
console.log("getHead", this.value?.path);
|
|
||||||
if (this.value?.path) {
|
if (this.value?.path) {
|
||||||
const url = `/files/${this.value.path}`;
|
const url = `/files/${this.value.path}`;
|
||||||
const init = {
|
const init = {
|
||||||
text: true,
|
|
||||||
headers: {
|
headers: {
|
||||||
"Range": `bytes=0-${this.sampleSize}`
|
"Range": `bytes=0-${this.sampleSize}`
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const head = await this.api([url, init]);
|
const opts = {format: "text"};
|
||||||
return head?.substring(0, head.lastIndexOf("\n")) || "";
|
const head = await this.api([url, init, null, opts]);
|
||||||
|
return typeof head === "string"
|
||||||
|
? head?.substring(0, head.lastIndexOf("\n")) || ""
|
||||||
|
: this.head ?? "";
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user