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