wip
This commit is contained in:
parent
94ededdf69
commit
7dafc3c1e4
4 changed files with 178 additions and 52 deletions
|
@ -1,22 +1,38 @@
|
|||
/* Custom styles for the app */
|
||||
:root {
|
||||
--background-color: #f5f8fa;
|
||||
--text-color: #333;
|
||||
--card-bg: #fff;
|
||||
--border-color: #e3e8ee;
|
||||
--sidebar-bg: #f0f2f5;
|
||||
--sidebar-hover-bg: #e0e5ee;
|
||||
--highlight-color: #3b82f6;
|
||||
/* Light mode (default) variables - Github inspired */
|
||||
--background-color: #f6f8fa;
|
||||
--text-color: #24292f;
|
||||
--card-bg: #ffffff;
|
||||
--border-color: #d0d7de;
|
||||
--sidebar-bg: #f6f8fa;
|
||||
--sidebar-hover-bg: #eaeef2;
|
||||
--highlight-color: #0969da;
|
||||
|
||||
/* Markdown specific colors for light mode */
|
||||
--markdown-bg: #ffffff;
|
||||
--markdown-text: #24292f;
|
||||
--markdown-code-bg: #f6f8fa;
|
||||
--markdown-border: #d0d7de;
|
||||
--markdown-table-header: #f6f8fa;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] {
|
||||
--background-color: #1a2234;
|
||||
--text-color: #e6e8eb;
|
||||
--card-bg: #24304d;
|
||||
--border-color: #374564;
|
||||
--sidebar-bg: #151a27;
|
||||
--sidebar-hover-bg: #1c2133;
|
||||
--highlight-color: #3f8cff;
|
||||
/* Dark mode variables - Github dark inspired */
|
||||
--background-color: #0d1117;
|
||||
--text-color: #c9d1d9;
|
||||
--card-bg: #161b22;
|
||||
--border-color: #30363d;
|
||||
--sidebar-bg: #010409;
|
||||
--sidebar-hover-bg: #161b22;
|
||||
--highlight-color: #58a6ff;
|
||||
|
||||
/* Markdown specific colors for dark mode */
|
||||
--markdown-bg: #0d1117;
|
||||
--markdown-text: #c9d1d9;
|
||||
--markdown-code-bg: #161b22;
|
||||
--markdown-border: #30363d;
|
||||
--markdown-table-header: #161b22;
|
||||
}
|
||||
|
||||
body {
|
||||
|
@ -28,27 +44,31 @@ body {
|
|||
|
||||
.markdown-body {
|
||||
padding: 1rem;
|
||||
background-color: var(--card-bg);
|
||||
border: 1px solid var(--border-color);
|
||||
background-color: var(--markdown-bg);
|
||||
color: var(--markdown-text);
|
||||
border: 1px solid var(--markdown-border);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.markdown-body h1 {
|
||||
font-size: 1.75rem;
|
||||
margin-top: 0;
|
||||
color: var(--markdown-text);
|
||||
}
|
||||
|
||||
.markdown-body h2 {
|
||||
font-size: 1.5rem;
|
||||
color: var(--markdown-text);
|
||||
}
|
||||
|
||||
.markdown-body h3 {
|
||||
font-size: 1.25rem;
|
||||
color: var(--markdown-text);
|
||||
}
|
||||
|
||||
.markdown-body pre {
|
||||
background-color: #f6f8fa;
|
||||
border-radius: 3px;
|
||||
background-color: var(--markdown-code-bg);
|
||||
border-radius: 6px;
|
||||
padding: 16px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
@ -62,11 +82,11 @@ body {
|
|||
.markdown-body th,
|
||||
.markdown-body td {
|
||||
padding: 8px;
|
||||
border: 1px solid #ddd;
|
||||
border: 1px solid var(--markdown-border);
|
||||
}
|
||||
|
||||
.markdown-body th {
|
||||
background-color: #f8f9fa;
|
||||
background-color: var(--markdown-table-header);
|
||||
}
|
||||
|
||||
/* IP Grid for subnet visualization */
|
||||
|
|
|
@ -319,10 +319,9 @@
|
|||
.markdown-alert {
|
||||
padding: 0.85rem 1rem;
|
||||
margin: 1rem 0;
|
||||
border-radius: 0.375rem;
|
||||
border-radius: 6px;
|
||||
border-left-width: 4px;
|
||||
border-left-style: solid;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.markdown-alert-title {
|
||||
|
@ -340,15 +339,14 @@
|
|||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* Individual alert types */
|
||||
/* Note styling */
|
||||
/* Note styling - GitHub colors */
|
||||
.markdown-alert-note {
|
||||
background-color: rgba(66, 153, 225, 0.1);
|
||||
border-left-color: #4299e1;
|
||||
background-color: #eef6ff;
|
||||
border-left-color: #58a6ff;
|
||||
}
|
||||
|
||||
.markdown-alert-note .markdown-alert-title {
|
||||
color: #2b6cb0;
|
||||
color: #0969da;
|
||||
}
|
||||
|
||||
.markdown-alert-note .markdown-alert-title::before {
|
||||
|
@ -356,14 +354,14 @@
|
|||
/* ti-info-circle */
|
||||
}
|
||||
|
||||
/* Tip styling */
|
||||
/* Tip styling - GitHub colors */
|
||||
.markdown-alert-tip {
|
||||
background-color: rgba(72, 187, 120, 0.1);
|
||||
border-left-color: #48bb78;
|
||||
background-color: #dafbe1;
|
||||
border-left-color: #2da44e;
|
||||
}
|
||||
|
||||
.markdown-alert-tip .markdown-alert-title {
|
||||
color: #2f855a;
|
||||
color: #1a7f37;
|
||||
}
|
||||
|
||||
.markdown-alert-tip .markdown-alert-title::before {
|
||||
|
@ -371,14 +369,14 @@
|
|||
/* ti-bulb */
|
||||
}
|
||||
|
||||
/* Important styling */
|
||||
/* Important styling - GitHub colors */
|
||||
.markdown-alert-important {
|
||||
background-color: rgba(118, 106, 240, 0.1);
|
||||
border-left-color: #766af0;
|
||||
background-color: #fff8c5;
|
||||
border-left-color: #bf8700;
|
||||
}
|
||||
|
||||
.markdown-alert-important .markdown-alert-title {
|
||||
color: #5046e4;
|
||||
color: #9a6700;
|
||||
}
|
||||
|
||||
.markdown-alert-important .markdown-alert-title::before {
|
||||
|
@ -386,14 +384,14 @@
|
|||
/* ti-star */
|
||||
}
|
||||
|
||||
/* Warning styling */
|
||||
/* Warning styling - GitHub colors */
|
||||
.markdown-alert-warning {
|
||||
background-color: rgba(246, 173, 85, 0.1);
|
||||
border-left-color: #f6ad55;
|
||||
background-color: #fff8c5;
|
||||
border-left-color: #bf8700;
|
||||
}
|
||||
|
||||
.markdown-alert-warning .markdown-alert-title {
|
||||
color: #c05621;
|
||||
color: #9a6700;
|
||||
}
|
||||
|
||||
.markdown-alert-warning .markdown-alert-title::before {
|
||||
|
@ -401,14 +399,14 @@
|
|||
/* ti-alert-triangle */
|
||||
}
|
||||
|
||||
/* Caution styling */
|
||||
/* Caution styling - GitHub colors */
|
||||
.markdown-alert-caution {
|
||||
background-color: rgba(245, 101, 101, 0.1);
|
||||
border-left-color: #f56565;
|
||||
background-color: #ffebe9;
|
||||
border-left-color: #cf222e;
|
||||
}
|
||||
|
||||
.markdown-alert-caution .markdown-alert-title {
|
||||
color: #c53030;
|
||||
color: #cf222e;
|
||||
}
|
||||
|
||||
.markdown-alert-caution .markdown-alert-title::before {
|
||||
|
@ -416,25 +414,50 @@
|
|||
/* ti-alert-octagon */
|
||||
}
|
||||
|
||||
/* Dark mode adjustments */
|
||||
/* Dark mode adjustments using GitHub Dark colors */
|
||||
[data-bs-theme="dark"] .markdown-alert-note {
|
||||
background-color: rgba(56, 127, 187, 0.15);
|
||||
background-color: rgba(56, 139, 253, 0.15);
|
||||
border-left-color: #58a6ff;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-alert-note .markdown-alert-title {
|
||||
color: #58a6ff;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-alert-tip {
|
||||
background-color: rgba(56, 161, 105, 0.15);
|
||||
background-color: rgba(46, 160, 67, 0.15);
|
||||
border-left-color: #3fb950;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-alert-tip .markdown-alert-title {
|
||||
color: #3fb950;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-alert-important {
|
||||
background-color: rgba(102, 92, 209, 0.15);
|
||||
background-color: rgba(219, 171, 9, 0.15);
|
||||
border-left-color: #d29922;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-alert-important .markdown-alert-title {
|
||||
color: #d29922;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-alert-warning {
|
||||
background-color: rgba(221, 155, 76, 0.15);
|
||||
background-color: rgba(219, 171, 9, 0.15);
|
||||
border-left-color: #d29922;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-alert-warning .markdown-alert-title {
|
||||
color: #d29922;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-alert-caution {
|
||||
background-color: rgba(224, 92, 92, 0.15);
|
||||
background-color: rgba(248, 81, 73, 0.15);
|
||||
border-left-color: #f85149;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-alert-caution .markdown-alert-title {
|
||||
color: #f85149;
|
||||
}
|
||||
|
||||
/* Fix content inside alerts */
|
||||
|
@ -448,14 +471,14 @@
|
|||
|
||||
/* Ensure proper spacing for code in alerts */
|
||||
.markdown-alert code {
|
||||
background-color: rgba(0, 0, 0, 0.07);
|
||||
background-color: rgba(27, 31, 35, 0.05);
|
||||
border-radius: 3px;
|
||||
padding: 0.2em 0.4em;
|
||||
font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-alert code {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
background-color: rgba(240, 246, 252, 0.15);
|
||||
}
|
||||
|
||||
/* Fix port display in accordion headers */
|
||||
|
@ -468,4 +491,11 @@
|
|||
/* Add compatibility classes for GitHub markdown */
|
||||
.markdown-content .markdown-reading-view {
|
||||
width: 100%;
|
||||
color: var(--markdown-text);
|
||||
background-color: var(--markdown-bg);
|
||||
}
|
||||
|
||||
[data-bs-theme="dark"] .markdown-content .markdown-reading-view {
|
||||
color: var(--markdown-text);
|
||||
background-color: var(--markdown-bg);
|
||||
}
|
|
@ -412,5 +412,27 @@
|
|||
.card-body .markdown-content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Ensure consistent coloring across application and server markdown views */
|
||||
.accordion-body {
|
||||
background-color: var(--card-bg);
|
||||
border-top: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.documentation-wrapper .markdown-content {
|
||||
color: var(--markdown-text);
|
||||
}
|
||||
|
||||
/* Make accordion headers match the theme better */
|
||||
.accordion-button.collapsed {
|
||||
background-color: var(--card-bg);
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
/* Port badges styling */
|
||||
.accordion-button .badge {
|
||||
background-color: var(--highlight-color);
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
|
@ -61,4 +61,58 @@
|
|||
deleteButton.disabled = confirmationInput.value !== subnetCidr;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<!-- Find where application documentation is displayed -->
|
||||
<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">
|
||||
{% 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">
|
||||
<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>
|
||||
{% 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>
|
||||
{% 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">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="usage-info">
|
||||
<small class="text-muted">Usage</small>
|
||||
<div class="progress" style="width: 100px; height: 6px;">
|
||||
<div class="progress-bar bg-primary" style="width: {{ app.host_usage if app.host_usage else 0 }}%"></div>
|
||||
</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 %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="p-3 text-muted">
|
||||
No applications found in this subnet.
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue