From 00dddda8a090503d83c5cc718be3a9c453197d04 Mon Sep 17 00:00:00 2001 From: fal3n-4ngel Date: Mon, 27 Jan 2025 16:41:50 +0530 Subject: [PATCH] fix(dashboard): display date & time for recent tasks --- .github/workflows/release.yml | 31 ++++++----- app/components/Dashboard.tsx | 9 +++- app/components/LoadingPage.tsx | 93 +++++++++++++++++---------------- app/components/NetworkPanel.tsx | 30 +++++++---- app/data/data.ts | 2 +- 5 files changed, 91 insertions(+), 74 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92a3826..700c682 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release on: push: tags: - - 'v*' + - "v*" workflow_dispatch: jobs: @@ -14,7 +14,7 @@ jobs: matrix: platform: [macos-latest, windows-latest] runs-on: ${{ matrix.platform }} - + env: SKIP_PREFLIGHT_CHECK: true NEXT_TELEMETRY_DISABLED: 1 @@ -45,13 +45,13 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: '18' - cache: 'npm' + node-version: "18" + cache: "npm" - name: Setup Python uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: "3.x" - name: Install frontend dependencies run: | @@ -86,45 +86,44 @@ jobs: NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }} NEXT_PUBLIC_FIREBASE_DATABASE_URL: ${{ secrets.NEXT_PUBLIC_FIREBASE_DATABASE_URL }} - with: tagName: ${{ github.ref_name }} - releaseName: 'Dash Desktop ${{ github.ref_name }}' + releaseName: "Dash Desktop ${{ github.ref_name }}" releaseBody: | ## Dash Desktop ${{ github.ref_name }} - + 🚀 Latest Release - + ### Features - Cross-platform desktop application - Real-time Firebase integration - Task management system - Network node status monitoring - + ### Download Options Choose the appropriate version for your operating system: - Windows: `.msi` installer - macOS: `.dmg` installer - Linux: `.deb` package and `.AppImage` - + ### System Requirements - Windows 10 or later - macOS 10.15 or later - Arch Linux (latest updates) - + ### Installation 1. Download the appropriate file for your OS 2. Run the installer 3. Follow the on-screen instructions - + ### Known Issues - Please report any issues on the GitHub repository - + ### Support If you encounter any problems, please open an issue on GitHub. - + --- 🔄 Release Date: ${{ github.event.release.published_at }} 👤 Build Triggered By: ${{ github.actor }} releaseDraft: false - prerelease: false \ No newline at end of file + prerelease: false diff --git a/app/components/Dashboard.tsx b/app/components/Dashboard.tsx index 5ed8480..a4c2743 100644 --- a/app/components/Dashboard.tsx +++ b/app/components/Dashboard.tsx @@ -378,7 +378,7 @@ useEffect(() => { (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(), ) - .slice(0, 10); + setRecentTasks(tasksList); }; @@ -930,9 +930,14 @@ useEffect(() => { )} */} - +
+ {new Date(task.createdAt).toLocaleTimeString()} + + {new Date(task.createdAt).toLocaleDateString()} + +
))} diff --git a/app/components/LoadingPage.tsx b/app/components/LoadingPage.tsx index 762347f..604d182 100644 --- a/app/components/LoadingPage.tsx +++ b/app/components/LoadingPage.tsx @@ -88,8 +88,7 @@ export const LoadingPage: React.FC = ({ const latest = release.tag_name.replace(/[^0-9.]/g, ""); if (current < latest) { - setSystemErrors((prev) => [ - ...prev, + setSystemErrors([ { type: "update", severity: "warning", @@ -164,26 +163,26 @@ export const LoadingPage: React.FC = ({ ), }); } else { - // try { - // await invoke("run_docker_hub_image", { - // image: "hello-world", - // memory_limit: "128m", - // }); - // } catch (error) { - // console.log("Docker Desktop error:", error); - // errors.push({ - // type: "docker", - // severity: "critical", - // message: "Docker Desktop is not running", - // details: - // "Docker Desktop is installed but not running. Please start Docker Desktop and try again.", - // action: ( - //

- // Start Docker Desktop from your applications menu - //

- // ), - // }); - // } + try { + await invoke("run_docker_hub_image", { + image: "hello-world", + memory_limit: "128m", + }); + } catch (error) { + console.log("Docker Desktop error:", error); + errors.push({ + type: "docker", + severity: "critical", + message: "Docker Desktop is not running", + details: + "Docker Desktop is installed but not running. Please start Docker Desktop and try again.", + action: ( +

+ Start Docker Desktop from your applications menu +

+ ), + }); + } } return errors; @@ -368,28 +367,34 @@ export const LoadingPage: React.FC = ({ - {systemErrors.map((error, index) => ( - - - {error.type === "update" ? ( - - ) : ( - - )} - {error.message} - - -

{error.details}

- {error.action} -
-
- ))} + {systemErrors + .filter( + (error, index, self) => + self.findIndex((e) => e.message === error.message) === + index, + ) + .map((error, index) => ( + + + {error.type === "update" ? ( + + ) : ( + + )} + {error.message} + + +

{error.details}

+ {error.action} +
+
+ ))} {systemErrors.some( (e) => e.type === "docker" || e.type === "python", diff --git a/app/components/NetworkPanel.tsx b/app/components/NetworkPanel.tsx index 46d0c98..7a87109 100644 --- a/app/components/NetworkPanel.tsx +++ b/app/components/NetworkPanel.tsx @@ -165,11 +165,13 @@ const NetworkTopology: React.FC = () => {

Average Latency

-
-

+

+

{currentStats.averageLatency}s

-

Response Time

+

+ Response Time +

@@ -180,11 +182,13 @@ const NetworkTopology: React.FC = () => {

Tasks Today

-
-

+

+

{currentStats.totalTasksToday}

-

Total Processed

+

+ Total Processed +

@@ -195,9 +199,13 @@ const NetworkTopology: React.FC = () => {

Recent Tasks

-
-

{currentStats.tasksLastHour}

-

Last Hour

+
+

+ {currentStats.tasksLastHour} +

+

+ Last Hour +

@@ -268,13 +276,13 @@ const NetworkChat: React.FC = ({ userId, userName }) => { }`} >
-
+
{message.senderName.replaceAll("-", "@ ")}
{message.content}
diff --git a/app/data/data.ts b/app/data/data.ts index d703e60..ac38f64 100644 --- a/app/data/data.ts +++ b/app/data/data.ts @@ -1 +1 @@ -export const currentDASHVersion="1.8.9" \ No newline at end of file +export const currentDASHVersion = "1.9.0";