Skip to content

Commit

Permalink
fix: removed default value for quota
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Aug 30, 2024
1 parent 68dc852 commit cd67e0b
Show file tree
Hide file tree
Showing 28 changed files with 77 additions and 55 deletions.
1 change: 0 additions & 1 deletion app/models/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ const Aliases = new mongoose.Schema({
// alias specific max quota (set by admins only)
max_quota: {
type: Number,
default: config.maxQuotaPerAlias,
min: 0,
//
// NOTE: hard-coded max of 100 GB (safeguard)
Expand Down
1 change: 0 additions & 1 deletion app/models/domains.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ const Domains = new mongoose.Schema({
// domain specific max quota per alias
max_quota_per_alias: {
type: Number,
default: config.maxQuotaPerAlias,
min: 0,
//
// NOTE: hard-coded max of 100 GB (safeguard)
Expand Down
55 changes: 27 additions & 28 deletions app/views/my-account/domains/aliases/_table.pug
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,38 @@ mixin renderProgressBar(domain, alias, isMobile = false)
else if aliasPercentage >= 60
- aliasProgressClass = "bg-warning";
- aliasTextClass = "text-warning";
if aliasPercentage > 0
.progress.bg-light.border.border-dark
//- render alias portion
.progress-bar.min-width-25(
class=aliasProgressClass,
data-width=`${aliasPercentage}%`,
aria-valuenow=aliasPercentage,
.progress.bg-light.border.border-dark
//- render alias portion
.progress-bar.min-width-25(
class=aliasProgressClass,
data-width=`${aliasPercentage || 1}%`,
aria-valuenow=aliasPercentage || 1,
aria-valuemin=0,
aria-valuemax=100,
data-toggle="tooltip",
data-title=t("Storage used by this alias"),
data-placement="bottom",
role="button"
)= `${aliasPercentage === 0 ? "<1%" : aliasPercentage}%`
//- render remaining portion
if aliasPercentage !== 100
.progress-bar.bg-success.min-width-25(
data-width=`${100 - (aliasPercentage || 1)}%`,
aria-valuenow=100 - (aliasPercentage || 1),
aria-valuemin=0,
aria-valuemax=100,
data-toggle="tooltip",
data-title=t("Storage used by this alias"),
data-title=t("Available storage"),
data-placement="bottom",
role="button"
)= `${aliasPercentage}%`
//- render remaining portion
if aliasPercentage !== 100
.progress-bar.bg-success.min-width-25(
data-width=`${100 - aliasPercentage}%`,
aria-valuenow=100 - aliasPercentage,
aria-valuemin=0,
aria-valuemax=100,
data-toggle="tooltip",
data-title=t("Available storage"),
data-placement="bottom",
role="button"
)= `${100 - aliasPercentage}%`
ul.list-unstyled.small.mt-1
li(class=aliasTextClass)
= bytes(alias.storage_used)
= " / "
= bytes(alias.max_quota)
= " "
= t("alias quota")
)= `${100 - aliasPercentage}%`
ul.list-unstyled.small.mt-1
li(class=aliasTextClass)
= bytes(alias.storage_used)
= " / "
= bytes(alias.max_quota)
= " "
= t("alias quota")

//- render normal progress bar
- let percentage = Math.round((domain.storage_used / domain.storage_quota) * 100);
Expand Down
3 changes: 2 additions & 1 deletion locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -10317,5 +10317,6 @@
"Domain admins can update the storage quota for this alias. Leave blank and hit save to reset it to the current domain's maximum storage quota of <span class=\"notranslate\">%s</span>. Enter a human-friendly string such as \"1GB\" &ndash; note that we use <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> to parse the value to a Number. If you would like to update the max storage quota across all aliases for this domain, then go to the domain's Settings page.": "يمكن لمسؤولي المجال تحديث حصة التخزين لهذا الاسم المستعار. اتركه فارغًا واضغط على حفظ لإعادة تعيينه إلى الحد الأقصى لحصة التخزين للمجال الحالي بنسبة <span class=\"notranslate\">%s</span> . أدخل سلسلة سهلة الفهم مثل &quot;1 جيجابايت&quot; - لاحظ أننا نستخدم <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> لتحليل القيمة إلى رقم. إذا كنت ترغب في تحديث الحد الأقصى لحصة التخزين عبر جميع الأسماء المستعارة لهذا المجال، فانتقل إلى صفحة إعدادات المجال.",
"The quota for <span class='notranslate'>%s</span> of <span class='notranslate'>%s</span> exceeds the domain's maximum quota of <span class='notranslate'>%s</span>.": "حصة <span class='notranslate'>%s</span> من <span class='notranslate'>%s</span> تتجاوز الحد الأقصى لحصة النطاق وهي <span class='notranslate'>%s</span> .",
"The quota for <span class=\"notranslate\">%s</span> of <span class=\"notranslate\">%s</span> exceeds the maximum quota of <span class=\"%s\"></span> from admins of the domain.": "الحصة المخصصة لـ <span class=\"notranslate\">%s</span> من <span class=\"notranslate\">%s</span> تتجاوز الحصة القصوى المخصصة لـ<span class=\"%s\"></span> من مسؤولي المجال.",
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "كانت البايتات غير صالحة، يجب أن تكون سلسلة مثل \"1 جيجابايت\" أو \"100 ميجابايت\"."
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "كانت البايتات غير صالحة، يجب أن تكون سلسلة مثل \"1 جيجابايت\" أو \"100 ميجابايت\".",
"alias quota": "حصة الاسم المستعار"
}
3 changes: 2 additions & 1 deletion locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -10317,5 +10317,6 @@
"Domain admins can update the storage quota for this alias. Leave blank and hit save to reset it to the current domain's maximum storage quota of <span class=\"notranslate\">%s</span>. Enter a human-friendly string such as \"1GB\" &ndash; note that we use <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> to parse the value to a Number. If you would like to update the max storage quota across all aliases for this domain, then go to the domain's Settings page.": "Správci domény mohou aktualizovat kvótu úložiště pro tento alias. Ponechte prázdné a stisknutím tlačítka Uložit jej resetujte na maximální kvótu úložiště aktuální domény <span class=\"notranslate\">%s</span> . Zadejte řetězec vhodný pro člověka, například „1 GB“ – všimněte si, že k analýze hodnoty na číslo používáme <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> . Pokud byste chtěli aktualizovat maximální kvótu úložiště pro všechny aliasy pro tuto doménu, přejděte na stránku Nastavení domény.",
"The quota for <span class='notranslate'>%s</span> of <span class='notranslate'>%s</span> exceeds the domain's maximum quota of <span class='notranslate'>%s</span>.": "Kvóta pro <span class='notranslate'>%s</span> z <span class='notranslate'>%s</span> překračuje maximální kvótu domény <span class='notranslate'>%s</span> .",
"The quota for <span class=\"notranslate\">%s</span> of <span class=\"notranslate\">%s</span> exceeds the maximum quota of <span class=\"%s\"></span> from admins of the domain.": "Kvóta pro <span class=\"notranslate\">%s</span> z <span class=\"notranslate\">%s</span> překračuje maximální kvótu<span class=\"%s\"></span> od administrátorů domény.",
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Bajty byly neplatné, musí to být řetězec, například „1 GB“ nebo „100 MB“."
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Bajty byly neplatné, musí to být řetězec, například „1 GB“ nebo „100 MB“.",
"alias quota": "alias kvóta"
}
3 changes: 2 additions & 1 deletion locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -7305,5 +7305,6 @@
"Verified": "Verificeret",
"The quota for <span class='notranslate'>%s</span> of <span class='notranslate'>%s</span> exceeds the domain's maximum quota of <span class='notranslate'>%s</span>.": "Kvoten for <span class='notranslate'>%s</span> af <span class='notranslate'>%s</span> overstiger domænets maksimale kvote på <span class='notranslate'>%s</span> .",
"The quota for <span class=\"notranslate\">%s</span> of <span class=\"notranslate\">%s</span> exceeds the maximum quota of <span class=\"%s\"></span> from admins of the domain.": "Kvoten for <span class=\"notranslate\">%s</span> af <span class=\"notranslate\">%s</span> overstiger den maksimale kvote på<span class=\"%s\"></span> fra domænets administratorer.",
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Bytes var ugyldige, skal være en streng såsom \"1 GB\" eller \"100 MB\"."
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Bytes var ugyldige, skal være en streng såsom \"1 GB\" eller \"100 MB\".",
"alias quota": "alias kvote"
}
3 changes: 2 additions & 1 deletion locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -9356,5 +9356,6 @@
"Domain admins can update the storage quota for this alias. Leave blank and hit save to reset it to the current domain's maximum storage quota of <span class=\"notranslate\">%s</span>. Enter a human-friendly string such as \"1GB\" &ndash; note that we use <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> to parse the value to a Number. If you would like to update the max storage quota across all aliases for this domain, then go to the domain's Settings page.": "Domänenadministratoren können das Speicherkontingent für diesen Alias aktualisieren. Lassen Sie das Feld leer und klicken Sie auf „Speichern“, um es auf das maximale Speicherkontingent der aktuellen Domäne von <span class=\"notranslate\">%s</span> zurückzusetzen. Geben Sie eine benutzerfreundliche Zeichenfolge wie „1 GB“ ein. Beachten Sie, dass wir <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> verwenden, um den Wert in eine Zahl umzuwandeln. Wenn Sie das maximale Speicherkontingent für alle Aliase dieser Domäne aktualisieren möchten, wechseln Sie zur Seite „Einstellungen“ der Domäne.",
"The quota for <span class='notranslate'>%s</span> of <span class='notranslate'>%s</span> exceeds the domain's maximum quota of <span class='notranslate'>%s</span>.": "Das Kontingent für <span class='notranslate'>%s</span> von <span class='notranslate'>%s</span> überschreitet das maximale Kontingent der Domäne von <span class='notranslate'>%s</span> .",
"The quota for <span class=\"notranslate\">%s</span> of <span class=\"notranslate\">%s</span> exceeds the maximum quota of <span class=\"%s\"></span> from admins of the domain.": "Das Kontingent für <span class=\"notranslate\">%s</span> von <span class=\"notranslate\">%s</span> überschreitet das maximale Kontingent von<span class=\"%s\"></span> von Admins der Domäne.",
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Die Bytes waren ungültig. Es muss sich um eine Zeichenfolge wie „1 GB“ oder „100 MB“ handeln."
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Die Bytes waren ungültig. Es muss sich um eine Zeichenfolge wie „1 GB“ oder „100 MB“ handeln.",
"alias quota": "Alias-Kontingent"
}
3 changes: 2 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6698,5 +6698,6 @@
"Domain admins can update the maximum storage quota across all aliases. Enter a human-friendly string such as \"1GB\" &ndash; note that we use <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> to parse the value to a Number. Domain admins can set maximum storage quota limits on a per alias basis by editing the alias directly.": "Domain admins can update the maximum storage quota across all aliases. Enter a human-friendly string such as \"1GB\" &ndash; note that we use <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> to parse the value to a Number. Domain admins can set maximum storage quota limits on a per alias basis by editing the alias directly.",
"Storage Max Quota": "Storage Max Quota",
"Domain admins can update the storage quota for this alias. Leave blank and hit save to reset it to the current domain's maximum storage quota of <span class=\"notranslate\">%s</span>. Enter a human-friendly string such as \"1GB\" &ndash; note that we use <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> to parse the value to a Number. If you would like to update the max storage quota across all aliases for this domain, then go to the domain's Settings page.": "Domain admins can update the storage quota for this alias. Leave blank and hit save to reset it to the current domain's maximum storage quota of <span class=\"notranslate\">%s</span>. Enter a human-friendly string such as \"1GB\" &ndash; note that we use <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> to parse the value to a Number. If you would like to update the max storage quota across all aliases for this domain, then go to the domain's Settings page.",
"Alias does not exist on the domain.": "Alias does not exist on the domain."
"Alias does not exist on the domain.": "Alias does not exist on the domain.",
"alias quota": "alias quota"
}
3 changes: 2 additions & 1 deletion locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -10315,5 +10315,6 @@
"Domain admins can update the storage quota for this alias. Leave blank and hit save to reset it to the current domain's maximum storage quota of <span class=\"notranslate\">%s</span>. Enter a human-friendly string such as \"1GB\" &ndash; note that we use <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> to parse the value to a Number. If you would like to update the max storage quota across all aliases for this domain, then go to the domain's Settings page.": "Los administradores de dominio pueden actualizar la cuota de almacenamiento para este alias. Déjelo en blanco y presione Guardar para restablecerlo a la cuota de almacenamiento máxima del dominio actual de <span class=\"notranslate\">%s</span> . Ingrese una cadena de caracteres descriptiva como &quot;1 GB&quot;; tenga en cuenta que usamos <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> para analizar el valor como un número. Si desea actualizar la cuota de almacenamiento máxima en todos los alias de este dominio, vaya a la página Configuración del dominio.",
"The quota for <span class='notranslate'>%s</span> of <span class='notranslate'>%s</span> exceeds the domain's maximum quota of <span class='notranslate'>%s</span>.": "La cuota para <span class='notranslate'>%s</span> de <span class='notranslate'>%s</span> excede la cuota máxima del dominio de <span class='notranslate'>%s</span> .",
"The quota for <span class=\"notranslate\">%s</span> of <span class=\"notranslate\">%s</span> exceeds the maximum quota of <span class=\"%s\"></span> from admins of the domain.": "La cuota para <span class=\"notranslate\">%s</span> de <span class=\"notranslate\">%s</span> excede la cuota máxima de<span class=\"%s\"></span> de los administradores del dominio.",
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Los bytes no son válidos, debe ser una cadena como \"1 GB\" o \"100 MB\"."
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Los bytes no son válidos, debe ser una cadena como \"1 GB\" o \"100 MB\".",
"alias quota": "alias cuota"
}
3 changes: 2 additions & 1 deletion locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -10164,5 +10164,6 @@
"Domain admins can update the storage quota for this alias. Leave blank and hit save to reset it to the current domain's maximum storage quota of <span class=\"notranslate\">%s</span>. Enter a human-friendly string such as \"1GB\" &ndash; note that we use <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> to parse the value to a Number. If you would like to update the max storage quota across all aliases for this domain, then go to the domain's Settings page.": "Verkkotunnuksen järjestelmänvalvojat voivat päivittää tämän aliaksen tallennuskiintiön. Jätä tyhjäksi ja paina Tallenna palauttaaksesi sen nykyisen verkkotunnuksen enimmäistallennuskiintiöön <span class=\"notranslate\">%s</span> . Kirjoita ihmisystävällinen merkkijono, kuten &quot;1 Gt&quot; – huomaa, että käytämme <a href=\"https://github.com/visionmedia/bytes.js\" class=\"notranslate alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">bytes</a> jäsentääksemme arvon numeroksi. Jos haluat päivittää tämän verkkotunnuksen kaikkien aliasten enimmäistallennuskiintiön, siirry verkkotunnuksen Asetukset-sivulle.",
"The quota for <span class='notranslate'>%s</span> of <span class='notranslate'>%s</span> exceeds the domain's maximum quota of <span class='notranslate'>%s</span>.": "Kohteen <span class='notranslate'>%s</span> kiintiö <span class='notranslate'>%s</span> ylittää verkkotunnuksen enimmäiskiintiön <span class='notranslate'>%s</span> .",
"The quota for <span class=\"notranslate\">%s</span> of <span class=\"notranslate\">%s</span> exceeds the maximum quota of <span class=\"%s\"></span> from admins of the domain.": "<span class=\"notranslate\">%s</span> n kiintiö <span class=\"notranslate\">%s</span> ylittää enimmäiskiintiön<span class=\"%s\"></span> verkkotunnuksen ylläpitäjiltä.",
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Tavut olivat virheellisiä, täytyy olla merkkijono, kuten \"1 Gt\" tai \"100 MB\"."
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Tavut olivat virheellisiä, täytyy olla merkkijono, kuten \"1 Gt\" tai \"100 MB\".",
"alias quota": "aliaskiintiö"
}
3 changes: 2 additions & 1 deletion locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -7842,5 +7842,6 @@
"Verified": "Vérifié",
"The quota for <span class='notranslate'>%s</span> of <span class='notranslate'>%s</span> exceeds the domain's maximum quota of <span class='notranslate'>%s</span>.": "Le quota pour <span class='notranslate'>%s</span> de <span class='notranslate'>%s</span> dépasse le quota maximum du domaine de <span class='notranslate'>%s</span> .",
"The quota for <span class=\"notranslate\">%s</span> of <span class=\"notranslate\">%s</span> exceeds the maximum quota of <span class=\"%s\"></span> from admins of the domain.": "Le quota pour <span class=\"notranslate\">%s</span> de <span class=\"notranslate\">%s</span> dépasse le quota maximum de<span class=\"%s\"></span> des administrateurs du domaine.",
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Les octets n'étaient pas valides, il doit s'agir d'une chaîne telle que « 1 Go » ou « 100 Mo »."
"Bytes were invalid, must be a string such as \"1 GB\" or \"100 MB\".": "Les octets n'étaient pas valides, il doit s'agir d'une chaîne telle que « 1 Go » ou « 100 Mo ».",
"alias quota": "quota d'alias"
}
Loading

0 comments on commit cd67e0b

Please sign in to comment.