feat: 1und 0 in Status in dashboard
This commit is contained in:
@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=false
|
NEXT_PUBLIC_EXPORT_STATIC=false
|
||||||
NEXT_PUBLIC_USE_CGI=false
|
NEXT_PUBLIC_USE_CGI=false
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.506
|
NEXT_PUBLIC_APP_VERSION=1.6.507
|
||||||
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=true
|
NEXT_PUBLIC_EXPORT_STATIC=true
|
||||||
NEXT_PUBLIC_USE_CGI=true
|
NEXT_PUBLIC_USE_CGI=true
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.506
|
NEXT_PUBLIC_APP_VERSION=1.6.507
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
|
## [1.6.507] – 2025-06-30
|
||||||
|
|
||||||
|
- feat: Dashboard Meldungen Status 1 oder 0
|
||||||
|
|
||||||
|
---
|
||||||
## [1.6.506] – 2025-06-30
|
## [1.6.506] – 2025-06-30
|
||||||
|
|
||||||
- feat: Redux-Integration für Meldungen, Anzeige von 'v' statt 's' in UI
|
- feat: Redux-Integration für Meldungen, Anzeige von 'v' statt 's' in UI
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
"use client";
|
"use client";
|
||||||
// @/components/main/dashboard/Last20MessagesTable.tsx
|
|
||||||
|
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
@@ -14,27 +13,28 @@ type Meldung = {
|
|||||||
i: string;
|
i: string;
|
||||||
v: string;
|
v: string;
|
||||||
};
|
};
|
||||||
export default function Last20MessagesTable() {
|
|
||||||
|
type Props = {
|
||||||
|
className?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function Last20MessagesTable({ className }: Props) {
|
||||||
const dispatch = useDispatch<AppDispatch>();
|
const dispatch = useDispatch<AppDispatch>();
|
||||||
type RootState = {
|
type RootState = {
|
||||||
messages: {
|
messages: {
|
||||||
data: Meldung[];
|
data: Meldung[];
|
||||||
};
|
};
|
||||||
// add other slices if needed
|
|
||||||
};
|
};
|
||||||
const { data: messages } = useSelector((state: RootState) => state.messages);
|
const { data: messages } = useSelector((state: RootState) => state.messages);
|
||||||
|
|
||||||
const [sourceFilter, setSourceFilter] = useState<string>("Alle");
|
const [sourceFilter] = useState<string>("Alle");
|
||||||
|
|
||||||
// Datum initialisieren: von = heute - 30 Tage, bis = heute
|
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const prior30 = new Date();
|
const prior30 = new Date();
|
||||||
prior30.setDate(today.getDate() - 30);
|
prior30.setDate(today.getDate() - 30);
|
||||||
|
|
||||||
const formatDate = (d: Date) => d.toISOString().split("T")[0];
|
const formatDate = (d: Date) => d.toISOString().split("T")[0];
|
||||||
|
const [fromDate] = useState<string>(formatDate(prior30));
|
||||||
const [fromDate, setFromDate] = useState<string>(formatDate(prior30));
|
const [toDate] = useState<string>(formatDate(today));
|
||||||
const [toDate, setToDate] = useState<string>(formatDate(today));
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(getMessagesThunk({ fromDate, toDate }));
|
dispatch(getMessagesThunk({ fromDate, toDate }));
|
||||||
@@ -46,11 +46,7 @@ export default function Last20MessagesTable() {
|
|||||||
: messages.filter((m: Meldung) => m.i === sourceFilter);
|
: messages.filter((m: Meldung) => m.i === sourceFilter);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-3 p-4 w-full max-w-full h-[calc(100vh-13vh-8vh)] laptop:h-[calc(100vh-10vh-5vh)] xl:h-[calc(100vh-10vh-6vh)] laptop:gap-0">
|
<div className={`flex flex-col gap-3 p-4 ${className}`}>
|
||||||
<h1 className="text-xl font-bold mb-4"></h1>
|
|
||||||
|
|
||||||
<div className="flex flex-wrap gap-6 mb-6 items-end"></div>
|
|
||||||
|
|
||||||
<div className="overflow-auto max-h-[80vh]">
|
<div className="overflow-auto max-h-[80vh]">
|
||||||
<table className="min-w-full border">
|
<table className="min-w-full border">
|
||||||
<thead className="bg-gray-100 text-left sticky top-0 z-10">
|
<thead className="bg-gray-100 text-left sticky top-0 z-10">
|
||||||
@@ -63,22 +59,20 @@ export default function Last20MessagesTable() {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{filteredMessages
|
{filteredMessages.slice(0, 20).map((msg, index) => (
|
||||||
.slice(0, 20)
|
<tr key={index} className="hover:bg-gray-50">
|
||||||
.map((msg: Meldung, index: number) => (
|
<td className="border p-2">
|
||||||
<tr key={index} className="hover:bg-gray-50">
|
<div
|
||||||
<td className="border p-2">
|
className="w-4 h-4 rounded"
|
||||||
<div
|
style={{ backgroundColor: msg.c }}
|
||||||
className="w-4 h-4 rounded"
|
></div>
|
||||||
style={{ backgroundColor: msg.c }}
|
</td>
|
||||||
></div>
|
<td className="border p-2">{msg.t}</td>
|
||||||
</td>
|
<td className="border p-2">{msg.i}</td>
|
||||||
<td className="border p-2">{msg.t}</td>
|
<td className="border p-2">{msg.m}</td>
|
||||||
<td className="border p-2">{msg.i}</td>
|
<td className="border p-2">{msg.v}</td>
|
||||||
<td className="border p-2">{msg.m}</td>
|
</tr>
|
||||||
<td className="border p-2">{msg.v}</td> {/* NEU */}
|
))}
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{messages.length === 0 && (
|
{messages.length === 0 && (
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.506",
|
"version": "1.6.507",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.506",
|
"version": "1.6.507",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.1.0",
|
"@fontsource/roboto": "^5.1.0",
|
||||||
"@iconify-icons/ri": "^1.2.10",
|
"@iconify-icons/ri": "^1.2.10",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.506",
|
"version": "1.6.507",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
Reference in New Issue
Block a user