[Web] Show warning, when domain exhausted and only an unlimited mailbox could be created
This commit is contained in:
@@ -71,21 +71,23 @@ $(document).ready(function() {
|
||||
});
|
||||
// Auto-fill domain quota when adding new domain
|
||||
auto_fill_quota = function(domain) {
|
||||
$.get("/api/v1/get/domain/" + domain, function(data){
|
||||
$.get("/api/v1/get/domain/" + domain, function(data){
|
||||
var result = $.parseJSON(JSON.stringify(data));
|
||||
def_new_mailbox_quota = ( result.def_new_mailbox_quota / 1048576);
|
||||
max_new_mailbox_quota = ( result.max_new_mailbox_quota / 1048576);
|
||||
if (max_new_mailbox_quota != '0') {
|
||||
$("#quotaBadge").html('max. ' + max_new_mailbox_quota + ' MiB');
|
||||
$('#addInputQuota').attr({"disabled": false, "value": "", "type": "number", "max": max_new_mailbox_quota});
|
||||
$('#addInputQuota').val(def_new_mailbox_quota);
|
||||
}
|
||||
else {
|
||||
$("#quotaBadge").html('max. ' + max_new_mailbox_quota + ' MiB');
|
||||
$('#addInputQuota').attr({"disabled": true, "value": "", "type": "text", "value": "n/a"});
|
||||
$('#addInputQuota').val(max_new_mailbox_quota);
|
||||
}
|
||||
});
|
||||
if (max_new_mailbox_quota != '0') {
|
||||
$('.addInputQuotaExhausted').hide();
|
||||
$("#quotaBadge").html('max. ' + max_new_mailbox_quota + ' MiB');
|
||||
$('#addInputQuota').attr({"disabled": false, "value": "", "type": "number", "max": max_new_mailbox_quota});
|
||||
$('#addInputQuota').val(def_new_mailbox_quota);
|
||||
}
|
||||
else {
|
||||
$('.addInputQuotaExhausted').show();
|
||||
$("#quotaBadge").html('max. ' + max_new_mailbox_quota + ' MiB');
|
||||
$('#addInputQuota').attr({"disabled": true, "value": "", "type": "text", "value": "n/a"});
|
||||
$('#addInputQuota').val(max_new_mailbox_quota);
|
||||
}
|
||||
});
|
||||
}
|
||||
$('#addSelectDomain').on('change', function() {
|
||||
auto_fill_quota($('#addSelectDomain').val());
|
||||
|
Reference in New Issue
Block a user