bug fixes to ai scanner template

This commit is contained in:
usmannasir
2025-06-26 14:41:30 +05:00
parent b1715b6ada
commit 17e436e981

View File

@@ -32,7 +32,7 @@ AI Security Scanner - CyberPanel
{% endif %}
<!-- Payment Setup Section -->
{% if not is_payment_configured and not vps_info.is_vps %}
{% if not is_payment_configured and not vps_info.is_vps|default:False|default:False %}
<div class="row">
<div class="col-md-12">
<div class="alert alert-info">
@@ -70,31 +70,31 @@ AI Security Scanner - CyberPanel
{% endif %}
<!-- VPS Free Scans Notice -->
{% if vps_info.is_vps and vps_info.has_free_scans %}
{% if vps_info.is_vps|default:False|default:False and vps_info.has_free_scans|default:False|default:False %}
<div class="row">
<div class="col-md-12">
<div class="alert alert-success">
<h4><i class="fas fa-gift"></i> VPS Free Scans Available</h4>
<p>Great news! Your CyberPanel VPS hosting includes <strong>{{ vps_info.free_scans_available }} free AI security scans</strong> this month ({{ vps_info.scans_used_this_month }}/{{ vps_info.free_scans_per_month }} used).</p>
<p>Great news! Your CyberPanel VPS hosting includes <strong>{{ vps_info.free_scans_available|default:0 }} free AI security scans</strong> this month ({{ vps_info.scans_used_this_month|default:0 }}/{{ vps_info.free_scans_per_month|default:0 }} used).</p>
{% if not is_payment_configured %}
<p><small class="text-muted">You can still add a payment method below for additional scans beyond your free allowance.</small></p>
{% endif %}
</div>
</div>
</div>
{% elif vps_info.is_vps and not vps_info.has_free_scans %}
{% elif vps_info.is_vps|default:False|default:False and not vps_info.has_free_scans|default:False|default:True %}
<div class="row">
<div class="col-md-12">
<div class="alert alert-warning">
<h4><i class="fas fa-exclamation-triangle"></i> Free Scans Exhausted</h4>
<p>You've used all {{ vps_info.free_scans_per_month }} free AI security scans for this month. Setup payment to continue scanning.</p>
<p>You've used all {{ vps_info.free_scans_per_month|default:0 }} free AI security scans for this month. Setup payment to continue scanning.</p>
</div>
</div>
</div>
{% endif %}
<!-- Scanner Dashboard -->
{% if is_payment_configured or vps_info.is_vps %}
{% if is_payment_configured or vps_info.is_vps|default:False|default:False %}
<div class="row">
<div class="col-md-4">
<div class="panel panel-success">
@@ -104,8 +104,8 @@ AI Security Scanner - CyberPanel
</h4>
</div>
<div class="panel-body text-center">
{% if vps_info.is_vps and vps_info.has_free_scans %}
<h2 class="text-success">{{ vps_info.free_scans_available }}</h2>
{% if vps_info.is_vps|default:False|default:False and vps_info.has_free_scans|default:False|default:False %}
<h2 class="text-success">{{ vps_info.free_scans_available|default:0 }}</h2>
<p class="text-muted">Free Scans Available</p>
{% if is_payment_configured %}
<small class="text-muted">Plus ${{ current_balance|floatformat:4 }} credit</small>
@@ -161,7 +161,7 @@ AI Security Scanner - CyberPanel
<div class="panel-heading">
<h4 class="panel-title">
<i class="fas fa-credit-card"></i> Payment Methods
{% if not vps_info.is_vps or is_payment_configured %}
{% if not vps_info.is_vps|default:False or is_payment_configured %}
<button class="btn btn-xs btn-primary pull-right" onclick="addPaymentMethod()">
<i class="fas fa-plus"></i> Add Payment Method
</button>
@@ -173,10 +173,10 @@ AI Security Scanner - CyberPanel
</h4>
</div>
<div class="panel-body">
{% if vps_info.is_vps and not is_payment_configured %}
{% if vps_info.is_vps|default:False and not is_payment_configured %}
<p class="text-muted">
<i class="fas fa-info-circle"></i>
Payment setup is optional for VPS users. You have {{ vps_info.free_scans_available }} free scans available.
Payment setup is optional for VPS users. You have {{ vps_info.free_scans_available|default:0 }} free scans available.
</p>
{% else %}
<p class="text-muted">
@@ -231,13 +231,13 @@ AI Security Scanner - CyberPanel
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
{% if vps_info.is_vps and not vps_info.has_free_scans and not is_payment_configured %}
{% if vps_info.is_vps|default:False and not vps_info.has_free_scans|default:False and not is_payment_configured %}
<button type="button" class="btn btn-warning btn-block" disabled>
<i class="fas fa-lock"></i> Free Scans Exhausted
</button>
{% else %}
<button type="submit" class="btn btn-success btn-block" id="scanButton">
{% if vps_info.is_vps and vps_info.has_free_scans %}
{% if vps_info.is_vps|default:False|default:False and vps_info.has_free_scans|default:False|default:False %}
<i class="fas fa-search"></i> Start Free Scan
{% else %}
<i class="fas fa-search"></i> Start Scan
@@ -255,7 +255,7 @@ AI Security Scanner - CyberPanel
{% endif %}
<!-- Scan History -->
{% if recent_scans and (is_payment_configured or vps_info.is_vps) %}
{% if recent_scans and is_payment_configured or recent_scans and vps_info.is_vps|default:False %}
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">