Compare commits

..

26 Commits

Author SHA1 Message Date
Samuel Zielke 8d70facb17 ändern des datei namen zum test
3 months ago
Samuel Zielke cf0bee4532 Update Fix for cache Problem
3 months ago
Samuel Zielke e0ce20771e Änderungen für die richtige Weiterleitung
3 months ago
Samuel Zielke c8d9a43c4e Korrektur damit Umleitung funktioniert
3 months ago
Samuel Zielke a43a58f16f Merge branch '16-Bug-Jahreswechsel'
3 months ago
Samuel Zielke b61dfebc27 Alles für das Versionsupdate
3 months ago
Samuel Zielke af7cb7b181 Merge branch 'main' of https://git.samuelzielke.de/samuelzielke/piomint
3 months ago
root b66ccb175c edits by server
3 months ago
Samuel Zielke 8b9c956d32 Merge pull request 'Bugfix:' (#17) from 16-Bug-Jahreswechsel into main
3 months ago
Samuel Zielke 872f733fd9 Bugfix:
3 months ago
Samuel Zielke d8d5e88ed5 Merge pull request 'Add Requirements' (#1) from hotfix-install_bug into main
5 months ago
Samuel Zielke ee1fe163cc Add Requirements
5 months ago
Samuel Zielke d9645961d4 Edit GitIgnore
9 months ago
Samuel Zielke 43d7b5728d UpdateFix: v1.3.2-2
9 months ago
Samuel Zielke 30f59bd62b UpdateFix: 1.3.2_1
9 months ago
Samuel Zielke f106c96281 v1.3.2 - Hotfix: Monatswechsel
9 months ago
Samuel Zielke 74c7e935de Hotfix: Monatswechsel (Denkfehler)
9 months ago
Samuel Zielke 53638bdc37 BugFix: Fehler bei der UpdateInfo
10 months ago
Samuel Zielke 83d1268932 Nachanpassung der Settings (static root)
10 months ago
Samuel Zielke 9702978acf Add HotFix 1.3.1 and Edit UpdateInfo
10 months ago
Samuel Zielke 0723112530 Add HotFix 1.3.1 and Edit UpdateInfo
10 months ago
Samuel Zielke a7bc35379d BugFix: Wechseln in Januar nicht möglich - da Monat "13" gesucht wird. Nun Zahlen und Regeln angepasst.
10 months ago
Samuel Zielke 7abefd4d59 Version: 1.3.0
11 months ago
Samuel Zielke e225877860 Funktion: Backup und Wiederherstellung
11 months ago
Samuel Zielke 4e29a5e189 EditUpdate and add button for whatsappcommunity
11 months ago
Samuel Zielke b253196fe4 Version und UpdateInfo edit
11 months ago

4
.gitignore vendored

@ -1,3 +1,5 @@
venv/ venv/
*/__pycache__* */__pycache__*
*/migrations* */migrations*
*/.DS_Store

@ -0,0 +1,59 @@
function getAllDataFromIndexedDB(dbName, storeName) {
return new Promise((resolve, reject) => {
const request = indexedDB.open(dbName);
request.onsuccess = function () {
const db = request.result;
const transaction = db.transaction(storeName, "readonly");
const store = transaction.objectStore(storeName);
const data = [];
const cursorRequest = store.openCursor();
cursorRequest.onsuccess = function (event) {
const cursor = event.target.result;
if (cursor) {
data.push(cursor.value);
cursor.continue();
} else {
resolve(data);
}
};
cursorRequest.onerror = function (event) {
reject(event.target.error);
};
};
request.onerror = function (event) {
reject(event.target.error);
};
});
}
function convertToJSON(data) {
return JSON.stringify(data, null, 2); // Formatiertes JSON
}
function downloadData(filename, content) {
const blob = new Blob([content], { type: "application/json" }); // JSON als Beispiel
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
async function exportIndexedDBData() {
const dbName = "myDB";
const storeName = "hours";
try {
const data = await getAllDataFromIndexedDB(dbName, storeName);
const jsonData = convertToJSON(data);
downloadData("piomint_backup.json", jsonData);
} catch (error) {
console.error("Fehler beim Exportieren der Daten:", error);
}
}

@ -6,8 +6,6 @@ const SETStudySaveButton = document.getElementById('SETStudySaveButton')
const SETMonthGoalSaveButton = document.getElementById('SETMonthGoalSaveButton') const SETMonthGoalSaveButton = document.getElementById('SETMonthGoalSaveButton')
var allowToSend = false; var allowToSend = false;
const monate = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]; const monate = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"];
const aktuellerMonat = monate[new Date().getMonth()];
// Aktuelles Datum
const currentDate = new Date(); const currentDate = new Date();
@ -157,11 +155,13 @@ SETMonthGoalSaveButton.addEventListener('click', () => {
}) })
async function getActualDataAndFillView(monat = currentDate.getMonth() + 1, jahr = currentDate.getFullYear()) { async function getActualDataAndFillView(monat = currentDate.getMonth(), jahr = currentDate.getFullYear()) {
try { try {
// Einfüfen des aktuellen Monats // Einfüfen des aktuellen Monats
document.getElementById('actualMonthName').innerHTML = monate[monat - 1]; document.getElementById('actualMonthName').innerHTML = monate[monat !== 12 ? monat : 0];
console.log("AKTUELLER MONAT SYSTEM: ", monat)
console.log("AKTUELLER MONAT REAL: ", currentDate.getMonth())
// Settings vor ausfüllen // Settings vor ausfüllen
@ -177,7 +177,9 @@ async function getActualDataAndFillView(monat = currentDate.getMonth() + 1, jahr
}); });
// Filter funktion aufrufen und entsprechend mit dem aktuellen Datum füllen // Filter funktion aufrufen und entsprechend mit dem aktuellen Datum füllen
const filteredEntries = await filterEntriesByMonthYear(monat, jahr); const filteredEntries = await filterEntriesByMonthYear(monat === 12 ? 1 : monat + 1, monat + 1 >= 9 ? jahr + 1 : jahr);
console.log("update-complete")
// Tabelle mit den aktuellen informationen füllen (funktion triggern und Daten übergeben) // Tabelle mit den aktuellen informationen füllen (funktion triggern und Daten übergeben)
fillTableWithEntries(filteredEntries) fillTableWithEntries(filteredEntries)
@ -381,30 +383,36 @@ document.getElementById('dashbord_month_area').addEventListener('click', () =>{
document.getElementById('MonthNameOfActual').innerHTML = "Monat:" document.getElementById('MonthNameOfActual').innerHTML = "Monat:"
// document.getElementById('actualMonthName').innerHTML = monate[new Date().getMonth()]; // document.getElementById('actualMonthName').innerHTML = monate[new Date().getMonth()];
diffMonth = 0; diffMonth = 0;
getActualDataAndFillView(new Date().getMonth() + diffMonth + 1) getActualDataAndFillView(new Date().getMonth() + diffMonth)
} }
}) })
document.getElementById('btn-month-before').addEventListener('click', () =>{ document.getElementById('btn-month-before').addEventListener('click', () =>{
if (diffMonth === 0) { console.log("CLICK-BEFORE: ", diffMonth)
diffMonth = 11; if (new Date().getMonth() + diffMonth == 0) {
getActualDataAndFillView(new Date().getMonth() + diffMonth + 1) diffMonth = 11 - new Date().getMonth();
getActualDataAndFillView(new Date().getMonth() + diffMonth)
console.log("CLICK-BEFRORE-0TO11: ", diffMonth)
} else { } else {
diffMonth = ((monate[new Date().getMonth() + diffMonth]) != 'September') ? diffMonth - 1 : diffMonth; diffMonth = ((monate[new Date().getMonth() + diffMonth]) != 'September') ? diffMonth - 1 : diffMonth;
// document.getElementById('actualMonthName').innerHTML = monate[new Date().getMonth() + diffMonth]; // document.getElementById('actualMonthName').innerHTML = monate[new Date().getMonth() + diffMonth];
getActualDataAndFillView(new Date().getMonth() + diffMonth + 1) getActualDataAndFillView(new Date().getMonth() + diffMonth)
}; };
console.log("CLICK-BEFORE-AFTER: ", diffMonth)
}); });
document.getElementById('btn-month-next').addEventListener('click', () =>{ document.getElementById('btn-month-next').addEventListener('click', () =>{
if (diffMonth === 11) { console.log("CLICK-NEXT: ", diffMonth)
diffMonth = 0; if (new Date().getMonth() + diffMonth == 11) {
getActualDataAndFillView(new Date().getMonth() + diffMonth + 1) diffMonth = 0 - new Date().getMonth();
getActualDataAndFillView(new Date().getMonth() + diffMonth)
console.log("CLICK-NEXT-11TO0: ", diffMonth)
} else { } else {
diffMonth = ((monate[new Date().getMonth() + diffMonth]) != 'August') ? diffMonth + 1 : diffMonth; diffMonth = ((monate[new Date().getMonth() + diffMonth]) != 'August') ? diffMonth + 1 : diffMonth;
// document.getElementById('actualMonthName').innerHTML = monate[new Date().getMonth() + diffMonth]; // document.getElementById('actualMonthName').innerHTML = monate[new Date().getMonth() + diffMonth];
getActualDataAndFillView(new Date().getMonth() + diffMonth + 1) getActualDataAndFillView(new Date().getMonth() + diffMonth)
}; };
console.log("CLICK-NEXT-AFTER: ", diffMonth)
}) })
function setNewCalsOfMonth(TheMonth) { function setNewCalsOfMonth(TheMonth) {

@ -0,0 +1,64 @@
function triggerFileInput() {
document.getElementById("fileInput").click();
}
document.getElementById("fileInput").addEventListener("change", handleFileUpload);
function handleFileUpload(event) {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = function (e) {
try {
const data = JSON.parse(e.target.result);
importDataToIndexedDB(data);
} catch (error) {
console.error("Fehler beim Lesen der Datei:", error);
alert("Ungültiges JSON-Format.");
}
};
reader.onerror = function () {
console.error("Fehler beim Lesen der Datei.");
};
reader.readAsText(file);
}
function importDataToIndexedDB(data) {
const dbName = "myDB";
const storeName = "hours";
const request = indexedDB.open(dbName);
request.onsuccess = function () {
const db = request.result;
const transaction = db.transaction(storeName, "readwrite");
const store = transaction.objectStore(storeName);
if (Array.isArray(data)) {
data.forEach(item => {
store.put(item);
});
} else {
console.error("Die importierten Daten müssen ein Array sein.");
alert("Ungültige Datenstruktur. Erwartet wird ein Array.");
}
transaction.oncomplete = function () {
if (alert("Daten erfolgreich importiert! \nBitte Seite aktualisieren...")) {
location.reload(); // Seite neu laden
}
};
transaction.onerror = function () {
console.error("Fehler beim Importieren der Daten:", transaction.error);
alert("Fehler beim Importieren der Daten.");
};
};
request.onerror = function (event) {
console.error("Fehler beim Öffnen der IndexedDB:", event.target.error);
};
}

@ -4,14 +4,13 @@ self.addEventListener("install", event => {
this.skipWaiting(); this.skipWaiting();
const urlsToCache = [ const urlsToCache = [
'/app/login/',
'/app/home/',
'/static/app/css/bootstrap.css', '/static/app/css/bootstrap.css',
'/static/app/css/custom.css', '/static/app/css/custom.css',
'/static/app/js/dbcontrol.js', '/static/app/js/dbcontrol.js',
'/static/app/js/home.js', '/static/app/js/timer.js',
'/static/app/js/timer.js',
'/static/app/js/welcomeControl.js', '/static/app/js/welcomeControl.js',
'/static/app/js/exportDB.js',
'/static/app/js/importDB.js',
'/static/app/js/UpdateInfoControl.js', '/static/app/js/UpdateInfoControl.js',
'/static/app/images/refresh.png', '/static/app/images/refresh.png',
'/static/app/images/play.png', '/static/app/images/play.png',
@ -56,15 +55,15 @@ self.addEventListener('activate', event => {
); );
}); });
// Serve from Cache // // Serve from Cache
self.addEventListener("fetch", event => { // self.addEventListener("fetch", event => {
event.respondWith( // event.respondWith(
caches.match(event.request) // caches.match(event.request)
.then(response => { // .then(response => {
return response || fetch(event.request); // return response || fetch(event.request);
}) // })
.catch(() => { // .catch(() => {
return caches.match('/app/home'); // return caches.match('/app/home');
}) // })
) // )
}); // });

@ -9,6 +9,7 @@
<link rel="stylesheet" href="{% static 'app/css/bootstrap.css' %}"> <link rel="stylesheet" href="{% static 'app/css/bootstrap.css' %}">
<link rel="stylesheet" href="{% static 'app/css/custom.css' %}"> <link rel="stylesheet" href="{% static 'app/css/custom.css' %}">
<script src="{% static 'app/js/dbcontrol.js' %}"></script> <script src="{% static 'app/js/dbcontrol.js' %}"></script>
<script src="{% static 'app/js/exportDB.js' %}"></script>
{% progressive_web_app_meta %} {% progressive_web_app_meta %}
@ -31,7 +32,7 @@
<div class="settings text-left"> <div class="settings text-left">
<div class="settings-card container"> <div class="settings-card container">
<h4 class="pt-3 text-center" style="margin-top: -1rem;">Einstellungen</h4> <h5 class="pt-3 text-center" style="">Einstellungen</h5>
<ul class="list-group" style="color: black;"> <ul class="list-group" style="color: black;">
<li class="list-group-item d-flex justify-content-between align-items-center"> <li class="list-group-item d-flex justify-content-between align-items-center">
Bibelstudien: Bibelstudien:
@ -43,6 +44,17 @@
<input type="number" class="w-25 btn btn-secondary" name="MonthGoalInput" id="MonthGoalInput" value="50" onfocus="document.getElementById('SETMonthGoalSaveButton').classList.remove('d-none')"> <input type="number" class="w-25 btn btn-secondary" name="MonthGoalInput" id="MonthGoalInput" value="50" onfocus="document.getElementById('SETMonthGoalSaveButton').classList.remove('d-none')">
<button class="btn d-none" id="SETMonthGoalSaveButton">Sichern</button> <button class="btn d-none" id="SETMonthGoalSaveButton">Sichern</button>
</li> </li>
<h5 class="mt-5 text-white text-center">Kontakt</h5>
<li class="list-group-item d-flex justify-content-between align-items-center">
WhatsApp Community
<a class="btn btn-success" href="https://chat.whatsapp.com/Cy4laGaEdLP1DZbhN04zRQ" target="_blank" rel="noopener noreferrer">Beitreten</a>
</li>
<h5 class="mt-5 text-white text-center">Daten Verwaltung</h5>
<li class="list-group-item d-flex justify-content-between align-items-center">
<button class="btn btn-info" onclick="exportIndexedDBData()">Exportieren</button>
<input type="file" id="fileInput" style="display: none;" accept=".json" />
<button class="btn btn-danger" onclick="triggerFileInput()">Wiederherstellen</button>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -54,5 +66,7 @@
{% block content %} {% block content %}
{% endblock %} {% endblock %}
</div> </div>
<script src="{% static 'app/js/importDB.js' %}"></script>
</body> </body>
</html> </html>

@ -291,7 +291,7 @@
}) })
</script> </script>
<script src="{% static 'app/js/home.js' %}"></script> <script src="{% static 'app/js/home01.js' %}"></script>
<script src="{% static 'app/js/timer.js' %}"></script> <script src="{% static 'app/js/timer.js' %}"></script>
<script src="{% static 'app/js/welcomeControl.js' %}"></script> <script src="{% static 'app/js/welcomeControl.js' %}"></script>
<script src="{% static 'app/js/UpdateInfoControl.js' %}"></script> <script src="{% static 'app/js/UpdateInfoControl.js' %}"></script>

@ -1,21 +1,22 @@
<br> <br>
<h1>Update Time!</h1> <h1>Update Time!</h1>
<br> <br>
<h5>v1.2.0</h5> <h5>v1.3.3</h5>
<p> <p>
<b style="color: red">WICHTIGE NEUIGKEIT!</b> <b style="color: red">Fehler Behebung! 🔥</b>
<br>Wieder ein kleiner Schritt 😀 <br>Anicht vom falschen Jahr!
<br> <br>
<br><b>Was ist neu?</b> <br><b>Was ist neu?</b>
<br> Du kannst jetzt die Monate wechseln. <br> Aufrund des Dienstjahres was nicht mit Kalender
<br> übereinstimmt, geht es gegen die Natur.
<br> <br>
<br><b>Wie?</b> <!-- <br><b>Hinweise:</b>
<br> Tippe dazu einfach auf die "Monats"-Kachel <br> 1. Backup muss Manuell gemacht werden (aktuell)!
<br> mit dem übersichtsbalken. <br> 2. Backup muss Gespeichert werden! */}}
<br> <br> -->
<br>Viel Freude beim Testen und Gruß, <br>Danke für die Geduld und das du Piomint nutzt!
<br><b>Samuel</b> <br><b>Gruß Samuel</b>
</p> </p>
<br> <br>
<input type="text" name="versionnumber" id="versionnumber" class="d-none" value="1.2.0"> <input type="text" name="versionnumber" id="versionnumber" class="d-none" value="1.3.3-5">

@ -9,5 +9,12 @@ urlpatterns = [
path("login", views.login), path("login", views.login),
path("home/", views.home), path("home/", views.home),
path('offline/', TemplateView.as_view(template_name="offline.html")), path('offline/', TemplateView.as_view(template_name="offline.html")),
path("install/", views.install) path("install/", views.install),
path("v1321/", views.v1322),
path("v1322/", views.v1322),
path("v133/", views.v133),
path("v1332/", views.v1332),
path("v1333/", views.v1333),
path("v1334/", views.v1334),
path("v1335/", views.v1335),
] ]

@ -8,7 +8,28 @@ def install(request):
return render(request, "app/install.html") return render(request, "app/install.html")
def home(request): def home(request):
return render(request, "app/home.html") return redirect("/app/v1335")
def login(request): def login(request):
return render(request, "app/login.html") return render(request, "app/login.html")
def v1321(request):
return redirect("/app/v1335")
def v1322(request):
return redirect("/app/v1335")
def v133(request):
return redirect("/app/v1335")
def v1332(request):
return redirect("/app/v1335")
def v1333(request):
return redirect("/app/v1335")
def v1334(request):
return redirect("/app/v1335")
def v1335(request):
return render(request, "app/home.html")

@ -9,7 +9,7 @@ PWA_APP_BACKGROUND_COLOR = '#9FEDD7'
PWA_APP_DISPLAY = 'standalone' PWA_APP_DISPLAY = 'standalone'
PWA_APP_SCOPE = '/' PWA_APP_SCOPE = '/'
PWA_APP_ORIENTATION = 'portrait' PWA_APP_ORIENTATION = 'portrait'
PWA_APP_START_URL = '/app/home/' PWA_APP_START_URL = '/app/v1335/'
PWA_APP_STATUS_BAR_COLOR = 'black-translucent' PWA_APP_STATUS_BAR_COLOR = 'black-translucent'
PWA_SERVICE_WORKER_PATH = os.path.join(BASE_DIR, 'app/static/app/js', 'serviceworker.js') PWA_SERVICE_WORKER_PATH = os.path.join(BASE_DIR, 'app/static/app/js', 'serviceworker.js')
PWA_APP_ICONS = [ PWA_APP_ICONS = [
@ -31,4 +31,4 @@ PWA_APP_SPLASH_SCREEN = [
} }
] ]
PWA_APP_DIR = 'ltr' PWA_APP_DIR = 'ltr'
PWA_APP_LANG = 'de' PWA_APP_LANG = 'de'

@ -27,7 +27,7 @@ SECRET_KEY = 'django-insecure-h^$jdg0n_yarg*l#r3fd_7=7_)-!0bspac70f$1#b7w8gmkc-*
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
ALLOWED_HOSTS = ['*'] if DEBUG else ['localhost'] ALLOWED_HOSTS = ['*'] if DEBUG else ['localhost', 'app.piomint.de']
# Application definition # Application definition
@ -138,6 +138,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/5.1/howto/static-files/ # https://docs.djangoproject.com/en/5.1/howto/static-files/
STATIC_URL = 'static/' STATIC_URL = 'static/'
STATIC_ROOT = '/var/www/piomint/static/' # Directory to collect static files.
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field

@ -0,0 +1,7 @@
asgiref==3.8.1
Django==5.1.1
django-pwa==2.0.0
gunicorn==23.0.0
mysqlclient==2.2.4
packaging==24.1
sqlparse==0.5.1
Loading…
Cancel
Save

Powered by TurnKey Linux.