05/22 Implement license version
This commit is contained in:
+33
-1
@@ -1162,6 +1162,10 @@
|
||||
<li><a href="{{ url_for('admin.settings') }}" class="{{ 'active' if request.endpoint == 'admin.settings' }}">
|
||||
<i class="bi bi-gear"></i> Settings
|
||||
</a></li>
|
||||
<li><a href="{{ url_for('admin.license_page') }}" class="{{ 'active' if request.endpoint == 'admin.license_page' }}">
|
||||
<i class="bi bi-key"></i> License
|
||||
{% if not license.valid %}<span class="badge bg-warning text-dark ms-1" style="font-size:.65rem;">!</span>{% endif %}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
@@ -1232,6 +1236,32 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endwith %}
|
||||
|
||||
{% if current_user.is_authenticated and current_user.is_admin %}
|
||||
{% if not license.valid %}
|
||||
<div class="alert alert-warning alert-dismissible mb-3" role="alert">
|
||||
<i class="bi bi-key me-2"></i>
|
||||
{% if license.get('reason') == 'expired' %}
|
||||
Your TechDesk license expired on <strong>{{ license.expires_at }}</strong>.
|
||||
Features are restricted to Community tier.
|
||||
{% elif license.get('reason') == 'no_key' %}
|
||||
No license key configured. TechDesk is running in <strong>Community mode</strong>.
|
||||
{% else %}
|
||||
License key is invalid. TechDesk is running in <strong>Community mode</strong>.
|
||||
{% endif %}
|
||||
<a href="{{ url_for('admin.license_page') }}" class="alert-link ms-1">View license details →</a>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
{% elif license.days_left is not none and license.days_left < 30 %}
|
||||
<div class="alert alert-info alert-dismissible mb-3" role="alert">
|
||||
<i class="bi bi-key me-2"></i>
|
||||
Your TechDesk license expires in <strong>{{ license.days_left }} day{{ 's' if license.days_left != 1 }}</strong>.
|
||||
<a href="{{ url_for('admin.license_page') }}" class="alert-link ms-1">View license →</a>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1251,7 +1281,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ── Chat FAB ── -->
|
||||
<!-- ── Chat FAB (Business+ license required) ── -->
|
||||
{% if license.tier in ('business', 'enterprise') %}
|
||||
<div id="chat-fab" onclick="toggleChat()" title="IT Assistant">
|
||||
<i class="bi bi-robot"></i>
|
||||
</div>
|
||||
@@ -1276,6 +1307,7 @@
|
||||
<button class="chat-send" onclick="sendChat()"><i class="bi bi-send-fill"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<!-- Not authenticated — minimal layout -->
|
||||
|
||||
Reference in New Issue
Block a user