Update instance_detail.html
This commit is contained in:
@@ -176,7 +176,7 @@ async function checkInstanceStatus() {
|
|||||||
console.log('Status data:', data);
|
console.log('Status data:', data);
|
||||||
|
|
||||||
// Update activity status
|
// Update activity status
|
||||||
const activityIcon = document.querySelector('.status-icon-wrapper .fa-circle-notch');
|
const activityIcon = document.querySelector('.card:first-child .fa-circle-notch');
|
||||||
const activityBadge = document.querySelector('.card:first-child .badge');
|
const activityBadge = document.querySelector('.card:first-child .badge');
|
||||||
const activityDetails = document.querySelector('.card:first-child .text-muted');
|
const activityDetails = document.querySelector('.card:first-child .text-muted');
|
||||||
|
|
||||||
@@ -187,8 +187,14 @@ async function checkInstanceStatus() {
|
|||||||
activityBadge.className = `badge bg-${data.status === 'active' ? 'success' : 'danger'}`;
|
activityBadge.className = `badge bg-${data.status === 'active' ? 'success' : 'danger'}`;
|
||||||
activityBadge.textContent = data.status.charAt(0).toUpperCase() + data.status.slice(1);
|
activityBadge.textContent = data.status.charAt(0).toUpperCase() + data.status.slice(1);
|
||||||
}
|
}
|
||||||
if (activityDetails && data.status_details) {
|
if (activityDetails) {
|
||||||
|
// Only update if we have status details
|
||||||
|
if (data.status_details) {
|
||||||
activityDetails.textContent = data.status_details;
|
activityDetails.textContent = data.status_details;
|
||||||
|
activityDetails.style.display = 'block';
|
||||||
|
} else {
|
||||||
|
activityDetails.style.display = 'none';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error checking instance status:', error);
|
console.error('Error checking instance status:', error);
|
||||||
@@ -206,9 +212,9 @@ async function checkAuthStatus() {
|
|||||||
console.log('Auth data:', data);
|
console.log('Auth data:', data);
|
||||||
|
|
||||||
// Update authentication status
|
// Update authentication status
|
||||||
const authIcon = document.querySelector('.card:last-child .fa-shield-alt');
|
const authIcon = document.querySelector('.card:nth-child(2) .fa-shield-alt');
|
||||||
const authBadge = document.querySelector('.card:last-child .badge');
|
const authBadge = document.querySelector('.card:nth-child(2) .badge');
|
||||||
const authDetails = document.querySelector('.card:last-child .text-muted');
|
const authDetails = document.querySelector('.card:nth-child(2) .text-muted');
|
||||||
|
|
||||||
if (authIcon) {
|
if (authIcon) {
|
||||||
authIcon.className = `fas fa-shield-alt ${data.authenticated ? 'text-success' : 'text-warning'} fa-2x`;
|
authIcon.className = `fas fa-shield-alt ${data.authenticated ? 'text-success' : 'text-warning'} fa-2x`;
|
||||||
@@ -283,7 +289,7 @@ async function fetchCompanyInfo() {
|
|||||||
|
|
||||||
// Update email with mailto link
|
// Update email with mailto link
|
||||||
if (data.company_email && data.company_email !== 'Not set') {
|
if (data.company_email && data.company_email !== 'Not set') {
|
||||||
emailElement.innerHTML = `<a href="mailto:${data.company_email}" class="text-decoration-none">
|
emailElement.innerHTML = `<a href="mailto:${data.company_email}" class="text-decoration-none" style="color: var(--primary-color);">
|
||||||
<i class="fas fa-envelope me-2"></i>${data.company_email}
|
<i class="fas fa-envelope me-2"></i>${data.company_email}
|
||||||
</a>`;
|
</a>`;
|
||||||
} else {
|
} else {
|
||||||
@@ -292,7 +298,7 @@ async function fetchCompanyInfo() {
|
|||||||
|
|
||||||
// Update phone with tel link
|
// Update phone with tel link
|
||||||
if (data.company_phone && data.company_phone !== 'Not set') {
|
if (data.company_phone && data.company_phone !== 'Not set') {
|
||||||
phoneElement.innerHTML = `<a href="tel:${data.company_phone}" class="text-decoration-none">
|
phoneElement.innerHTML = `<a href="tel:${data.company_phone}" class="text-decoration-none" style="color: var(--primary-color);">
|
||||||
<i class="fas fa-phone me-2"></i>${data.company_phone}
|
<i class="fas fa-phone me-2"></i>${data.company_phone}
|
||||||
</a>`;
|
</a>`;
|
||||||
} else {
|
} else {
|
||||||
@@ -306,7 +312,7 @@ async function fetchCompanyInfo() {
|
|||||||
if (!websiteUrl.startsWith('http://') && !websiteUrl.startsWith('https://')) {
|
if (!websiteUrl.startsWith('http://') && !websiteUrl.startsWith('https://')) {
|
||||||
websiteUrl = 'https://' + websiteUrl;
|
websiteUrl = 'https://' + websiteUrl;
|
||||||
}
|
}
|
||||||
websiteElement.innerHTML = `<a href="${websiteUrl}" target="_blank" rel="noopener noreferrer" class="text-decoration-none">
|
websiteElement.innerHTML = `<a href="${websiteUrl}" target="_blank" rel="noopener noreferrer" class="text-decoration-none" style="color: var(--primary-color);">
|
||||||
<i class="fas fa-globe me-2"></i>${data.company_website}
|
<i class="fas fa-globe me-2"></i>${data.company_website}
|
||||||
</a>`;
|
</a>`;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user