wip
This commit is contained in:
parent
7dafc3c1e4
commit
72dac49878
7 changed files with 119 additions and 239 deletions
11
app/templates/components/markdown_content.html
Normal file
11
app/templates/components/markdown_content.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% macro render_markdown(content) %}
|
||||
<div class="markdown-content markdown-reading-view">
|
||||
{{ content|github_style_admonition|markdown|safe }}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_markdown_with_truncate(content, length=300) %}
|
||||
<div class="markdown-content markdown-reading-view">
|
||||
{{ content|github_style_admonition|markdown|truncate(length, true)|safe }}
|
||||
</div>
|
||||
{% endmacro %}
|
|
@ -1,7 +1,12 @@
|
|||
{% extends "layout.html" %}
|
||||
{% from "components/markdown_content.html" import render_markdown %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
|
||||
{% block styles %}
|
||||
<link href="{{ url_for('static', filename='css/github-markdown-reading-view.css') }}" rel="stylesheet">
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container-xl">
|
||||
<div class="page-header d-print-none">
|
||||
|
@ -111,27 +116,23 @@
|
|||
|
||||
<div class="col-md-8">
|
||||
<!-- Documentation section -->
|
||||
<div class="card h-100">
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Documentation</h3>
|
||||
{% if current_user.is_admin %}
|
||||
<div class="card-actions">
|
||||
<a href="{{ url_for('dashboard.edit_app_docs', app_id=app.id) }}" class="btn btn-primary btn-sm">
|
||||
<i class="ti ti-edit"></i> Edit Documentation
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-body markdown-content p-4">
|
||||
<div class="card-body p-0">
|
||||
{% if app.documentation %}
|
||||
{{ app.documentation|markdown|safe }}
|
||||
{{ render_markdown(app.documentation) }}
|
||||
{% else %}
|
||||
<div class="empty">
|
||||
<div class="empty-icon">
|
||||
<span class="ti ti-file-text"></span>
|
||||
</div>
|
||||
<p class="empty-title">No documentation available</p>
|
||||
<p class="empty-subtitle text-muted">
|
||||
Add documentation to this application to keep track of important information.
|
||||
</p>
|
||||
<div class="empty-action">
|
||||
<a href="{{ url_for('dashboard.app_edit', app_id=app.id) }}" class="btn btn-primary">
|
||||
<span class="ti ti-edit me-2"></span> Add Documentation
|
||||
</a>
|
||||
</div>
|
||||
<div class="p-3 text-muted">
|
||||
No documentation available for this application.
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
{% extends "dashboard/layout.html" %}
|
||||
{% from "components/markdown_content.html" import render_markdown, render_markdown_with_truncate %}
|
||||
|
||||
{% block title %}Subnet {{ subnet.cidr }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<!-- Add this in the action buttons section -->
|
||||
<div class="col-auto ms-auto">
|
||||
<div class="btn-list">
|
||||
|
@ -63,35 +69,36 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
<!-- Find where application documentation is displayed -->
|
||||
<!-- Applications in Subnet section -->
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Applications in this Subnet</h3>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
{% if subnet.applications %}
|
||||
{% for app in subnet.applications %}
|
||||
<div class="app-card mb-3">
|
||||
<div class="app-card-header d-flex justify-content-between align-items-center p-3">
|
||||
<div class="app-card-header">
|
||||
<span class="app-link">
|
||||
<strong>{{ app.name }}</strong>
|
||||
{% if app.server %}
|
||||
<span class="text-muted fs-sm">on {{ app.server.hostname }} ({{ app.server.ip_address }})</span>
|
||||
<small class="text-muted">on {{ app.server.hostname }} ({{ app.server.ip_address }})</small>
|
||||
{% endif %}
|
||||
</span>
|
||||
<a href="{{ url_for('dashboard.app_view', app_id=app.id) }}" class="btn btn-sm btn-primary">View</a>
|
||||
</div>
|
||||
{% if app.documentation %}
|
||||
<div class="app-card-body p-3">
|
||||
<div class="markdown-content">
|
||||
{{ app.documentation|markdown|safe }}
|
||||
</div>
|
||||
|
||||
<div class="app-card-body">
|
||||
{% if app.documentation %}
|
||||
{{ render_markdown_with_truncate(app.documentation) }}
|
||||
<a href="{{ url_for('dashboard.app_view', app_id=app.id) }}" class="btn btn-sm btn-link">Read more</a>
|
||||
{% else %}
|
||||
<p class="text-muted">No documentation available for this application.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="app-card-body p-3 text-muted">
|
||||
No documentation available for this application.
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="app-card-footer p-2">
|
||||
|
||||
{% if app.ports %}
|
||||
<div class="app-card-footer">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="usage-info">
|
||||
<small class="text-muted">Usage</small>
|
||||
|
@ -100,19 +107,18 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="port-info">
|
||||
{% if app.ports %}
|
||||
<small class="text-muted">{{ app.ports|length }} ports</small>
|
||||
{% else %}
|
||||
<small class="text-muted">No ports</small>
|
||||
{% endif %}
|
||||
<small class="text-muted">{{ app.ports|length }} port{% if app.ports|length != 1 %}s{% endif %}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="p-3 text-muted">
|
||||
No applications found in this subnet.
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="en" data-bs-theme="{{ session.get('theme', 'dark') }}">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
@ -605,4 +605,4 @@
|
|||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue