feat: lesbare Tabellen und Vollbild-Lesemodus ergänzen
This commit is contained in:
@@ -12,6 +12,8 @@ Ein in NetBox integriertes Markdown-Wiki für Betriebsdokumentationen und Anleit
|
|||||||
- Formatierte Word-Inhalte inklusive Tabellen und unterstützten Zwischenablage-Bildern einfügen
|
- Formatierte Word-Inhalte inklusive Tabellen und unterstützten Zwischenablage-Bildern einfügen
|
||||||
- Mehrere Dokumentationen mit Ordnern, Zuordnungen und Anhängen als ZIP exportieren und wieder importieren
|
- Mehrere Dokumentationen mit Ordnern, Zuordnungen und Anhängen als ZIP exportieren und wieder importieren
|
||||||
- Druckoptimierte A4-Ansicht zum Drucken oder Speichern als PDF
|
- Druckoptimierte A4-Ansicht zum Drucken oder Speichern als PDF
|
||||||
|
- Vollbild-Lesemodus für einzelne Dokumentationen
|
||||||
|
- Lesbare Tabellen mit vollständigen Zellrahmen und horizontalem Inhalts-Scrolling
|
||||||
- Excel-Mehrblattimport: je Arbeitsblatt eine Dokumentation in einem gewählten Zielordner
|
- Excel-Mehrblattimport: je Arbeitsblatt eine Dokumentation in einem gewählten Zielordner
|
||||||
- Optionales Glätten von Excel-Tabellen in kompakte Feld-/Wert-Textblöcke
|
- Optionales Glätten von Excel-Tabellen in kompakte Feld-/Wert-Textblöcke
|
||||||
- Eine Dokumentation mehreren Objekten zuordnen und umgekehrt
|
- Eine Dokumentation mehreren Objekten zuordnen und umgekehrt
|
||||||
@@ -24,7 +26,7 @@ Ein in NetBox integriertes Markdown-Wiki für Betriebsdokumentationen und Anleit
|
|||||||
|
|
||||||
## Kompatibilität
|
## Kompatibilität
|
||||||
|
|
||||||
Die Version `0.5.5` zielt auf NetBox 4.x (mindestens 4.0). Vor einem produktiven Rollout sollte das Plugin gegen die konkret eingesetzte NetBox-Minor-Version in einer Testinstanz geprüft werden.
|
Die Version `0.5.6` zielt auf NetBox 4.x (mindestens 4.0). Vor einem produktiven Rollout sollte das Plugin gegen die konkret eingesetzte NetBox-Minor-Version in einer Testinstanz geprüft werden.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class DocumentationConfig(PluginConfig):
|
|||||||
name = "netbox_documentation"
|
name = "netbox_documentation"
|
||||||
verbose_name = "NetBox Dokumentation"
|
verbose_name = "NetBox Dokumentation"
|
||||||
description = "Wiki und Office-Dokumentation direkt in NetBox"
|
description = "Wiki und Office-Dokumentation direkt in NetBox"
|
||||||
version = "0.5.5"
|
version = "0.5.6"
|
||||||
author = "LKE"
|
author = "LKE"
|
||||||
base_url = "documentation"
|
base_url = "documentation"
|
||||||
min_version = "4.0.0"
|
min_version = "4.0.0"
|
||||||
|
|||||||
@@ -5,32 +5,64 @@
|
|||||||
<style>
|
<style>
|
||||||
.documentation-content { overflow-x: auto; }
|
.documentation-content { overflow-x: auto; }
|
||||||
.documentation-content table {
|
.documentation-content table {
|
||||||
width: auto !important;
|
width: max-content !important;
|
||||||
max-width: 100%;
|
min-width: 100%;
|
||||||
|
max-width: none !important;
|
||||||
table-layout: auto;
|
table-layout: auto;
|
||||||
|
border-collapse: collapse !important;
|
||||||
|
border: 1px solid var(--tblr-border-color, #adb5bd) !important;
|
||||||
font-size: .875rem;
|
font-size: .875rem;
|
||||||
line-height: 1.25;
|
line-height: 1.25;
|
||||||
}
|
}
|
||||||
.documentation-content th,
|
.documentation-content th,
|
||||||
.documentation-content td {
|
.documentation-content td {
|
||||||
min-width: 3rem;
|
min-width: 8rem;
|
||||||
max-width: 22rem;
|
max-width: 24rem;
|
||||||
padding: .25rem .4rem !important;
|
padding: .4rem .55rem !important;
|
||||||
|
border: 1px solid var(--tblr-border-color, #adb5bd) !important;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
word-break: normal;
|
word-break: normal;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
.documentation-content th {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1;
|
||||||
|
background: var(--tblr-bg-surface-secondary, #f1f3f5) !important;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.documentation-content tbody tr:nth-child(even) td {
|
||||||
|
background: color-mix(in srgb, var(--tblr-bg-surface-secondary, #f1f3f5) 45%, transparent);
|
||||||
|
}
|
||||||
.documentation-content p { max-width: 90rem; }
|
.documentation-content p { max-width: 90rem; }
|
||||||
|
#documentation-viewer:fullscreen {
|
||||||
|
width: 100%;
|
||||||
|
max-width: none;
|
||||||
|
height: 100%;
|
||||||
|
padding: 1.25rem;
|
||||||
|
overflow: auto;
|
||||||
|
background: var(--tblr-body-bg, #fff);
|
||||||
|
}
|
||||||
|
#documentation-viewer:fullscreen .card { min-height: calc(100vh - 2.5rem); }
|
||||||
|
#documentation-viewer:fullscreen .fullscreen-document-title,
|
||||||
|
#documentation-viewer:fullscreen .fullscreen-exit { display: block !important; }
|
||||||
|
.fullscreen-document-title { display: none; margin: 0 4rem 1rem 0; }
|
||||||
|
.fullscreen-exit { display: none; position: fixed; top: 1rem; right: 1rem; z-index: 10; }
|
||||||
</style>
|
</style>
|
||||||
{% endblock head %}
|
{% endblock head %}
|
||||||
{% block extra_controls %}
|
{% block extra_controls %}
|
||||||
|
<button type="button" id="documentation-fullscreen" class="btn btn-outline-secondary">
|
||||||
|
<i class="mdi mdi-fullscreen"></i> Vollbild
|
||||||
|
</button>
|
||||||
<a href="{% url 'plugins:netbox_documentation:document_print' pk=object.pk %}" target="_blank" class="btn btn-outline-secondary">
|
<a href="{% url 'plugins:netbox_documentation:document_print' pk=object.pk %}" target="_blank" class="btn btn-outline-secondary">
|
||||||
<i class="mdi mdi-printer"></i> Drucken / PDF
|
<i class="mdi mdi-printer"></i> Drucken / PDF
|
||||||
</a>
|
</a>
|
||||||
{% endblock extra_controls %}
|
{% endblock extra_controls %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col col-md-9">
|
<div class="col col-md-9" id="documentation-viewer">
|
||||||
|
<h1 class="fullscreen-document-title">{{ object.title }}</h1>
|
||||||
|
<button type="button" class="btn btn-secondary fullscreen-exit" id="documentation-fullscreen-exit"><i class="mdi mdi-fullscreen-exit"></i> Vollbild beenden</button>
|
||||||
{% if object.summary %}<p class="lead">{{ object.summary }}</p>{% endif %}
|
{% if object.summary %}<p class="lead">{{ object.summary }}</p>{% endif %}
|
||||||
<div class="card"><div class="card-body rendered-markdown documentation-content">{{ object.rendered_body|safe }}</div></div>
|
<div class="card"><div class="card-body rendered-markdown documentation-content">{{ object.rendered_body|safe }}</div></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -45,3 +77,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
||||||
|
{% block javascript %}
|
||||||
|
{{ block.super }}
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const viewer = document.getElementById('documentation-viewer');
|
||||||
|
const openButton = document.getElementById('documentation-fullscreen');
|
||||||
|
const closeButton = document.getElementById('documentation-fullscreen-exit');
|
||||||
|
if (!viewer || !openButton || !viewer.requestFullscreen) {
|
||||||
|
if (openButton) openButton.style.display = 'none';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
openButton.addEventListener('click', () => viewer.requestFullscreen());
|
||||||
|
closeButton.addEventListener('click', () => {
|
||||||
|
if (document.fullscreenElement) document.exitFullscreen();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endblock javascript %}
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "netbox-documentation"
|
name = "netbox-documentation"
|
||||||
version = "0.5.5"
|
version = "0.5.6"
|
||||||
description = "Integrated Markdown wiki and office document importer for NetBox"
|
description = "Integrated Markdown wiki and office document importer for NetBox"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
|
|||||||
Reference in New Issue
Block a user