feature: ssl status in list websites

This commit is contained in:
usmannasir
2025-08-22 21:00:03 +05:00
parent f2f7bb12b2
commit f2352bd516
4 changed files with 264 additions and 4 deletions

View File

@@ -2768,6 +2768,38 @@ app.controller('listWebsites', function ($scope, $http, $window) {
return site.version !== undefined;
};
// Function to get SSL tooltip text
$scope.getSslTooltip = function(web) {
if (!web.ssl) return '';
var tooltip = '';
if (web.ssl.issuer && web.ssl.issuer !== '') {
tooltip += 'Issuer: ' + web.ssl.issuer;
}
if (web.ssl.days !== undefined) {
if (tooltip) tooltip += ' | ';
if (web.ssl.days < 0) {
tooltip += 'Expired ' + Math.abs(web.ssl.days) + ' days ago';
} else {
tooltip += 'Valid for ' + web.ssl.days + ' days';
}
}
if (web.ssl.is_wildcard) {
if (tooltip) tooltip += ' | ';
tooltip += 'Wildcard Certificate';
}
if (web.ssl.status === 'none') {
tooltip = 'No SSL certificate installed. Click "Issue SSL" to secure this site.';
} else if (web.ssl.status === 'self-signed') {
tooltip = 'Self-signed certificate detected. Not trusted by browsers.';
}
return tooltip;
};
// Initial fetch of websites
$scope.getFurtherWebsitesFromDB = function () {
$scope.loading = true; // Set loading to true when starting fetch
@@ -6057,6 +6089,38 @@ app.controller('listWebsites', function ($scope, $http, $window) {
return site.version !== undefined;
};
// Function to get SSL tooltip text
$scope.getSslTooltip = function(web) {
if (!web.ssl) return '';
var tooltip = '';
if (web.ssl.issuer && web.ssl.issuer !== '') {
tooltip += 'Issuer: ' + web.ssl.issuer;
}
if (web.ssl.days !== undefined) {
if (tooltip) tooltip += ' | ';
if (web.ssl.days < 0) {
tooltip += 'Expired ' + Math.abs(web.ssl.days) + ' days ago';
} else {
tooltip += 'Valid for ' + web.ssl.days + ' days';
}
}
if (web.ssl.is_wildcard) {
if (tooltip) tooltip += ' | ';
tooltip += 'Wildcard Certificate';
}
if (web.ssl.status === 'none') {
tooltip = 'No SSL certificate installed. Click "Issue SSL" to secure this site.';
} else if (web.ssl.status === 'self-signed') {
tooltip = 'Self-signed certificate detected. Not trusted by browsers.';
}
return tooltip;
};
// Initial fetch of websites
$scope.getFurtherWebsitesFromDB = function () {
$scope.loading = true; // Set loading to true when starting fetch
@@ -9690,6 +9754,38 @@ app.controller('listWebsites', function ($scope, $http, $window) {
return site.version !== undefined;
};
// Function to get SSL tooltip text
$scope.getSslTooltip = function(web) {
if (!web.ssl) return '';
var tooltip = '';
if (web.ssl.issuer && web.ssl.issuer !== '') {
tooltip += 'Issuer: ' + web.ssl.issuer;
}
if (web.ssl.days !== undefined) {
if (tooltip) tooltip += ' | ';
if (web.ssl.days < 0) {
tooltip += 'Expired ' + Math.abs(web.ssl.days) + ' days ago';
} else {
tooltip += 'Valid for ' + web.ssl.days + ' days';
}
}
if (web.ssl.is_wildcard) {
if (tooltip) tooltip += ' | ';
tooltip += 'Wildcard Certificate';
}
if (web.ssl.status === 'none') {
tooltip = 'No SSL certificate installed. Click "Issue SSL" to secure this site.';
} else if (web.ssl.status === 'self-signed') {
tooltip = 'Self-signed certificate detected. Not trusted by browsers.';
}
return tooltip;
};
// Initial fetch of websites
$scope.getFurtherWebsitesFromDB = function () {
$scope.loading = true; // Set loading to true when starting fetch