Files
server/opt/psa/admin/plib/modules/galileo/resources/addDomain.js
2026-01-07 20:52:11 +01:00

36 lines
1.4 KiB
JavaScript

// Copyright 1999-2019. Plesk International GmbH. All rights reserved.
function main() {
var createdDomainKey = 'ghe-createdDomain';
window.localStorage.removeItem(createdDomainKey);
var uat = Jsw && Jsw.UAT;
var isRedirectedFromSetupScreen = document.referrer.match(/\/web\/setup/);
if (!isRedirectedFromSetupScreen) {
return;
}
if (window.location.href.match(/source=git/)) {
uat && uat.dispatchAction('exp_add_domain_with_git');
var gitDeploymentCheckbox = document.getElementById('git-deploymentEnabled');
gitDeploymentCheckbox && gitDeploymentCheckbox.click();
} else if (window.location.href.match(/source=upload/)) {
uat && uat.dispatchAction('exp_add_domain_with_fileupload');
var redirectToUpload = document.getElementById('addDomainUpload-redirectToUpload');
redirectToUpload.value = 'true';
var submitButton = document.getElementById('btn-send');
submitButton.addEventListener('click', function () {
var domainNameInput = document.getElementById('domainName-name');
window.localStorage.setItem(createdDomainKey, domainNameInput.value);
});
} else {
if (PleskExt.Galileo.Config.showNewButtons) {
uat && uat.dispatchAction('exp_add_domain');
} else {
uat && uat.dispatchAction('exp_add_domain_default');
}
}
}
main();