This commit is contained in:
@@ -5,13 +5,10 @@ PRIORITY - ALWAYS Lowest level stuff first, i.e. TODO at server, api route chang
|
||||
|
||||
todo: Logo form
|
||||
|
||||
translations
|
||||
clear image (remove it)
|
||||
|
||||
Decide upon reasonable maximum sizes for each
|
||||
(check RI/WBI etc manual what do they take for limits?)
|
||||
Can it send a placeholder if empty instead of a 404?
|
||||
or, with the gray background do I even need a placeholder anymore?
|
||||
|
||||
Handle too large at client, don't even send to server
|
||||
|
||||
todo: AyaNova customer branding to login form / upload logos etc **UPDATED, SEE CASES, WILL IMPLEMENT MIGHT AS WELL DO IT NOW
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
accept="image/*"
|
||||
show-size
|
||||
:label="$ay.t('SmallLogo')"
|
||||
:rules="rules"
|
||||
></v-file-input>
|
||||
<v-btn color="primary" text @click="remove('small')">{{
|
||||
$ay.t("Delete")
|
||||
@@ -36,6 +37,7 @@
|
||||
accept="image/*"
|
||||
show-size
|
||||
:label="$ay.t('MediumLogo')"
|
||||
:rules="rules"
|
||||
></v-file-input>
|
||||
<v-btn color="primary" text @click="remove('medium')">{{
|
||||
$ay.t("Delete")
|
||||
@@ -55,6 +57,7 @@
|
||||
accept="image/*"
|
||||
show-size
|
||||
:label="$ay.t('LargeLogo')"
|
||||
:rules="rules"
|
||||
></v-file-input>
|
||||
<v-btn color="primary" text @click="remove('small')">{{
|
||||
$ay.t("Delete")
|
||||
@@ -94,6 +97,9 @@ export default {
|
||||
vm.smallUrl = `${window.$gz.api.logoUrl("small")}?x=${Date.now()}`;
|
||||
vm.mediumUrl = `${window.$gz.api.logoUrl("medium")}?x=${Date.now()}`;
|
||||
vm.largeUrl = `${window.$gz.api.logoUrl("large")}?x=${Date.now()}`;
|
||||
vm.fileSizeExceededWarning = vm.$ay
|
||||
.t("AyaFileFileTooLarge")
|
||||
.replace("{0}", "512KiB");
|
||||
|
||||
vm.formState.loading = false;
|
||||
} catch (err) {
|
||||
@@ -109,6 +115,7 @@ export default {
|
||||
mediumUrl: null,
|
||||
largeUrl: null,
|
||||
smallUrl: null,
|
||||
fileSizeExceededWarning: "",
|
||||
formState: {
|
||||
ready: false,
|
||||
dirty: false,
|
||||
@@ -119,7 +126,10 @@ export default {
|
||||
appError: null,
|
||||
serverError: {}
|
||||
},
|
||||
rights: window.$gz.role.getRights(window.$gz.type.Global)
|
||||
rights: window.$gz.role.getRights(window.$gz.type.Global),
|
||||
rules: [
|
||||
value => !value || value.size < 512000 || this.fileSizeExceededWarning
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -143,6 +153,10 @@ export default {
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if (fileData.size > 512000) {
|
||||
window.$gz.eventBus.$emit("notify-error", vm.fileSizeExceededWarning);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
let res = await window.$gz.api.uploadLogo(fileData, size);
|
||||
if (res.error) {
|
||||
@@ -281,7 +295,8 @@ async function fetchTranslatedText(vm) {
|
||||
"SmallLogo",
|
||||
"MediumLogo",
|
||||
"LargeLogo",
|
||||
"GlobalLogo"
|
||||
"GlobalLogo",
|
||||
"AyaFileFileTooLarge"
|
||||
]);
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user