storage and image model

This commit is contained in:
2024-09-27 14:28:20 +03:00
parent 6d15591601
commit 63232585ab
7 changed files with 33 additions and 120 deletions
+3 -4
View File
@@ -3,11 +3,11 @@ export function imgurl(channel,record) {
if (record._file.mime === "image/svg+xml") {
return fileurl(channel, record);
}
return channel.filesUrl + `/thumbs/${record._file.disk}/${record._file.path}`;
return channel.disks[record._file.disk] + `/thumbs/${record._file.path}`;
}
export function fileurl(channel, record) {
return channel.filesUrl + `/${record._file.disk}/${record._file.path}`;
return channel.disks[record._file.disk] + `/${record._file.path}`;
}
export function htmlurl(channel,record, preset) {
@@ -18,9 +18,8 @@ export function htmlurl(channel,record, preset) {
if (record._file.width > 0) {
let presetUrl = url;
if (preset) {
presetUrl = channel.filesUrl + `/templates/${preset}/${record._file.disk}/${record._file.path}`;
presetUrl = channel.disks[record._file.disk] + `/templates/${preset}/${record._file.path}`;
}
html = `<img src="${presetUrl}" alt="${record._file.path}" />`
} else if (record._file.mime === "image/svg+xml") {
html = `<img src="${url}" alt="${record._file.path}"/>`