maintenanceMod fix

This commit is contained in:
usmannasir
2025-04-07 19:39:40 +05:00
parent 7154ff8604
commit 0fa899ddaa

View File

@@ -385,7 +385,15 @@ app.controller('listWebsites', function ($scope, $http, $window) {
}; };
$scope.getFullUrl = function(url) { $scope.getFullUrl = function(url) {
if (!url) return ''; console.log('getFullUrl called with:', url);
if (!url) {
// If no URL is provided, try to use the domain
if (this.wp && this.wp.domain) {
url = this.wp.domain;
} else {
return '';
}
}
if (url.startsWith('http://') || url.startsWith('https://')) { if (url.startsWith('http://') || url.startsWith('https://')) {
return url; return url;
} }
@@ -406,11 +414,17 @@ app.controller('listWebsites', function ($scope, $http, $window) {
} }
}; };
var data = { domain: domain }; var data = { domain: domain };
site.loadingWPSites = true;
$http.post('/websites/getWordPressSites', data, config).then( $http.post('/websites/getWordPressSites', data, config).then(
function(response) { function(response) {
site.loadingWPSites = false;
if (response.data.status === 1) { if (response.data.status === 1) {
site.wp_sites = response.data.sites; site.wp_sites = response.data.sites;
site.wp_sites.forEach(function(wp) { site.wp_sites.forEach(function(wp) {
// Ensure each WP site has a URL
if (!wp.url) {
wp.url = wp.domain || domain;
}
fetchWPSiteData(wp); fetchWPSiteData(wp);
}); });
} else { } else {
@@ -422,6 +436,7 @@ app.controller('listWebsites', function ($scope, $http, $window) {
} }
}, },
function(response) { function(response) {
site.loadingWPSites = false;
new PNotify({ new PNotify({
title: 'Error!', title: 'Error!',
text: 'Could not connect to server', text: 'Could not connect to server',
@@ -3632,7 +3647,6 @@ app.controller('manageAliasController', function ($scope, $http, $timeout, $wind
$window.location.reload(); $window.location.reload();
}, 3000); }, 3000);
} else { } else {
$scope.aliasTable = false; $scope.aliasTable = false;