Skip to content

Commit

Permalink
Übersetzung auf Deutsch und markierung von baustellen
Browse files Browse the repository at this point in the history
  • Loading branch information
FischLord committed Feb 2, 2024
1 parent 6cd4b99 commit 0664ab4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 117 deletions.
4 changes: 2 additions & 2 deletions ip-atlas/routes/atlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def index():
createJson()
data = loadJson()
return render_template('ip/list.html', data=data)
return render_template('dashboard.html', data=data)


@bp_atlas.route('/ip/list')
Expand Down Expand Up @@ -90,7 +90,7 @@ def delete(id):

if confirmed == 'true':
deleteHost(id)
return jsonify(success=True) # For AJAX success handling
return jsonify(success=True)
else:
return jsonify(success=False, message="Deletion not confirmed")

Expand Down
7 changes: 7 additions & 0 deletions ip-atlas/templates/dashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "layout.html" %} {% block content %}

<h1>
Baustelle
</h1>

{% endblock %}
12 changes: 6 additions & 6 deletions ip-atlas/templates/ip/list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "layout.html" %} {% block content %}
<div class="flex items-center">
<h1 class="text-lg font-semibold md:text-2xl">IP Addresses</h1>
<h1 class="text-lg font-semibold md:text-2xl">IP Adressen</h1>
<div class="flex gap-2 ml-auto">
<a href="/ip/add"
class="inline-flex items-center justify-center px-3 text-sm font-medium transition-colors bg-gray-700 rounded-md whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 -foreground hover:/90 h-9">
Expand Down Expand Up @@ -28,7 +28,7 @@ <h1 class="text-lg font-semibold md:text-2xl">IP Addresses</h1>
class="w-full p-2 text-sm text-white bg-gray-700 rounded-md shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent" />
</div>
<div class="space-y-1">
<label for="ipInput1" class="block text-sm font-semibold">IP Address</label>
<label for="ipInput1" class="block text-sm font-semibold">IP Addresse</label>
<div class="flex items-center gap-2">
<input type="text" id="ipInput1" name="ipocted1" maxlength="3"
class="w-1/4 p-2 text-sm text-white bg-gray-700 rounded-md shadow-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent ip-input" />
Expand Down Expand Up @@ -118,7 +118,7 @@ <h1 class="text-lg font-semibold md:text-2xl">IP Addresses</h1>
Name
</th>
<th class="h-12 px-4 font-medium text-left align-middle ">
IP Address
IP Adresse
</th>
<th class="h-12 px-4 font-medium text-left align-middle ">
Ports in der FBox
Expand All @@ -130,7 +130,7 @@ <h1 class="text-lg font-semibold md:text-2xl">IP Addresses</h1>
Status
</th>
<th class="h-12 px-4 font-medium text-center align-middle ">
Actions
Aktionen
</th>
</tr>
</thead>
Expand All @@ -145,7 +145,7 @@ <h1 class="text-lg font-semibold md:text-2xl">IP Addresses</h1>
{% if host.tags %}
{{ host.tags|join(", ") }}
{% else %}
No tags
Keine Tags
{% endif %}
</td>
<td class="p-4 align-middle ip-ping-status" data-ip="{{ host.ip }}">
Expand Down Expand Up @@ -286,7 +286,7 @@ <h1 class="text-lg font-semibold md:text-2xl">IP Addresses</h1>

window.deleteItem = function (button) {
var itemId = $(button).data('id');
if (confirm('Are you sure you want to delete this item?')) {
if (confirm('Möchten Sie diesen Eintrag wirklich löschen?')) {
$.ajax({
url: `/ip/delete/${itemId}?confirmed=true`,
type: 'GET',
Expand Down
10 changes: 5 additions & 5 deletions ip-atlas/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
<a class="flex items-center gap-2 px-3 py-2 transition-all rounded-lg hover:text-gray-100 {% if current_page == url_for('atlas.index') %}bg-gray-700{% endif %}"
href="{{ url_for('atlas.index') }}">
<span class="text-base leading-none material-symbols-outlined">home</span>
<span class="ml-1 text-sm align-middle">Home</span>
<span class="ml-1 text-sm align-middle">Dashboard</span>
</a>
<a class="flex items-center gap-2 px-3 py-2 transition-all rounded-lg hover:text-gray-100 {% if current_page == url_for('atlas.list') %}bg-gray-700{% endif %}"
href="{{ url_for('atlas.list') }}">
<span class="text-base leading-none material-symbols-outlined">language</span>
<span class="ml-1 text-sm align-middle">IP Addresses</span>
<span class="ml-1 text-sm align-middle">IP Adressen</span>
</a>
<a class="flex items-center gap-2 px-3 py-2 transition-all rounded-lg hover:text-gray-100 {% if current_page == url_for('atlas.port') %}bg-gray-700{% endif %}"
href="{{ url_for('atlas.port') }}">
Expand All @@ -61,7 +61,7 @@
<a class="flex items-center gap-2 px-3 py-2 transition-all rounded-lg hover:text-gray-100 {% if current_page == url_for('atlas.statistic') %}bg-gray-700{% endif %}"
href="{{ url_for('atlas.statistic') }}">
<span class="text-base leading-none material-symbols-outlined">signal_cellular_alt</span>
<span class="ml-1 text-sm align-middle">Network Statistics</span>
<span class="ml-1 text-sm align-middle">Statistiken</span>
</a>
</nav>
</div>
Expand Down Expand Up @@ -92,7 +92,7 @@
<select id="searchType" name="search_type"
class="block h-full px-4 py-2 leading-tight text-white bg-gray-800 rounded-lg order-transparent">
<option value="ip" {% if request.args.get('search_type', '')=='ip' %}selected{% endif %}>
IP Address</option>
IP Adresse</option>
<option value="name" {% if request.args.get('search_type', '')=='name' %}selected{% endif %}>Name</option>
<option value="port" {% if request.args.get('search_type', '')=='port' %}selected{% endif %}>Port</option>
<option value="tag" {% if request.args.get('search_type', '')=='tag' %}selected{% endif %}>Tag</option>
Expand All @@ -118,7 +118,7 @@
</div>
<footer class="py-4 text-white bg-gray-800">
<div class="container mx-auto text-center">
&copy; 2024 Zitau. All rights reserved. An P22 Project.
&copy; 2024 Zitau. All rights reserved. A P22 Project.
</div>
</footer>
</body>
Expand Down
107 changes: 3 additions & 104 deletions ip-atlas/templates/port/list.html
Original file line number Diff line number Diff line change
@@ -1,106 +1,5 @@
{% extends "layout.html" %} {% block content %}
<div class="flex items-center">
<h1 class="text-lg font-semibold md:text-2xl">IP Addresses</h1>
<div class="flex gap-2 ml-auto">
<a href="/ip/add" class="inline-flex items-center justify-center px-3 text-sm font-medium transition-colors bg-gray-700 rounded-md whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 -foreground hover:/90 h-9">
Add IP
</a>
<button
class="inline-flex items-center justify-center px-3 text-sm font-medium transition-colors bg-gray-700 rounded-md whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 -foreground hover:/90 h-9">
Edit IP
</button>
<button
class="inline-flex items-center justify-center px-3 text-sm font-medium transition-colors bg-gray-700 rounded-md whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 -foreground hover:/90 h-9">
Reassign IP
</button>
</div>
</div>
<div class="flex items-center justify-between mb-4">
<div class="flex gap-2">
<label for="filter" class="mr-2 font-medium">
Filter by:
</label>
<select id="filter" class="p-2 border rounded-md">
<option value="">All</option>
<option value="active">Active</option>
<option value="inactive">Inactive</option>
</select>
</div>
<div class="flex gap-2">
<label for="sort" class="mr-2 font-medium">
Sort by:
</label>
<select id="sort" class="p-2 border rounded-md">
<option value="">None</option>
<option value="asc">IP Ascending</option>
<option value="desc">IP Descending</option>
</select>
</div>
</div>
{% if data and data.hosts %}
<div class="border rounded-lg shadow-sm">
<div class="relative w-full overflow-auto">
<table class="w-full text-sm caption-bottom">
<thead>
<tr class="border-b ">
<th
class="h-12 px-4 text-left align-middle font-medium text-muted-foreground w-[100px]">
IP Address
</th>
<th
class="h-12 px-4 text-left align-middle font-medium text-muted-foreground max-w-[150px]">
Status
</th>
<th
class="hidden h-12 px-4 font-medium text-left align-middle text-muted-foreground md:table-cell">
Name
</th>
<th
class="h-12 px-4 font-medium text-left align-middle text-muted-foreground ">
Ports
</th>
<th
class="h-12 px-4 font-medium text-left align-middle text-muted-foreground ">
Actions
</th>
</tr>
</thead>
<tbody>
{% for host in data.hosts %}
<tr class="border-b ">
<td class="p-4 font-medium align-middle">
{{ host.ip }}</td>
<td class="p-4 align-middle ">
{% if pingable %}
<i class="text-green-500 material-symbols-outlined" style="font-size:24px;">check_circle</i>
{% else %}
<i class="text-red-500 material-symbols-outlined" style="font-size:24px;">cancel</i>
{% endif %}
</td>
<td class="hidden p-4 align-middle md:table-cell">
{{ host.name }}</td>
<td class="p-4 align-middle ">{{ host.ports[0]|join(", ") }}</td>
<td class="p-4 align-middle ">
<button
class="inline-flex items-center justify-center px-3 text-sm font-medium transition-colors bg-gray-700 rounded-md whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 -foreground hover:/90 h-9">
Edit
</button>
<button
class="inline-flex items-center justify-center px-3 ml-2 text-sm font-medium transition-colors bg-gray-700 rounded-md whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 -foreground hover:/90 h-9">
Reassign
</button>
<a href="/ip/delete/{{ host.id }}"
class="inline-flex items-center justify-center px-3 ml-2 text-sm font-medium transition-colors bg-gray-700 rounded-md whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 -foreground hover:/90 h-9">
Delete
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% else %}
<p class="text-center text-gray-500">No data available.</p>
{% endif %}

<H1>Baustelle</H1>

{% endblock %}
3 changes: 3 additions & 0 deletions ip-atlas/templates/statistic.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% extends "layout.html" %} {% block content %}

<h1>
Baustelle
</h1>

{% endblock %}

0 comments on commit 0664ab4

Please sign in to comment.