Fehlermeldungen hinzugefügt, wenn Verbindung zur API nicht klappt

This commit is contained in:
R40fendt
2026-01-28 18:43:30 +01:00
parent 59e2a2693c
commit f04b4089f7
27 changed files with 194 additions and 137 deletions

0
src-tauri/icons/128x128.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

0
src-tauri/icons/128x128@2x.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

0
src-tauri/icons/32x32.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 974 B

0
src-tauri/icons/Square107x107Logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

0
src-tauri/icons/Square142x142Logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

0
src-tauri/icons/Square150x150Logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

0
src-tauri/icons/Square284x284Logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

0
src-tauri/icons/Square30x30Logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 903 B

After

Width:  |  Height:  |  Size: 903 B

0
src-tauri/icons/Square310x310Logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

0
src-tauri/icons/Square44x44Logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

0
src-tauri/icons/Square71x71Logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

0
src-tauri/icons/Square89x89Logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

0
src-tauri/icons/StoreLogo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

0
src-tauri/icons/icon.icns Normal file → Executable file
View File

0
src-tauri/icons/icon.ico Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

0
src-tauri/icons/icon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -25,11 +25,7 @@
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
"icons/icon.png"
]
}
}

View File

@@ -3,9 +3,10 @@ import { useRouter } from "vue-router";
class AdminPanelLib {
router=useRouter();
static async getUserInfo(token:string){
if(!await RitzenbergenLib.RitzenbergenLib.checkInternetConnection()) return false;
const url=new URL(RitzenbergenLib.RitzenbergenLib.api("/admin/userinfo.php"));
return fetch(url.toString(), {
headers: {

View File

@@ -23,7 +23,7 @@ export default {
parseInt(localStorage.getItem("kloenkasten_last_opened"))
);
const lastMsg = this.messages[this.messages.length - 1];
if (lastMsg.timestamp > lastOpened) {
if (this.messages && lastMsg.timestamp > lastOpened) {
return true;
}
return false;
@@ -60,7 +60,7 @@ export default {
"kloenkasten_last_opened",
Date.now().toString()
);
window.setTimeout(
if(this.messages) window.setTimeout(
() =>
this.msgrefs[this.msgrefs.length - 1].scrollIntoView({
behavior: "smooth",
@@ -78,13 +78,19 @@ export default {
)
);
return fetch(url.toString(), { method: "GET" })
.then((response) => response.json())
.then((response)=>{
if(response.ok) return response.json();
else throw new Error("fetch "+response.status);
})
.then((data) =>
data.map((msg) => {
msg.timestamp = new Date(msg.timestamp);
return msg;
})
);
).catch(()=>{
return false;
});
},
watch: ["reloader"],
},
@@ -108,7 +114,7 @@ export default {
<span id="close-button" @click="opened = false">&times;</span>
</div>
<div id="chat-messages">
<div id="chat-messages" v-if="messages">
<div
v-for="(msg, i) in messages"
:key="i"
@@ -154,6 +160,10 @@ export default {
<input type="submit" id="send-button" value="Senden" />
</form>
</div>
<div id="chat-messages" v-else>
<h3>Konnte Server nicht erreichen.</h3>
</div>
</div>
</template>
<style scoped>

View File

@@ -69,7 +69,7 @@ export default {
</div>
<div class="col-12 mt-4">
<p class="mbr-fonts-style copyright display-7">
© 2025 Ritzenbergen. Alle Rechte vorbehalten. <br />
© 2026 Ritzenbergen. Alle Rechte vorbehalten. <br />
</p>
</div>
</div>

View File

@@ -1,83 +1,104 @@
<script lang="ts">
<script lang="ts" setup>
import RitzenbergenLib from "../../ritzenbergenlib.ts";
export default {
data() {
return {
RitzenbergenLib: RitzenbergenLib.RitzenbergenLib
};
import {ref} from "vue";
async function loadImage(path: string) {
try{
const response = await fetch(RitzenbergenLib.RitzenbergenLib.api(path), {
headers: {
"Accept":"image/png"
}
};
});
if(!response.ok) return false;
const blob = await response.blob();
return URL.createObjectURL(blob);
}
catch(e){
console.warn(e);
}
}
loadImage("randomimage.php?path=/doppelkopf&recursive=1&tn=1&color=white&text=Doppelkopf&size=3").then((url)=>{
images.value[0]=url;
});
loadImage("randomimage.php?path=/erntefest&recursive=1&tn=1&color=white&text=Erntefest&size=3").then((url)=>{
images.value[1]=url;
});
loadImage("randomimage.php?path=/fussball&recursive=1&tn=1&color=white&text=Fußballturnier&size=3").then((url)=>{
images.value[2]=url;
});
loadImage("randomimage.php?path=/osterfeuer&recursive=1&tn=1&color=white&text=Osterfeuer&size=3").then((url)=>{
images.value[3]=url;
});
const images=ref([]);
</script>
<template>
<section class="gallery09 cid-u6k7q0xbqP" id="gallery-9-u6k7q0xbqP">
<section
class="gallery09 cid-u6k7q0xbqP"
id="gallery-9-u6k7q0xbqP"
v-if="images[0]"
>
<div class="container">
<div class="row justify-content-center">
<div class="col-12 col-md-12 col-lg-4 main-text">
<div class="">
<h5 class="mbr-section-title mbr-fonts-style mt-0 mb-4 display-2">
<h5
class="mbr-section-title mbr-fonts-style mt-0 mb-4 display-2"
>
<strong>Bilderbuch Ritzenbergen</strong>
</h5>
<h6
class="mbr-section-subtitle mbr-fonts-style mt-0 mb-4 display-7"
>
Klicke auf ein Bild um in unsere Galerie zu gelangen. Die Bilder
sind nach Jahreszahl und Kategorie geordnet.
Klicke auf ein Bild um in unsere Galerie zu
gelangen. Die Bilder sind nach Jahreszahl und
Kategorie geordnet.
</h6>
</div>
</div>
<div class="col-lg-8 side-features row">
<div class="item features-image col-12 col-md-6 col-lg-6 active">
<div
class="item features-image col-12 col-md-6 col-lg-6 active"
>
<div class="item-wrapper">
<div class="item-img">
<RouterLink to="/galerie/doppelkopf"
><img
:src="
RitzenbergenLib.api(
'randomimage.php?path=/doppelkopf&recursive=1&tn=1&color=white&text=Doppelkopf&size=3'
)
"
><img :src="images[0]"
/></RouterLink>
</div>
</div>
</div>
<div class="item features-image col-12 col-md-6 col-lg-6 active">
<div
class="item features-image col-12 col-md-6 col-lg-6 active"
>
<div class="item-wrapper">
<div class="item-img">
<RouterLink to="/galerie/erntefest"
><img
:src="
RitzenbergenLib.api(
'randomimage.php?path=/erntefest&recursive=1&tn=1&color=white&text=Erntefest&size=3'
)
"
><img :src="images[1]"
/></RouterLink>
</div>
</div>
</div>
<div class="item features-image col-12 col-md-6 col-lg-6 active">
<div
class="item features-image col-12 col-md-6 col-lg-6 active"
>
<div class="item-wrapper">
<div class="item-img">
<RouterLink to="/galerie/fussball"
><img
:src="
RitzenbergenLib.api(
'randomimage.php?path=/fussball&recursive=1&tn=1&color=white&text=Fußballturnier&size=3'
)
"
><img :src="images[2]"
/></RouterLink>
</div>
</div>
</div>
<div class="item features-image col-12 col-md-6 col-lg-6 active">
<div
class="item features-image col-12 col-md-6 col-lg-6 active"
>
<div class="item-wrapper">
<div class="item-img">
<RouterLink to="/galerie/osterfeuer"
><img
:src="
RitzenbergenLib.api(
'randomimage.php?path=/osterfeuer&recursive=1&tn=1&color=white&text=Osterfeuer&size=3'
)
"
><img :src="images[3]"
/></RouterLink>
</div>
</div>

View File

@@ -27,6 +27,9 @@ export default {
success: function (data: string) {
result = JSON.parse(data);
},
error: function () {
result=false;
}
});
return result;
/*
@@ -130,7 +133,7 @@ export default {
</div>
</div>
</div>
<div class="row">
<div class="row" v-if="events">
<!-- Events -->
<h5 class="align-center" v-if="events.length == 0">
@@ -217,6 +220,10 @@ export default {
</div>
</div>
</div>
<div class="row" v-else>
<h1>Keine Internetverbindung!</h1>
</div>
</div>
</section>
</template>

View File

@@ -50,6 +50,13 @@ class RitzenbergenLib {
return apiBaseUrl + path;
else return apiBaseUrl+"/" + path;
}
static async checkInternetConnection(): Promise<boolean> {
try{
return await fetch(this.api("/addhit.php")).then((response)=>response.ok);
} catch(e){
return false;
}
}
}
class Paarung {
@@ -171,6 +178,7 @@ class Formular {
}
public static async getForms(): Promise<Formular[]> {
let forms: Formular[] = [];
try{
forms = await fetch(
RitzenbergenLib.api("/formulare/get_formulare.php"),
{
@@ -191,6 +199,9 @@ class Formular {
)
);
} catch(e){
console.warn(e);
}
return forms;
}
private async getFields(): Promise<Field[]> {

View File

@@ -26,6 +26,11 @@ export default {
Tippen,
TippenEinloggen
},
created(){
RitzenbergenLib.RitzenbergenLib.checkInternetConnection().then((result)=>{
if(!result) this.$router.push("/");
});
},
asyncComputed: {
users: {
get(){

View File

@@ -17,6 +17,7 @@ export default {
let osterfeuer = this.get_jahre("osterfeuer");
let doppelkopf = this.get_jahre("doppelkopf");
let fussball = this.get_jahre("fussball");
if(erntefeste==undefined) return [];
let result = [
{
src: erntefeste.map((erntefest) =>
@@ -98,7 +99,7 @@ export default {
if(this.$route.params.ev){
let ev = this.$route.params.ev;
this.$refs[ev][0].scrollIntoView();
if(this.$refs[ev]) this.$refs[ev][0].scrollIntoView();
this.$router.push("/galerie");
}
}
@@ -156,6 +157,8 @@ export default {
</div>
<br /><br /><br />
</section>
<h1 v-if="events.length==0">Keine Internetverbindung!</h1>
<br /><br /><br />
<MyFooter />
</template>
<style scoped></style>

View File

@@ -1,4 +1,4 @@
<script lang="js">
<script lang="ts" setup>
import Navbar from "../components/Navbar.vue";
import Modal from "../components/Modal.vue";
import Embla from "../components/Embla.vue";
@@ -10,35 +10,38 @@ import Bilderbuch from "../components/startseite/Bilderbuch.vue";
import Forms from "../components/startseite/Forms.vue";
import Events from "../components/startseite/Events.vue";
import Willkommen from "../components/startseite/Willkommen.vue";
import { ref } from "vue";
export default {
components: {
Navbar,
Embla,
Umgebung,
MyFooter, // Geändert von Footer auf MyFooter
WillkommenText,
Bilderbuch,
Forms,
Events,
Willkommen
},
data() {
return {
RitzenbergenLib: RitzenbergenLib.RitzenbergenLib,
};
},
mounted(){
if(this.$route.path !== "/" && this.$route.path!=="/anmeldeformular"){
const hash = this.$route.path.replace("/","");
console.log(this.$refs[hash])
if(this.$refs[hash].$el) this.$refs[hash].$el.scrollIntoView();
this.$router.push("/");
}
const images=ref([]);
async function loadImage(path: string) {
try{
const response = await fetch(RitzenbergenLib.RitzenbergenLib.api(path), {
headers: {
"Accept":"image/png"
}
});
if(!response.ok) return false;
const blob = await response.blob();
return URL.createObjectURL(blob);
}catch(e){
console.warn(e);
}
}
loadImage("randomimage.php?path=/doppelkopf&recursive=1&tn=1&color=white&text=Doppelkopf&size=3").then((url)=>{
images.value[0]=url;
});
loadImage("randomimage.php?path=/erntefest&recursive=1&tn=1&color=white&text=Erntefest&size=3").then((url)=>{
images.value[1]=url;
});
loadImage("randomimage.php?path=/fussball&recursive=1&tn=1&color=white&text=Fußballturnier&size=3").then((url)=>{
images.value[2]=url;
});
loadImage("randomimage.php?path=/osterfeuer&recursive=1&tn=1&color=white&text=Osterfeuer&size=3").then((url)=>{
images.value[3]=url;
});
};
</script>
<template>
@@ -56,18 +59,12 @@ export default {
<section class="slider4 mbr-embla cid-u6k7q0yLdW" id="gallery-13-u6k7q0yLdW">
<section class="slider4 mbr-embla cid-u6k7q0yLdW" id="gallery-13-u6k7q0yLdW" v-if="images[0]">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<Embla :src="[
RitzenbergenLib.api('randomimage.php?path=/erntefest&recursive=1&tn=1&color=white&text=Erntefest&size=5'),
RitzenbergenLib.api('randomimage.php?path=/osterfeuer&recursive=1&tn=1&color=white&text=Osterfeuer&size=5'),
RitzenbergenLib.api('randomimage.php?path=/doppelkopf&recursive=1&tn=1&color=white&text=Doppelkopf&size=5'),
RitzenbergenLib.api('randomimage.php?path=/fussball&recursive=1&tn=1&color=white&text=Fußballturnier&size=5'),
'http://ritzenbergen.de/Fotos/hauptfoto.jpg'
]"
<Embla :src="images"
:links='[
"/galerie/erntefest",

View File

@@ -4,8 +4,14 @@
import { useRouter } from 'vue-router'
import RitzenbergenLib from "../../ritzenbergenlib.ts";
const router = useRouter()
RitzenbergenLib.RitzenbergenLib.checkInternetConnection().then((result)=>{
if(!result) router.push("/");
});
async function login(){
const url=new URL(RitzenbergenLib.RitzenbergenLib.api("/admin/login.php"));
url.searchParams.append("username",username.value);