yeni
This commit is contained in:
@ -442,16 +442,23 @@
|
||||
<!-- Meta Key Modal -->
|
||||
<div class="modal fade" id="metaKeyModal" tabindex="-1" aria-labelledby="metaKeyModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="metaKeyModalLabel">Site Doğrulama Meta Key</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Kapat"></button>
|
||||
<div class="modal-content bg-dark text-light">
|
||||
<div class="modal-header border-secondary">
|
||||
<h5 class="modal-title" id="metaKeyModalLabel">
|
||||
<i class="bi bi-key me-2"></i>Site Doğrulama Meta Key
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Kapat"></button>
|
||||
</div>
|
||||
<div class="modal-body" id="metaKeyContent">
|
||||
Yükleniyor...
|
||||
<div class="text-center">
|
||||
<div class="spinner-border text-primary" role="status">
|
||||
<span class="visually-hidden">Yükleniyor...</span>
|
||||
</div>
|
||||
<p class="mt-2">Meta key bilgileri yükleniyor...</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Kapat</button>
|
||||
<div class="modal-footer border-secondary">
|
||||
<button type="button" class="btn btn-outline-light" data-bs-dismiss="modal">Kapat</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -515,7 +522,7 @@ function deleteHost(id) {
|
||||
headers: { 'X-CSRFToken': getCookie('csrftoken') }
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
.then data => {
|
||||
toastMessage(data.message);
|
||||
if (data.success) setTimeout(() => location.reload(), 1200);
|
||||
});
|
||||
@ -525,7 +532,7 @@ function deleteHost(id) {
|
||||
// Host Düzenle
|
||||
function editHost(id) {
|
||||
fetch(`/get_host/${id}/`)
|
||||
.then(r => r.json())
|
||||
.then r => r.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
document.getElementById('hostId').value = data.host.id;
|
||||
@ -607,7 +614,7 @@ window.deleteProject = function(id) {
|
||||
headers: { 'X-CSRFToken': getCookie('csrftoken') }
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
.then data => {
|
||||
toastMessage(data.message);
|
||||
if (data.success) {
|
||||
setTimeout(() => location.reload(), 1200);
|
||||
@ -630,7 +637,7 @@ window.backupProject = function(id) {
|
||||
updateProgress(40, 'İşlem devam ediyor...');
|
||||
return r.json();
|
||||
})
|
||||
.then(data => {
|
||||
.then data => {
|
||||
updateProgress(80, 'Tamamlanıyor...');
|
||||
|
||||
setTimeout(() => {
|
||||
@ -711,6 +718,12 @@ window.showLogsByProject = function(projectId) {
|
||||
});
|
||||
}
|
||||
|
||||
// Verify site function - global scope
|
||||
window.verifySite = function(projectId) {
|
||||
checkSiteStatus(projectId);
|
||||
$('#metaKeyModal').modal('hide');
|
||||
}
|
||||
|
||||
// Site durumu kontrol fonksiyonu - global scope
|
||||
window.checkSiteStatus = function(projectId) {
|
||||
// Progress toast'ı başlat
|
||||
@ -737,13 +750,30 @@ window.checkSiteStatus = function(projectId) {
|
||||
hideProgressToast();
|
||||
|
||||
if (data.success) {
|
||||
const statusText = data.status ? '✅ Site Aktif' : '❌ Site Pasif';
|
||||
showToast(statusText, data.status ? 'success' : 'error');
|
||||
const siteStatusText = data.status ? '✅ Site Aktif' : '❌ Site Pasif';
|
||||
const diskStatusText = data.disk_message ? `💾 ${data.disk_message}` : '';
|
||||
|
||||
// Detaylı bilgi içeren bir toast göster
|
||||
const statusHtml = `
|
||||
<div>
|
||||
<div><strong>${siteStatusText}</strong></div>
|
||||
<div class="small text-light-emphasis">${data.site_message}</div>
|
||||
${diskStatusText ? `<div class="mt-2"><strong>${diskStatusText}</strong></div>` : ''}
|
||||
</div>
|
||||
`;
|
||||
|
||||
showToast(statusHtml, data.status ? 'success' : 'error', 8000);
|
||||
|
||||
// Sayfayı yenile
|
||||
setTimeout(() => location.reload(), 1500);
|
||||
} else {
|
||||
showToast(`❌ ${data.message}`, 'error');
|
||||
const errorHtml = `
|
||||
<div>
|
||||
<div><strong>❌ Kontrol Başarısız</strong></div>
|
||||
<div class="small text-light-emphasis">${data.message}</div>
|
||||
</div>
|
||||
`;
|
||||
showToast(errorHtml, 'error', 8000);
|
||||
}
|
||||
}, 300);
|
||||
}, 500);
|
||||
@ -751,7 +781,13 @@ window.checkSiteStatus = function(projectId) {
|
||||
.catch(error => {
|
||||
hideProgressToast();
|
||||
console.error('Error:', error);
|
||||
showToast('❌ Kontrol hatası!', 'error');
|
||||
const errorHtml = `
|
||||
<div>
|
||||
<div><strong>❌ Kontrol Hatası</strong></div>
|
||||
<div class="small text-light-emphasis">Sunucu ile iletişim sırasında bir hata oluştu.</div>
|
||||
</div>
|
||||
`;
|
||||
showToast(errorHtml, 'error', 5000);
|
||||
});
|
||||
}
|
||||
|
||||
@ -762,33 +798,47 @@ window.showMetaKey = function(projectId) {
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
const content = `
|
||||
<div class="alert alert-info">
|
||||
<h6><i class="bi bi-info-circle"></i> Kullanım Talimatları:</h6>
|
||||
<p>Bu meta tag'ı sitenizin <code><head></code> bölümüne ekleyin:</p>
|
||||
<div class="alert alert-info bg-info bg-opacity-25 text-info mb-3">
|
||||
<h6><i class="bi bi-info-circle"></i> Site Doğrulama</h6>
|
||||
<p>Site sahipliğinizi doğrulamak için aşağıdaki iki yöntemden birini kullanın:</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label"><strong>Meta Key:</strong></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" value="${data.meta_key}" readonly>
|
||||
<button class="btn btn-outline-secondary" onclick="copyMetaKey('${data.meta_key}')">
|
||||
<i class="bi bi-clipboard"></i>
|
||||
</button>
|
||||
|
||||
<div class="card mb-3 bg-dark border-secondary">
|
||||
<div class="card-header bg-dark border-secondary">
|
||||
<strong>1. Yöntem: HTML Meta Tag</strong> <span class="badge bg-success">Önerilen</span>
|
||||
</div>
|
||||
<div class="card-body bg-dark text-light">
|
||||
<div class="input-group">
|
||||
<textarea class="form-control bg-dark text-light border-secondary" rows="2" readonly id="metaTagText">${data.meta_tag}</textarea>
|
||||
<button class="btn btn-outline-primary" onclick="copyMetaTag()">
|
||||
<i class="bi bi-clipboard"></i> Kopyala
|
||||
</button>
|
||||
</div>
|
||||
<small class="text-light-emphasis mt-2 d-block">Bu meta tag'ı sitenizin <code class="bg-dark text-light"><head></code> bölümüne ekleyin</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label"><strong>HTML Meta Tag:</strong></label>
|
||||
<div class="input-group">
|
||||
<textarea class="form-control" rows="2" readonly id="metaTagText">${data.meta_tag}</textarea>
|
||||
<button class="btn btn-outline-secondary" onclick="copyMetaTag()">
|
||||
<i class="bi bi-clipboard"></i>
|
||||
</button>
|
||||
<div class="card mb-3 bg-dark border-secondary">
|
||||
<div class="card-header bg-dark border-secondary">
|
||||
<strong>2. Yöntem: HTML Yorum</strong>
|
||||
</div>
|
||||
<div class="card-body bg-dark text-light">
|
||||
<div class="input-group">
|
||||
<textarea class="form-control bg-dark text-light border-secondary" rows="2" readonly>${data.comment_tag}</textarea>
|
||||
<button class="btn btn-outline-primary" onclick="copyToClipboard('${data.comment_tag}')">
|
||||
<i class="bi bi-clipboard"></i> Kopyala
|
||||
</button>
|
||||
</div>
|
||||
<small class="text-light-emphasis mt-2 d-block">Bu yorum satırını HTML sayfanızın herhangi bir yerine ekleyebilirsiniz</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning">
|
||||
<small><i class="bi bi-exclamation-triangle"></i> Meta tag'ı ekledikten sonra "Site Kontrol" butonuyla doğrulama yapabilirsiniz.</small>
|
||||
<div class="alert alert-warning bg-warning bg-opacity-25 text-warning">
|
||||
<i class="bi bi-exclamation-triangle"></i> Yukarıdaki yöntemlerden birini uyguladıktan sonra
|
||||
<button type="button" class="btn btn-sm btn-outline-light" onclick="verifySite(${data.project_id})">
|
||||
<i class="bi bi-check-circle"></i> Site Kontrol
|
||||
</button>
|
||||
butonuyla doğrulama yapabilirsiniz.
|
||||
</div>
|
||||
`;
|
||||
|
||||
@ -924,7 +974,7 @@ if (projectForm) {
|
||||
body: formData
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
.then data => {
|
||||
toastMessage(data.message);
|
||||
if (data.success) {
|
||||
const modal = bootstrap.Modal.getInstance(document.getElementById('addProjectModal'));
|
||||
@ -970,7 +1020,7 @@ if (hostForm) {
|
||||
body: formData
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
.then data => {
|
||||
toastMessage(data.message);
|
||||
if (data.success) {
|
||||
const modal = bootstrap.Modal.getInstance(document.getElementById('addHostModal'));
|
||||
@ -1051,7 +1101,7 @@ if (refreshHostsBtn) {
|
||||
console.log('Response status:', response.status);
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
.then data => {
|
||||
console.log('Response data:', data);
|
||||
hideProgressToast();
|
||||
|
||||
@ -1074,7 +1124,6 @@ if (refreshHostsBtn) {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('DOM yüklendi');
|
||||
});
|
||||
|
||||
</script>
|
||||
</div> <!-- main-content kapanış -->
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user