readme.md
16
app/app.py
@@ -1,7 +1,7 @@
|
|||||||
# Copyright (c) 2025 Martin Kayser (tebarius)
|
# Copyright (c) 2025 Martin Kayser (tebarius)
|
||||||
# Licensed under the MIT License. See LICENSE file in the project root.
|
# Licensed under the MIT License. See LICENSE file in the project root.
|
||||||
import streamlit as st
|
import streamlit as st
|
||||||
|
import base64
|
||||||
import tools
|
import tools
|
||||||
|
|
||||||
standard_output = ('#### Um den HILFE-Text zu einzelnen Funktionen aufzurufen bitte die Funktion mit leerem'
|
standard_output = ('#### Um den HILFE-Text zu einzelnen Funktionen aufzurufen bitte die Funktion mit leerem'
|
||||||
@@ -11,15 +11,21 @@ st.set_page_config(
|
|||||||
# we do also patching static-files of streamlit in the docker-container so bookmarks will have
|
# we do also patching static-files of streamlit in the docker-container so bookmarks will have
|
||||||
# the same favicon and if posting links for example in whatsapp they will have the same title
|
# the same favicon and if posting links for example in whatsapp they will have the same title
|
||||||
page_title="tebarius Mysteryhelfer (web)",
|
page_title="tebarius Mysteryhelfer (web)",
|
||||||
page_icon="./favicon.ico",
|
page_icon="images/favicon.ico",
|
||||||
layout="wide"
|
layout="wide"
|
||||||
)
|
)
|
||||||
|
|
||||||
st.logo('./logo.png', size='large')
|
st.logo('images/logo.png', size='large')
|
||||||
|
|
||||||
logo_col, title_col = st.columns([1,5])
|
logo_col, title_col = st.columns([1,4])
|
||||||
with logo_col:
|
with logo_col:
|
||||||
st.image('./logo-mit-tb.png', width=150)
|
st.markdown(f'<a href="https://gitea.tebarius.duckdns.org/tebarius/Mysteryhelfer-web">'
|
||||||
|
f'<img src="data:image/png;base64,'
|
||||||
|
f'{base64.b64encode(open("images/logo-mit-tb.png", "rb").read()).decode()}" width="150">'
|
||||||
|
f'<img src="data:image/png;base64,'
|
||||||
|
f'{base64.b64encode(open("images/gitea.png", "rb").read()).decode()}" width="70">'
|
||||||
|
f'</a>',
|
||||||
|
unsafe_allow_html=True)
|
||||||
with title_col:
|
with title_col:
|
||||||
st.write('### tebarius Mysteryhelfer (web)')
|
st.write('### tebarius Mysteryhelfer (web)')
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 159 KiB |
BIN
app/images/gitea.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 366 KiB After Width: | Height: | Size: 366 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
@@ -2608,6 +2608,7 @@ def adfgvx_dekodieren(eingabetext, pw):
|
|||||||
ausgabetext += f"_dekodiert mit Variante 9-0,Z-A:_ \n{klartext_90za}"
|
ausgabetext += f"_dekodiert mit Variante 9-0,Z-A:_ \n{klartext_90za}"
|
||||||
return ausgabetext
|
return ausgabetext
|
||||||
|
|
||||||
|
# noch nicht implementierte Funktionen:
|
||||||
'''
|
'''
|
||||||
def brainfuck_interpreter():
|
def brainfuck_interpreter():
|
||||||
eingabetext = Eingabe.get(1.0, END)
|
eingabetext = Eingabe.get(1.0, END)
|
||||||
@@ -2722,6 +2723,4 @@ den Code auszuführen.""" + "\n\n")
|
|||||||
i = loop[-1]
|
i = loop[-1]
|
||||||
i += 1
|
i += 1
|
||||||
Ausgabe.insert(1.0, "".join(rv) + "\n")
|
Ausgabe.insert(1.0, "".join(rv) + "\n")
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ services:
|
|||||||
mysteryhelfer-web:
|
mysteryhelfer-web:
|
||||||
build: ./
|
build: ./
|
||||||
ports:
|
ports:
|
||||||
- "80:8501"
|
- "8501:8501"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
28
readme.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# <img src="./app/images/logo.png" alt="Logo" width="100" height=auto> tebarius Mysteryhelfer (web)
|
||||||
|
|
||||||
|
Dies ist die Umsetzung der [Desktop-App Mysteryhelfer](https://mysteryhelfer.tebarius.duckdns.org/) ([Sourcecode](https://gitea.tebarius.duckdns.org/tebarius/Mysteryhelfer)) als Web-App.
|
||||||
|
|
||||||
|
Für die Umsetzung kommt das Python-Framework [Streamlit](https://streamlit.io/) zum Einsatz, durch welches es mir möglich war, dieselben Funktionen zu implementieren wie sie für die Desktop-App genutzt werden. (Für die Funktionen war hier primär nur die Ausgabe anzupassen.)
|
||||||
|
|
||||||
|
Der einfachst Weg, um die App lokal laufen zu lassen, ist mit Docker, wobei ich hier mal 3 Möglichkeiten aufzeige:
|
||||||
|
1. mit vorgebautem Image:
|
||||||
|
- `docker run --rm -d -p 8501:8501 gitea.tebarius.duckdns.org/tebarius/mysteryhelfer`
|
||||||
|
|
||||||
|
2. mit vorgebautem Image und "docker compose"
|
||||||
|
- docker-compose.yml erstellen mit folgendem Inhalt:
|
||||||
|
```
|
||||||
|
services:
|
||||||
|
mysteryhelfer-web:
|
||||||
|
image: gitea.tebarius.duckdns.org/tebarius/mysteryhelfer
|
||||||
|
ports:
|
||||||
|
- "8501:8501"
|
||||||
|
restart: unless-stopped
|
||||||
|
```
|
||||||
|
- `docker compose up`
|
||||||
|
|
||||||
|
3. mit selbst gebautem Image aus dem Quellcode
|
||||||
|
- `git clone https://gitea.tebarius.duckdns.org/tebarius/Mysteryhelfer-web.git`
|
||||||
|
- `cd Mysteryhelfer-web`
|
||||||
|
- `docker compose up`
|
||||||
|
|
||||||
|
bei allen 3 Varianten ist die App anschließend im Browser unter http://127.0.0.1:8501/ aufrufbar
|
||||||