This commit is contained in:
cutemeli
2025-12-22 10:35:30 +00:00
parent 0bfc6c8425
commit 5ce7ca2c5d
38927 changed files with 0 additions and 4594700 deletions

View File

@@ -1,28 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with confirmation to cancel migration of subscriptions (remove them from queue).
// Arguments: subscriptions - list of subscription names.
// - onSuccess - function that will be called once cancel of these subscriptions is performed.
function showCancelPopup(subscriptions, onSuccess) {
Jsw.messageBox.show({
'type': Jsw.messageBox.TYPE_YESNO,
'subtype': 'delete',
'text': MESSAGE_POPUP_CANCEL_DESCRIPTION,
'onYesClick': function () {
new Ajax.Request(URL_CANCEL_SUBSCRIPTIONS, {
parameters: {
subscriptions: Object.toJSON(subscriptions)
},
onSuccess: function() {
if (onSuccess) {
onSuccess();
}
}
});
},
'buttonTitles': {
'yes': MESSAGE_POPUP_CANCEL_BUTTON_YES,
'no': MESSAGE_POPUP_CANCEL_BUTTON_NO
}
});
}

View File

@@ -1,41 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with confirmation to cancel all running migrations.
function showCancelAllPopup() {
// Hack to create dialog box, which does not immediately close dialog when "Yes" button is clicked
var CancelMessageBox = Class.create(
// take MessageBox class as superclass of AjaxMessageBox, because MessageBox class is not public since 17.8
Jsw.AjaxMessageBox.superclass,
{
_defaultOnButtonClick: function() {}
}
);
var messageBox = new CancelMessageBox({
'type': Jsw.messageBox.TYPE_YESNO,
'subtype': 'delete',
'text': migratorLocale.lmsg('popupCancelAllDescription'),
'onYesClick': function () {
this._componentElement.select('button').each(function(button) {
button.disabled = true;
button.up().addClassName('disabled');
});
this._componentElement.select('button').first().update(
'<span class="wait">' + migratorLocale.lmsg('popupCancelAllInProgress') + '</span>'
);
new Ajax.Request(URL_CANCEL, {
onSuccess: function() {
messageBox.hide();
}
});
},
'onNoClick': function () {
this.hide();
},
'buttonTitles': {
'yes': migratorLocale.lmsg('popupCancelAllButtonYes'),
'no': migratorLocale.lmsg('popupCancelAllButtonNo')
}
});
messageBox.show();
}

View File

@@ -1,174 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with settings to start migration.
// Arguments: subscriptions - list of subscription names.
function showChangeIPPopup(subscriptions, onSuccess) {
// compose title - it is different when one subscription is selected
// and when multiple subscriptions are selected
var title = '';
if (subscriptions.length > 1) {
title = formatMessage(MESSAGE_POPUP_CHANGE_IP_TITLE_MULTIPLE, subscriptions.length);
} else if (subscriptions.length == 1) {
title = formatMessage(MESSAGE_POPUP_CHANGE_IP_TITLE_SINGLE, subscriptions[0]);
} else {
// no subscriptions - no sense to show dialog
return;
}
new Ajax.Request(URL_LIST_IP_ADDRESSES, {
onSuccess: function (response) {
var ipAddresses = response.responseText.evalJSON();
function sectionTitle(title) {
return (
'<div class="title">' +
'<div class="title-area"><h3><span>' + title + '</span></h3></div>' +
'</div>'
);
}
function formRows(ipType) {
return (
'<div class="form-row">' +
'<div class="field-name">' + MESSAGE_POPUP_CHANGE_IP_MAP_TO + '</div>' +
'<div class="field-value">' +
'<div class="text-value">' +
'<div class="indent-box">' +
'<input type="radio" name="mappingType' + ipType + '" class="radio" id="mappingAuto' + ipType + '" value="auto" checked="checked"> ' +
'<label for="mappingAuto' + ipType + '">' +
MESSAGE_POPUP_CHANGE_IP_MAPPING_AUTO +
'</label>' +
'</div>' +
'<div class="indent-box">' +
'<input type="radio" name="mappingType' + ipType + '" class="radio" id="mappingShared' + ipType + '" value="shared"> ' +
'<label for="mappingShared' + ipType + '">' +
MESSAGE_POPUP_CHANGE_IP_MAPPING_SHARED +
'</label>' +
'</div>' +
'<div class="indent-box">' +
'<input type="radio" name="mappingType' + ipType + '" class="radio" id="mappingDedicated' + ipType + '" value="dedicated"> ' +
'<label for="mappingDedicated' + ipType + '">' +
MESSAGE_POPUP_CHANGE_IP_MAPPING_DEDICATED +
'</label>' +
'</div>' +
'<div class="indent-box">' +
'<input type="radio" name="mappingType' + ipType + '" class="radio" id="mappingSelected' + ipType + '" value="selected"> ' +
'<label for="mappingSelected' + ipType + '">' +
MESSAGE_POPUP_CHANGE_IP_MAPPING_SELECTED +
'</label>' +
'</div>' +
'</div>' +
'</div>' +
'</div>' +
'<div class="form-row">' +
'<div class="field-name">' + MESSAGE_POPUP_CHANGE_IP_MAP_TO_SELECTED + '</div>' +
'<div class="field-value">' +
'<div id="change-ip-' + ipType + '-input-container"></div>' +
'</div>' +
'</div>'
);
}
popupContent = '';
if (ipAddresses.v6.length > 0) {
popupContent += sectionTitle(MESSAGE_POPUP_CHANGE_IP_IPV4);
}
popupContent += formRows('v4');
if (ipAddresses.v6.length > 0) {
popupContent += sectionTitle(MESSAGE_POPUP_CHANGE_IP_IPV6);
popupContent += formRows('v6');
}
popupContent = '<div class="form-box">' + popupContent + '</div>';
var popup = new Jsw.Popup({
title: title,
content: popupContent,
buttons: [
{
id: 'changeIpOkButton',
title: MESSAGE_POPUP_CHANGE_IP_BUTTON_OK,
class: 'action',
handler: function (event, popup) {
function getValue(ipType) {
var value = $$('input:checked[type=radio][name=mappingType' + ipType + ']').first().value;
if (value == 'selected') {
value = $$('input[name="change-ip-' + ipType + '"]').first().value;
}
return value;
}
var parameters = {
subscriptions: Object.toJSON(subscriptions)
};
parameters.ipv4 = getValue('v4');
if (ipAddresses.v6.length > 0) {
parameters.ipv6 = getValue('v6');
}
disableButtonInProgress($('changeIpOkButton'), 'changingButtonTitle');
disableButtonPlain($('changeIpCancelButton'));
new Ajax.Request(URL_CHANGE_IP_SUBSCRIPTIONS, {
parameters: parameters,
onSuccess: function (response) {
if (onSuccess) {
onSuccess();
}
popup.hide();
}
});
}
},
{
id: 'changeIpCancelButton',
title: MESSAGE_POPUP_CHANGE_IP_BUTTON_CANCEL,
handler: function (event, popup) {
popup.hide();
}
}
],
popupCls: 'popup-panel popup-panel-centered migrator-popup-reassign'
});
popup.show();
function addLookup(ipType, ipAddresses)
{
var ipLookupData = [];
for (var i = 0; i < ipAddresses.length; i++) {
var ip = ipAddresses[i];
ipLookupData.push({id: ip, title: ip});
}
var lookup = new Jsw.LookUpExtended({
id: 'change-ip-' + ipType,
name: 'change-ip-' + ipType,
renderTo: 'change-ip-' + ipType + '-input-container',
data: ipLookupData,
value: '',
locale: CHANGE_IP_LOCALE
});
function updateLookupStatus() {
if ($('mappingSelected' + ipType).checked) {
lookup.enable();
} else {
lookup.disable();
}
}
$$('input[name="mappingType' + ipType + '"]').each(function(element) {
element.observe('change', updateLookupStatus)
});
updateLookupStatus();
}
addLookup('v4', ipAddresses.v4);
if (ipAddresses.v6.length > 0) {
addLookup('v6', ipAddresses.v6);
}
}
});
}

View File

@@ -1,147 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
function showFetchSourcePopup(session, onFinishedSuccess, onCloseWithErrors) {
var errorMessage = null;
var errorId = null;
var cancel = false;
var popup = new Jsw.Popup({
title: 'Preparing migration',
content: (
'<div style="margin-bottom: 10px;">' +
'<div id="fetch-source-action-text">' +
migratorLocale.lmsg('fetchSourceStarting') +
'</div>' +
'<div id="fetch-source-error-text" style="display: none">' +
'</div>' +
'<div id="fetch-source-download-rpc-agent" style="margin-top: 15px; display: none;">' +
'<a href="' + URL_DOWNLOAD_RPC_AGENT + '">' +
migratorLocale.lmsg('downloadRpcAgent') +
'</a>' +
'</div>' +
'</div>' +
'<div class="migrator-progress-bar" id="fetch-source-progress-bar">' +
'<div class="migrator-progress-bar-wrap">' +
'<div style="width: 100%;" class="migrator-progress-bar-fill"><span></span></div>' +
'</div>' +
'</div>'
),
buttons: [
{
id: 'fetch-source-cancel-button',
title: migratorLocale.lmsg('fetchSourceButtonCancel'),
handler: function (event, popup) {
cancel = true;
elemActionText.show();
elemErrorText.hide();
elemErrorDownloadRpcAgent.hide();
elemProgressBar.show();
elemCancelButton.show();
elemCloseButton.hide();
elemActionText.update(migratorLocale.lmsg('fetchSourceCancelling'));
new Ajax.Request(URL_CANCEL_FETCH_SOURCE + '/session/' + session);
}
},
{
id: 'fetch-source-close-button',
title: migratorLocale.lmsg('fetchSourceButtonClose'),
handler: function (event, popup) {
popup.hide();
if (errorMessage && onCloseWithErrors) {
onCloseWithErrors(errorId, errorMessage);
}
}
}
],
popupCls: 'popup-panel popup-panel-centered'
});
popup.show();
var elemActionText = $('fetch-source-action-text');
var elemErrorText = $('fetch-source-error-text');
var elemErrorDownloadRpcAgent = $('fetch-source-download-rpc-agent');
var elemProgressBar = $('fetch-source-progress-bar');
var elemCancelButton = $('fetch-source-cancel-button').up();
var elemCloseButton = $('fetch-source-close-button').up();
elemCloseButton.hide();
function pollProgress() {
new Ajax.Request(URL_GET_PROGRESS + '/session/' + session, {
onSuccess: function (response) {
var progress = response.responseText.evalJSON();
if (
progress.status == overallStatus.FINISHED_OK ||
progress.status == overallStatus.FINISHED_WARNINGS
) {
if (cancel) {
cancel = false;
popup.hide();
return;
}
// Show that operation has finished and redirect to object selections screen
elemActionText.show();
elemErrorText.hide();
elemErrorDownloadRpcAgent.hide();
elemProgressBar.hide();
elemActionText.update(migratorLocale.lmsg('fetchSourceFinished'));
if (onFinishedSuccess) {
onFinishedSuccess();
}
} else if (
progress.status == overallStatus.FINISHED_ERRORS
) {
if (cancel) {
cancel = false;
popup.hide();
return;
}
// Show error message
elemActionText.hide();
elemErrorText.show();
if (progress.errorId && progress.errorId.indexOf('RPC_AGENT_') === 0) {
elemErrorDownloadRpcAgent.show();
} else {
elemErrorDownloadRpcAgent.hide();
}
elemProgressBar.hide();
elemCancelButton.hide();
elemCloseButton.show();
elemErrorText.update(formatStr(progress.errorMessage));
// Set error variables so they could be passed back to display error handler
errorMessage = progress.errorMessage;
errorId = progress.errorId;
} else { // Not started or in progress
// Update progress message if exists
if (!cancel) {
elemActionText.show();
elemErrorText.hide();
elemErrorDownloadRpcAgent.hide();
elemProgressBar.show();
elemCancelButton.show();
elemCloseButton.hide();
if (progress.action) {
elemActionText.update(formatStr(progress.action));
}
}
// Poll progress once more
setTimeout(pollProgress, FETCH_SOURCE_POLL_INTERVAL);
}
},
onFailure: function() {
setTimeout(pollProgress, FETCH_SOURCE_POLL_INTERVAL);
}
});
}
pollProgress();
}

View File

@@ -1,179 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with settings to start migration.
// Arguments:
// - subscriptions - list of subscription names.
// - onSuccess - function that will be called once migration of these subscriptions is scheduled.
function showMigratePopup(subscriptions, onSuccess, showServerConfigurationBlock, showExtensionsSettingsBlock) {
// compose title - it is different when one subscription is selected
// and when multiple subscriptions are selected
var title = '';
if (subscriptions.length > 1) {
title = formatMessage(MESSAGE_POPUP_MIGRATE_TITLE_MIGRATE_MULTIPLE, subscriptions.length);
} else if (subscriptions.length == 1) {
title = formatMessage(MESSAGE_POPUP_MIGRATE_TITLE_MIGRATE_SINGLE, subscriptions[0]);
} else {
// no subscriptions - no sense to show dialog
return;
}
function getServerSettingsBlock() {
let html = '';
if (showServerConfigurationBlock) {
html += (
'<div>' +
'<input type="checkbox" class="checkbox" id="copyMailSettings"> ' +
'<label for="copyMailSettings">' +
MESSAGE_POPUP_MIGRATE_COPY_MAIL_SETTINGS +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="copyAdminProfile"> ' +
'<label for="copyAdminProfile">' +
MESSAGE_POPUP_MIGRATE_COPY_ADMIN_PROFILE +
'</label>' +
'</div>'
)
}
if (showExtensionsSettingsBlock) {
html += (
'<div>' +
'<input type="checkbox" class="checkbox" id="copyExtensionsSettings"> ' +
'<label for="copyExtensionsSettings">' +
MESSAGE_POPUP_MIGRATE_COPY_EXTENSIONS_SETTINGS +
'</label>' +
'</div>'
);
}
if (html) {
html = (
'<div class="field-name">' + MESSAGE_POPUP_MIGRATE_SERVER_SETTINGS + '</div>' +
'<div class="field-value">' +
html +
'</div>' +
'<br />'
);
}
return html;
}
var popup = new Jsw.Popup({
title: title,
content: (
'<div class="form-row">' +
'<div class="field-name">' + MESSAGE_POPUP_MIGRATE_CONTENT + '</div>' +
'<div class="field-value">' +
'<div>' +
'<input type="checkbox" class="checkbox" id="copyFiles" checked="checked"> ' +
'<label for="copyFiles">' +
MESSAGE_POPUP_MIGRATE_COPY_FILES +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="copyDatabases" checked="checked"> ' +
'<label for="copyDatabases">' +
MESSAGE_POPUP_MIGRATE_COPY_DATABASES +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="copyMail" checked="checked"> ' +
'<label for="copyMail">' +
MESSAGE_POPUP_MIGRATE_COPY_MAIL +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="copyId" checked="checked"> ' +
'<label for="copyId">' +
MESSAGE_POPUP_MIGRATE_COPY_ID +
'</label>' +
'</div>' +
'</div>' +
'<br />' +
getServerSettingsBlock() +
'<div class="field-name">' + migratorLocale.lmsg('popupMigratePreChecks') + '</div>' +
'<div class="field-value">' +
'<input type="checkbox" class="checkbox" id="runPreChecks" checked="checked"> ' +
'</div>' +
'</div>'
),
buttons: [
{
id: 'migrateOkButton',
title: MESSAGE_POPUP_MIGRATE_BUTTON_OK,
class: 'action',
handler: function (event, popup) {
var elemCopyFiles = $('copyFiles');
var elemCopyDatabases = $('copyDatabases');
var elemCopyMail = $('copyMail');
var elemCopyId = $('copyId');
var elemMailSettings = $('copyMailSettings');
var elemExtensionsSettings = $('copyExtensionsSettings');
var elemAdminProfile = $('copyAdminProfile');
var elemRunPreChecks = $('runPreChecks');
disableButtonInProgress($('migrateOkButton'), 'schedulingButtonTitle');
disableButtonPlain($('migrateCancelButton'));
if (elemRunPreChecks.checked) {
// Run pre-migration checks
new Ajax.Request(URL_RUN_PRE_MIGRATION_CHECKS, {
parameters: {
subscriptions: Object.toJSON(subscriptions),
copyFiles: elemCopyFiles.checked,
copyDatabases: elemCopyDatabases.checked,
copyMail: elemCopyMail.checked,
copyId: elemCopyId.checked,
copyMailSettings: elemMailSettings ? elemMailSettings.checked : false,
copyExtensionsSettings: elemExtensionsSettings ? elemExtensionsSettings.checked : false,
copyAdminProfile: elemAdminProfile ? elemAdminProfile.checked : false,
},
onSuccess: function (response) {
var result = response.responseText.evalJSON();
if (onSuccess) {
onSuccess();
}
popup.hide();
showPreChecksPopup(result.task, true, true);
}
});
} else {
// Start migration immediately
new Ajax.Request(URL_MIGRATE_SUBSCRIPTIONS, {
parameters: {
subscriptions: Object.toJSON(subscriptions),
copyFiles: elemCopyFiles.checked,
copyDatabases: elemCopyDatabases.checked,
copyMail: elemCopyMail.checked,
copyId: elemCopyId.checked,
copyMailSettings: elemMailSettings ? elemMailSettings.checked : false,
copyExtensionsSettings: elemExtensionsSettings ? elemExtensionsSettings.checked : false,
copyAdminProfile: elemAdminProfile ? elemAdminProfile.checked : false,
},
onSuccess: function (response) {
if (onSuccess) {
onSuccess();
}
popup.hide();
}
});
}
}
},
{
id: 'migrateCancelButton',
title: MESSAGE_POPUP_MIGRATE_BUTTON_CANCEL,
handler: function (event, popup) {
popup.hide();
}
}
],
popupCls: 'popup-panel popup-panel-centered'
});
popup.show();
}

View File

@@ -1,115 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with settings to start post-migration checks.
// Arguments:
// - subscriptions - list of subscription names.
// - onSuccess - function that will be called once post migration checks of these subscriptions is scheduled.
function showPostMigrationChecksPopup(subscriptions, onSuccess) {
// compose title - it is different when one subscription is selected
// and when multiple subscriptions are selected
var title = '';
if (subscriptions.length > 1) {
title = formatMessage(MESSAGE_POPUP_POST_MIGRATION_CHECKS_TITLE_MULTIPLE, subscriptions.length);
} else if (subscriptions.length == 1) {
title = formatMessage(MESSAGE_POPUP_POST_MIGRATION_CHECKS_TITLE_SINGLE, subscriptions[0]);
} else {
// no subscriptions - no sense to show dialog
return;
}
var popup = new Jsw.Popup({
title: title,
content: (
'<div class="form-row">' +
'<div class="field-name">' + MESSAGE_POPUP_POST_MIGRATION_CHECKS_WHAT + '</div>' +
'<div class="field-value">' +
'<div>' +
'<input type="checkbox" class="checkbox" id="testSites" checked="checked"> ' +
'<label for="testSites">' +
MESSAGE_POPUP_POST_MIGRATION_CHECKS_SITES +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="testMail" checked="checked"> ' +
'<label for="testMail">' +
MESSAGE_POPUP_POST_MIGRATION_CHECKS_MAIL +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="testDatabases" checked="checked"> ' +
'<label for="testDatabases">' +
MESSAGE_POPUP_POST_MIGRATION_CHECKS_DATABASES +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="testDNS" checked="checked"> ' +
'<label for="testDNS">' +
MESSAGE_POPUP_POST_MIGRATION_CHECKS_DNS +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="testUsers" checked="checked"> ' +
'<label for="testUsers">' +
MESSAGE_POPUP_POST_MIGRATION_CHECKS_USERS +
'</label>' +
'</div>' +
'</div>' +
'</div>'
),
buttons: [
{
id: 'postMigrationChecksOkButton',
title: MESSAGE_POPUP_POST_MIGRATION_CHECKS_BUTTON_OK,
class: 'action',
handler: function(event, popup) {
var elemTestSites = $('testSites');
var elemTestMail = $('testMail');
var elemTestDatabases = $('testDatabases');
var elemTestDNS = $('testDNS');
var elemTestUsers = $('testUsers');
if (
!elemTestSites.checked &&
!elemTestMail.checked &&
!elemTestDatabases.checked &&
!elemTestDNS.checked &&
!elemTestUsers.checked
) {
popup.hide();
return;
}
disableButtonInProgress($('postMigrationChecksOkButton'), 'schedulingButtonTitle');
disableButtonPlain($('postMigrationChecksCancelButton'));
new Ajax.Request(URL_POST_MIGRATION_CHECKS_SUBSCRIPTIONS, {
parameters: {
subscriptions: Object.toJSON(subscriptions),
testSites: elemTestSites.checked,
testMail: elemTestMail.checked,
testDatabases: elemTestDatabases.checked,
testDNS: elemTestDNS.checked,
testUsers: elemTestUsers.checked
},
onSuccess: function (response) {
if (onSuccess) {
onSuccess();
}
popup.hide();
}
});
}
},
{
id: 'postMigrationChecksCancelButton',
title: MESSAGE_POPUP_POST_MIGRATION_CHECKS_BUTTON_CANCEL,
handler: function(event, popup) {
popup.hide();
}
}
],
popupCls: 'popup-panel popup-panel-centered'
});
popup.show();
}

View File

@@ -1,156 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
function showPreChecksPopup(taskId, proceedToMigrationIfNoIssues, redirectToListOfSubscriptions) {
var skipChecks = false;
var skipChecksFinished = false;
var successRedirectUrl = URL_MIGRATION_STATUS;
var redirectToListOfSubscriptionsVal = 'false';
if (redirectToListOfSubscriptions) {
successRedirectUrl = URL_LIST_OF_SUBSCRIPTIONS;
redirectToListOfSubscriptionsVal = 'true';
}
var popup = new Jsw.Popup({
title: migratorLocale.lmsg('preMigrationChecksTitle'),
content: (
'<div style="margin-bottom: 10px;">' +
'<span id="pre-checks-action-text">' +
migratorLocale.lmsg('preMigrationChecksStarting') +
'</span>' +
'<span id="pre-checks-error-text" style="display: none">' +
'</span>' +
'</div>' +
'<div class="migrator-progress-bar" id="pre-checks-progress-bar">' +
'<div class="migrator-progress-bar-wrap">' +
'<div style="width: 100%;" class="migrator-progress-bar-fill"><span></span></div>' +
'</div>' +
'</div>'
),
buttons: [
{
id: 'pre-check-skip-button',
title: migratorLocale.lmsg('preMigrationChecksSkipButton'),
handler: function (event, popup) {
skipChecks = true;
var skipButton = $('pre-check-skip-button');
var inBackgroundButton = $('pre-check-in-background');
skipButton.up().addClassName('disabled');
inBackgroundButton.up().addClassName('disabled');
skipButton.disabled = true;
inBackgroundButton.disabled = true;
skipButton.update(
'<span class="wait">' + migratorLocale.lmsg('waitButtonTitle') + '</span>'
);
elemActionText.update(migratorLocale.lmsg('preMigrationChecksCancelling'));
new Ajax.Request(URL_CANCEL_PRE_CHECKS + '/task/' + taskId, {
onSuccess: function() {
skipChecksFinished = true;
}
});
}
},
{
id: 'pre-check-in-background',
title: migratorLocale.lmsg('preMigrationChecksInBackgroud'),
handler: function(event, popup) {
var skipButton = $('pre-check-skip-button');
var inBackgroundButton = $('pre-check-in-background');
skipButton.up().addClassName('disabled');
inBackgroundButton.up().addClassName('disabled');
skipButton.disabled = true;
inBackgroundButton.disabled = true;
inBackgroundButton.update(
'<span class="wait">' + migratorLocale.lmsg('waitButtonTitle') + '</span>'
);
Jsw.redirect(successRedirectUrl);
}
}
],
popupCls: 'popup-panel popup-panel-centered'
});
popup.show();
var elemActionText = $('pre-checks-action-text');
function pollProgress() {
new Ajax.Request(URL_GET_PROGRESS_PRE_CHECKS + '/task/' + taskId, {
onSuccess: function (response) {
var progress = response.responseText.evalJSON();
if (
progress.status == overallStatus.FINISHED_OK ||
progress.status == overallStatus.FINISHED_WARNINGS ||
progress.status == overallStatus.FINISHED_ERRORS
) {
if (skipChecks) {
new Ajax.Request(URL_START_MIGRATION + '/task/' + taskId, {
onSuccess: function (response) {
Jsw.redirect(successRedirectUrl);
}
});
return;
}
if (proceedToMigrationIfNoIssues) {
elemActionText.update(migratorLocale.lmsg('preMigrationChecksFinishedCheckIssues'));
new Ajax.Request(URL_HAS_PRE_MIGRATION_ISSUES + '/task/' + taskId, {
onSuccess: function (response) {
var hasPreMigrationIssues = response.responseText.evalJSON();
if (hasPreMigrationIssues) {
elemActionText.update(migratorLocale.lmsg('preMigrationChecksFinishedCheckIssues'));
Jsw.redirect(
URL_PRE_MIGRATION_CHECK_RESULTS +
'/task/' + taskId +
'/redirect-to-list-of-subscriptions/' + redirectToListOfSubscriptionsVal
);
} else {
elemActionText.update(migratorLocale.lmsg('preMigrationChecksFinishedStartingMigration'));
new Ajax.Request(URL_START_MIGRATION + '/task/' + taskId, {
onSuccess: function (response) {
Jsw.redirect(successRedirectUrl);
}
});
}
}
});
} else {
elemActionText.update(migratorLocale.lmsg('preMigrationChecksFinishedRedirecting'));
Jsw.redirect(
URL_PRE_MIGRATION_CHECK_RESULTS +
'/task/' + taskId +
'/redirect-to-list-of-subscriptions/' + redirectToListOfSubscriptionsVal
);
}
} else if (!progress.status && skipChecksFinished) {
new Ajax.Request(URL_START_MIGRATION + '/task/' + taskId, {
onSuccess: function (response) {
Jsw.redirect(successRedirectUrl);
}
});
} else {
if (!skipChecks) {
if (progress.action) {
elemActionText.update(formatStr(progress.action));
} else if (progress.status == null) {
elemActionText.update(migratorLocale.lmsg('preMigrationChecksWaitingForTasks'))
}
}
// Poll progress once more
setTimeout(pollProgress, PRE_CHECKS_POLL_INTERVAL);
}
},
onFailure: function() {
setTimeout(pollProgress, PRE_CHECKS_POLL_INTERVAL);
}
});
}
pollProgress();
}

View File

@@ -1,78 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog to reassign owner of subscriptions.
// Arguments: subscriptions - list of subscription names.
function showReassignOwnerPopup(subscriptions, onSuccess) {
// compose title - it is different when one subscription is selected
// and when multiple subscriptions are selected
var title = '';
if (subscriptions.length > 1) {
title = formatMessage(MESSAGE_POPUP_REASSIGN_OWNER_TITLE_MULTIPLE, subscriptions.length);
} else if (subscriptions.length == 1) {
title = formatMessage(MESSAGE_POPUP_REASSIGN_OWNER_TITLE_MIGRATE_SINGLE, subscriptions[0]);
} else {
// no subscriptions - no sense to show dialog
return;
}
var popup = new Jsw.Popup({
title: title,
content: (
'<div class="form-row">' +
'<div class="field-name">' + MESSAGE_POPUP_REASSIGN_OWNER_NAME + '</div>' +
'<div class="field-value">' +
'<div id="reassign-input-container"></div>' +
'</div>' +
'</div>'
),
buttons: [
{
id: 'reassignOwnerOkButton',
title: MESSAGE_POPUP_REASSIGN_OWNER_BUTTON_OK,
class: 'action',
handler: function (event, popup) {
var elemReassignOwner = $$('input[name="reassign-owner"]').first();
var ownerInfo = elemReassignOwner.value.evalJSON();
var ownerType = ownerInfo[0];
var ownerLogin = ownerInfo[1];
disableButtonInProgress($('reassignOwnerOkButton'), 'changingButtonTitle');
disableButtonPlain($('reassignOwnerCancelButton'));
new Ajax.Request(URL_REASSIGN_OWNER_SUBSCRIPTIONS, {
parameters: {
subscriptions: Object.toJSON(subscriptions),
ownerType: ownerType,
ownerLogin: ownerLogin
},
onSuccess: function (response) {
if (onSuccess) {
onSuccess();
}
popup.hide();
}
});
}
},
{
id: 'reassignOwnerCancelButton',
title: MESSAGE_POPUP_REASSIGN_OWNER_BUTTON_CANCEL,
handler: function (event, popup) {
popup.hide();
}
}
],
popupCls: 'popup-panel popup-panel-centered migrator-popup-reassign'
});
popup.show();
new Jsw.LookUp({
id: 'reassign-owner',
name: 'reassign-owner',
renderTo: 'reassign-input-container',
data: REASSIGN_OWNER_DATA,
value: '',
locale: REASSIGN_OWNER_LOCALE
});
}

View File

@@ -1,83 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog to reassign plan of subscriptions.
// Arguments: subscriptions - list of subscription names.
function showReassignPlanPopup(subscriptions, onSuccess) {
// compose title - it is different when one subscription is selected
// and when multiple subscriptions are selected
var title = '';
if (subscriptions.length > 1) {
title = formatMessage(MESSAGE_POPUP_REASSIGN_PLAN_TITLE_MULTIPLE, subscriptions.length);
} else if (subscriptions.length == 1) {
title = formatMessage(MESSAGE_POPUP_REASSIGN_PLAN_TITLE_MIGRATE_SINGLE, subscriptions[0]);
} else {
// no subscriptions - no sense to show dialog
return;
}
new Ajax.Request(URL_GET_REASSIGN_PLAN_CONTROL_DATA, {
parameters: {
subscriptions: Object.toJSON(subscriptions)
},
onSuccess: function(response) {
var planControlData = response.responseText.evalJSON();
var popup = new Jsw.Popup({
title: title,
content: (
'<div class="form-row">' +
'<div class="field-name">' + MESSAGE_POPUP_REASSIGN_PLAN_NEW_PLAN + '</div>' +
'<div class="field-value">' +
'<div id="reassign-plan-input-container"></div>' +
'</div>' +
'</div>'
),
buttons: [
{
id: 'reassignPlanOkButton',
title: MESSAGE_POPUP_REASSIGN_PLAN_BUTTON_OK,
class: 'action',
handler: function (event, popup) {
var elemReassignPlan = $$('input[name="reassign-plan"]').first();
disableButtonInProgress($('reassignPlanOkButton'), 'changingButtonTitle');
disableButtonPlain($('reassignPlanCancelButton'));
new Ajax.Request(URL_REASSIGN_PLAN_SUBSCRIPTIONS, {
parameters: {
subscriptions: Object.toJSON(subscriptions),
plan: elemReassignPlan.value
},
onSuccess: function (response) {
if (onSuccess) {
onSuccess();
}
popup.hide();
}
});
}
},
{
id: 'reassignPlanCancelButton',
title: MESSAGE_POPUP_REASSIGN_PLAN_BUTTON_CANCEL,
handler: function (event, popup) {
popup.hide();
}
}
],
popupCls: 'popup-panel popup-panel-centered migrator-popup-reassign'
});
popup.show();
new Jsw.LookUp({
id: 'reassign-plan',
name: 'reassign-plan',
renderTo: 'reassign-plan-input-container',
data: planControlData,
value: '',
locale: REASSIGN_PLAN_LOCALE
});
}
});
}

View File

@@ -1,48 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with confirmation to remove subscriptions from target server.
// Arguments: subscriptions - list of subscription names.
function showRemovePopup(subscriptions, onSuccess) {
// Hack to create dialog box, which does not immediately close dialog when "Yes" button is clicked
var RemoveMessageBox = Class.create(
// take MessageBox class as superclass of AjaxMessageBox, because MessageBox class is not public since 17.8
Jsw.AjaxMessageBox.superclass,
{
_defaultOnButtonClick: function() {}
}
);
var messageBox = new RemoveMessageBox({
'type': Jsw.messageBox.TYPE_YESNO,
'subtype': 'delete',
'text': migratorLocale.lmsg('popupRemoveDescription'),
'onYesClick': function () {
this._componentElement.select('button').each(function(button) {
button.disabled = true;
button.up().addClassName('disabled');
});
this._componentElement.select('button').first().update(
'<span class="wait">' + migratorLocale.lmsg('popupRemoveInProgress') + '</span>'
);
new Ajax.Request(URL_REMOVE_SUBSCRIPTIONS, {
parameters: {
subscriptions: Object.toJSON(subscriptions)
},
onSuccess: function() {
messageBox.hide();
if (onSuccess) {
onSuccess();
}
}
});
},
'onNoClick': function () {
this.hide();
},
'buttonTitles': {
'yes': migratorLocale.lmsg('popupRemoveButtonYes'),
'no': migratorLocale.lmsg('popupRemoveButtonNo')
}
});
messageBox.show();
}

View File

@@ -1,179 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with settings to start re-sync of content (web, databases, mail).
// Arguments:
// - subscriptions - list of subscription names.
// - onSuccess - function that will be called once resync of these subscriptions is scheduled.
function showResyncPopup(subscriptions, onSuccess, showServerConfigurationBlock, showExtensionsSettingsBlock) {
// compose title - it is different when one subscription is selected
// and when multiple subscriptions are selected
var title = '';
if (subscriptions.length > 1) {
title = formatMessage(MESSAGE_POPUP_RESYNC_TITLE_MULTIPLE, subscriptions.length);
} else if (subscriptions.length == 1) {
title = formatMessage(MESSAGE_POPUP_RESYNC_TITLE_SINGLE, subscriptions[0]);
} else {
// no subscriptions - no sense to show dialog
return;
}
function getServerSettingsBlock() {
let html = '';
if (showServerConfigurationBlock) {
html += (
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncMailSettings"> ' +
'<label for="resyncMailSettings">' +
MESSAGE_POPUP_RESYNC_MAIL_SETTINGS +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncAdminProfile"> ' +
'<label for="resyncAdminProfile">' +
MESSAGE_POPUP_RESYNC_ADMIN_PROFILE +
'</label>' +
'</div>'
)
}
if (showExtensionsSettingsBlock) {
html += (
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncExtensionsSettings"> ' +
'<label for="resyncExtensionsSettings">' +
MESSAGE_POPUP_RESYNC_EXTENSIONS_SETTINGS +
'</label>' +
'</div>'
);
}
if (html) {
html = (
'<br />' +
'<div class="field-name">' + MESSAGE_POPUP_RESYNC_SERVER_SETTINGS + '</div>' +
'<div class="field-value">' +
html +
'</div>'
);
}
return html;
}
var popup = new Jsw.Popup({
title: title,
content: (
'<div class="form-row">' +
'<div class="field-name">' + MESSAGE_POPUP_RESYNC_CONTENT + '</div>' +
'<div class="field-value">' +
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncBusinessObjects"> ' +
'<label for="resyncBusinessObjects">' +
MESSAGE_POPUP_RESYNC_BUSINESS_OBJECTS +
'</label>' +
'</div>' +
'<div style="padding-left: 20px">' +
'<input type="checkbox" class="checkbox" id="resyncId"> ' +
'<label for="resyncId">' +
MESSAGE_POPUP_RESYNC_ID +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncFiles" checked="checked"> ' +
'<label for="resyncFiles">' +
MESSAGE_POPUP_RESYNC_FILES +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncDatabases" checked="checked"> ' +
'<label for="resyncDatabases">' +
MESSAGE_POPUP_RESYNC_DATABASES +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncMail" checked="checked"> ' +
'<label for="resyncMail">' +
MESSAGE_POPUP_RESYNC_MAIL +
'</label>' +
'</div>' +
'</div>' +
getServerSettingsBlock() +
'</div>'
),
buttons: [
{
id: 'resyncOkButton',
title: MESSAGE_POPUP_RESYNC_BUTTON_OK,
class: 'action',
handler: function(event, popup) {
var elemResyncBusinessObjects = $('resyncBusinessObjects');
var elemResyncFiles = $('resyncFiles');
var elemResyncDatabases = $('resyncDatabases');
var elemResyncMail = $('resyncMail');
var elemResyncId = $('resyncId');
var elemResyncMailSettings = $('resyncMailSettings');
var elemResyncAdminProfile = $('resyncAdminProfile');
var elemResyncExtensionsSettings = $('resyncExtensionsSettings');
var someResyncChecked = [
elemResyncBusinessObjects,
elemResyncFiles,
elemResyncDatabases,
elemResyncMail,
elemResyncId,
elemResyncMailSettings,
elemResyncAdminProfile,
elemResyncExtensionsSettings
].some(elem => elem && elem.checked);
if (someResyncChecked) {
disableButtonInProgress($('resyncOkButton'), 'schedulingButtonTitle');
disableButtonPlain($('resyncCancelButton'));
new Ajax.Request(URL_RESYNC_SUBSCRIPTIONS, {
parameters: {
subscriptions: Object.toJSON(subscriptions),
resyncBusinessObjects: elemResyncBusinessObjects.checked,
resyncFiles: elemResyncFiles.checked,
resyncDatabases: elemResyncDatabases.checked,
resyncMail: elemResyncMail.checked,
resyncId: elemResyncId.checked,
resyncMailSettings: elemResyncMailSettings ? elemResyncMailSettings.checked : false,
resyncAdminProfile: elemResyncAdminProfile ? elemResyncAdminProfile.checked : false,
resyncExtensionsSettings: elemResyncExtensionsSettings ? elemResyncExtensionsSettings.checked : false,
},
onSuccess: function (response) {
if (onSuccess) {
onSuccess();
}
popup.hide();
}
});
} else {
popup.hide();
}
}
},
{
id: 'resyncCancelButton',
title: MESSAGE_POPUP_RESYNC_BUTTON_CANCEL,
handler: function(event, popup) {
popup.hide();
}
}
],
popupCls: 'popup-panel popup-panel-centered'
});
var resyncBusinessObjectsCheckbox = document.getElementById('resyncBusinessObjects');
var resyncIdCheckbox = document.getElementById('resyncId');
resyncIdCheckbox.disabled = true;
resyncBusinessObjectsCheckbox.addEventListener('change', (event) => {
resyncIdCheckbox.disabled = !event.target.checked;
resyncIdCheckbox.checked = event.target.checked;
})
popup.show();
}

View File

@@ -1,29 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with confirmation to revert DNS forwarding.
// Arguments:
// - subscriptions - list of subscription names.
// - onSuccess - function that will be called once DNS revert of these subscriptions is scheduled.
function showRevertDnsPopup(subscriptions, onSuccess) {
Jsw.messageBox.show({
'type': Jsw.messageBox.TYPE_YESNO,
'subtype': 'delete',
'text': MESSAGE_POPUP_REVERT_DNS_DESCRIPTION,
'onYesClick': function () {
new Ajax.Request(URL_REVERT_DNS_SUBSCRIPTIONS, {
parameters: {
subscriptions: Object.toJSON(subscriptions)
},
onSuccess: function() {
if (onSuccess) {
onSuccess();
}
}
});
},
'buttonTitles': {
'yes': MESSAGE_POPUP_REVERT_DNS_BUTTON_YES,
'no': MESSAGE_POPUP_REVERT_DNS_BUTTON_NO
}
});
}

View File

@@ -1,145 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with service node and IP address type selection for Plesk Multi Server.
// Arguments: subscriptions - list of subscription names.
function showSelectNodePopup(subscriptions, onSuccess) {
// compose title - it is different when one subscription is selected
// and when multiple subscriptions are selected
var title = '';
if (subscriptions.length > 1) {
title = migratorLocale.lmsg('popupSelectNodeTitleMultiple', { count: subscriptions.length } );
} else if (subscriptions.length == 1) {
title = migratorLocale.lmsg('popupSelectNodeTitleSingle', { subscriptionName: subscriptions[0] });
} else {
// no subscriptions - no sense to show dialog
return;
}
new Ajax.Request(URL_LIST_PLESK_MULTI_SERVER_NODES, {
onSuccess: function (response) {
var nodeIPs = response.responseText.evalJSON();
var popupContent = '<div class="form-box">' +
'<div class="form-row">' +
'<div class="field-name">' + migratorLocale.lmsg('popupSelectNodeNode') + '</div>' +
'<div class="field-value">' +
'<div id="select-node-input-container"></div>' +
'</div>' +
'</div>' +
'<div class="form-row">' +
'<div class="field-name">' + migratorLocale.lmsg('popupSelectNodeIPv4Type') + '</div>' +
'<div class="field-value">' +
'<div class="text-value">' +
'<div class="indent-box">' +
'<input type="radio" name="mappingTypeV4" id="mappingTypeV4Shared" class="radio" value="shared" checked="checked"> ' +
'<label for="mappingTypeV4Shared">' +
migratorLocale.lmsg('popupSelectNodeIPShared') +
'</label>' +
'</div>' +
'<div class="indent-box">' +
'<input type="radio" name="mappingTypeV4" id="mappingTypeV4Dedicated" class="radio" value="dedicated"> ' +
'<label for="mappingTypeV4Dedicated">' +
migratorLocale.lmsg('popupSelectNodeIPDedicated') +
'</label>' +
'</div>' +
'<div class="indent-box">' +
'<input type="radio" name="mappingTypeV4" class="radio" id="mappingTypeV4None" value="none"> ' +
'<label for="mappingTypeV4None">' +
migratorLocale.lmsg('popupSelectNodeIPNone') +
'</label>' +
'</div>' +
'</div>' +
'</div>' +
'</div>' +
'<div class="form-row">' +
'<div class="field-name">' + migratorLocale.lmsg('popupSelectNodeIPv6Type') + '</div>' +
'<div class="field-value">' +
'<div class="text-value">' +
'<div class="indent-box">' +
'<input type="radio" name="mappingTypeV6" id="mappingTypeV6Shared" class="radio" value="shared"> ' +
'<label for="mappingTypeV6Shared">' +
migratorLocale.lmsg('popupSelectNodeIPShared') +
'</label>' +
'</div>' +
'<div class="indent-box">' +
'<input type="radio" name="mappingTypeV6" id="mappingTypeV6Dedicated" class="radio" value="dedicated"> ' +
'<label for="mappingTypeV6Dedicated">' +
migratorLocale.lmsg('popupSelectNodeIPDedicated') +
'</label>' +
'</div>' +
'<div class="indent-box">' +
'<input type="radio" name="mappingTypeV6" class="radio" id="mappingTypeV6None" value="none" checked="checked"> ' +
'<label for="mappingTypeV6None">' +
migratorLocale.lmsg('popupSelectNodeIPNone') +
'</label>' +
'</div>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
var popup = new Jsw.Popup({
title: title,
content: popupContent,
buttons: [
{
id: 'selectNodeOkButton',
title: migratorLocale.lmsg('popupSelectNodeButtonOk'),
class: 'action',
handler: function (event, popup) {
disableButtonInProgress($('selectNodeOkButton'), 'changingButtonTitle');
disableButtonPlain($('selectNodeCancelButton'));
var parameters = {
subscriptions: Object.toJSON(subscriptions),
ipv4: $$('input:checked[type=radio][name=mappingTypeV4]').first().value,
ipv6: $$('input:checked[type=radio][name=mappingTypeV6]').first().value,
nodeIP: $$('input[name=select-node]').first().value
};
new Ajax.Request(URL_CHANGE_IP_SUBSCRIPTIONS, {
parameters: parameters,
onSuccess: function (response) {
if (onSuccess) {
onSuccess();
}
popup.hide();
}
});
}
},
{
id: 'selectNodeCancelButton',
title: migratorLocale.lmsg('popupSelectNodeButtonCancel'),
handler: function (event, popup) {
popup.hide();
}
}
],
popupCls: 'popup-panel popup-panel-centered migrator-popup-reassign'
});
popup.show();
function addLookup(nodeIPAddresses)
{
var nodeIPLookupData = [];
for (var i = 0; i < nodeIPAddresses.length; i++) {
var ip = nodeIPAddresses[i];
nodeIPLookupData.push({id: ip, title: ip});
}
var lookup = new Jsw.LookUpExtended({
id: 'select-node',
name: 'select-node',
renderTo: 'select-node-input-container',
data: nodeIPLookupData,
value: '',
locale: SELECT_NODE_LOCALE
});
}
addLookup(nodeIPs);
}
});
}

View File

@@ -1,107 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with migration issues for some object
// Arguments:
// - title: popup dialog title
// - issues - array of objects, each object describes an issue and contains problem text, solution text, etc,
// see asDictionary method of Modules_PanelMigrator_Backend_Issue
function showIssuesPopupDialog(title, issues) {
var popupContent = '';
popupContent += '<div class="status-details-dialog-content">';
function composeIssueHtml(issue) {
var image = migratorImage('subscription-status-success.png');
if (issue.severity == issueSeverity.ERROR) {
image = migratorImage('subscription-status-error.png');
} else if (issue.severity == issueSeverity.WARNING) {
image = migratorImage('subscription-status-warning.png');
}
var html = '';
html += '<div>';
html += '<img src="' + image + '" class="status-details-dialog-issue-icon">';
html += '&nbsp;';
html += formatStr(issue.problemText);
if (issue.solutionText) {
html += '<br/>';
html += formatStr(issue.solutionText);
}
html += '</div>';
return html;
}
if (issues.length > 0) {
// Step #1: Group issues by date and operation
var groupedIssues = {};
issues.each(function(issue) {
var date = issue.executionDate;
var operation = issue.executionCommandTitle;
if (!groupedIssues[date]) {
groupedIssues[date] = {};
}
if (!groupedIssues[date][operation]) {
groupedIssues[date][operation] = [];
}
groupedIssues[date][operation].push(issue);
});
// Step #2: Order issue dates for further iteration
var executionDates = Object.keys(groupedIssues);
executionDates.sort();
executionDates.reverse();
// Step #3: Iterate over dates, operations and issues, composing the popup contents
executionDates.forEach(function(date) {
var operations = Object.keys(groupedIssues[date]);
operations.forEach(function(operation) {
var issuesOfDateAndOperation = groupedIssues[date][operation];
popupContent += (
'<h4>[' + formatDateFromTimestamp(date) + '] ' + operation + '</h4><hr/>'
);
issuesOfDateAndOperation.each(function(issue) {
popupContent += composeIssueHtml(issue);
if (
// not the last issue in the dialog, to avoid duplication of <hr/> which is
// displayed by popup itself
!(
date == executionDates[executionDates.length - 1] &&
operation == operations[operations.length - 1] &&
issue == issuesOfDateAndOperation[issuesOfDateAndOperation.length - 1]
)
) {
popupContent += '<hr/>';
}
});
});
});
} else {
popupContent += migratorLocale.lmsg('popupStatusDetailsNoIssues');
}
popupContent += '</div>';
var popup = new Jsw.Popup({
title: title,
content: popupContent,
buttons: [
{
title: migratorLocale.lmsg('popupStatusDetailsButtonOk'),
class: 'action',
handler: function(event, popup) {
popup.hide();
}
}
],
popupCls: 'popup-panel popup-panel-xl popup-panel-centered'
});
popup.show();
}

View File

@@ -1,103 +0,0 @@
// Copyright 1999-2017. Plesk International GmbH. All Rights Reserved.
// Show popup dialog with settings to start DNS switching.
// Arguments:
// - subscriptions - list of subscription names.
// - onSuccess - function that will be called once DNS switch of these subscriptions is scheduled.
function showSwitchDNSPopup(subscriptions, onSuccess) {
// compose title - it is different when one subscription is selected
// and when multiple subscriptions are selected
var title = '';
if (subscriptions.length > 1) {
title = formatMessage(MESSAGE_POPUP_SWITCH_DNS_TITLE_MULTIPLE, subscriptions.length);
} else if (subscriptions.length == 1) {
title = formatMessage(MESSAGE_POPUP_SWITCH_DNS_TITLE_SINGLE, subscriptions[0]);
} else {
// no subscriptions - no sense to show dialog
return;
}
var popup = new Jsw.Popup({
title: title,
content: (
'<div class="form-row">' +
'<div>' + migratorLocale.lmsg('dnsSwitchDescription') + '</div>' +
// TODO: implement support
/*'<div class="field-name">' + MESSAGE_POPUP_SWITCH_DNS_BEFORE + '</div>' +
'<div class="field-value">' +
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncBusinessObjects"> ' +
'<label for="resyncBusinessObjects">' +
MESSAGE_POPUP_SWITCH_DNS_RESYNC_BUSINESS_OBJECTS +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncFiles" checked="checked"> ' +
'<label for="resyncFiles">' +
MESSAGE_POPUP_SWITCH_DNS_RESYNC_FILES +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncDatabases" checked="checked"> ' +
'<label for="resyncDatabases">' +
MESSAGE_POPUP_SWITCH_DNS_RESYNC_DATABASES +
'</label>' +
'</div>' +
'<div>' +
'<input type="checkbox" class="checkbox" id="resyncMail" checked="checked"> ' +
'<label for="resyncMail">' +
MESSAGE_POPUP_SWITCH_DNS_RESYNC_MAIL +
'</label>' +
'</div>' +
'</div>' + */
'</div>'
),
buttons: [
{
id: 'switchDnsOkButton',
title: MESSAGE_POPUP_SWITCH_DNS_BUTTON_OK,
class: 'action',
handler: function(event, popup) {
// TODO: implement support
/*
var elemResyncBusinessObjects = $('resyncBusinessObjects');
var elemResyncFiles = $('resyncFiles');
var elemResyncDatabases = $('resyncDatabases');
var elemResyncMail = $('resyncMail');
*/
disableButtonInProgress($('switchDnsOkButton'), 'schedulingButtonTitle');
disableButtonPlain($('switchDnsCancelButton'));
new Ajax.Request(URL_SWITCH_DNS_SUBSCRIPTIONS, {
parameters: {
subscriptions: Object.toJSON(subscriptions)
// TODO: implement support
/*
resyncBusinessObjects: elemResyncBusinessObjects.checked,
resyncFiles: elemResyncFiles.checked,
resyncDatabases: elemResyncDatabases.checked,
resyncMail: elemResyncMail.checked
*/
},
onSuccess: function (response) {
if (onSuccess) {
onSuccess();
}
popup.hide();
}
});
}
},
{
id: 'switchDnsCancelButton',
title: MESSAGE_POPUP_SWITCH_DNS_BUTTON_CANCEL,
handler: function(event, popup) {
popup.hide();
}
}
],
popupCls: 'popup-panel popup-panel-centered'
});
popup.show();
}