Skip to content

Commit

Permalink
fix(dashboard): display date & time for recent tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
fal3n-4ngel committed Jan 27, 2025
1 parent e99e7a8 commit 00dddda
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 74 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release
on:
push:
tags:
- 'v*'
- "v*"
workflow_dispatch:

jobs:
Expand All @@ -14,7 +14,7 @@ jobs:
matrix:
platform: [macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}

env:
SKIP_PREFLIGHT_CHECK: true
NEXT_TELEMETRY_DISABLED: 1
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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
prerelease: false
9 changes: 7 additions & 2 deletions app/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ useEffect(() => {
(a, b) =>
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(),
)
.slice(0, 10);


setRecentTasks(tasksList);
};
Expand Down Expand Up @@ -930,9 +930,14 @@ useEffect(() => {
</Button>
)} */}
</div>
<span className="text-xs text-muted-foreground">
<div className="flex gap-2">
<span className="text-xs text-muted-foreground">
{new Date(task.createdAt).toLocaleTimeString()}
</span>
<span className="text-xs text-muted-foreground">
{new Date(task.createdAt).toLocaleDateString()}
</span>
</div>
</button>
))}
</div>
Expand Down
93 changes: 49 additions & 44 deletions app/components/LoadingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ export const LoadingPage: React.FC<LoadingPageProps> = ({
const latest = release.tag_name.replace(/[^0-9.]/g, "");

if (current < latest) {
setSystemErrors((prev) => [
...prev,
setSystemErrors([
{
type: "update",
severity: "warning",
Expand Down Expand Up @@ -164,26 +163,26 @@ export const LoadingPage: React.FC<LoadingPageProps> = ({
),
});
} 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: (
// <p className="text-sm text-muted-foreground">
// Start Docker Desktop from your applications menu
// </p>
// ),
// });
// }
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: (
<p className="text-sm text-muted-foreground">
Start Docker Desktop from your applications menu
</p>
),
});
}
}

return errors;
Expand Down Expand Up @@ -368,28 +367,34 @@ export const LoadingPage: React.FC<LoadingPageProps> = ({
</div>
</CardHeader>
<CardContent className="space-y-4">
{systemErrors.map((error, index) => (
<Alert
key={index}
variant={
error.severity === "critical" ? "destructive" : "default"
}
className="text-left"
>
<AlertTitle className="flex items-center gap-2">
{error.type === "update" ? (
<ArrowUpCircle className="h-4 w-4" />
) : (
<AlertCircle className="h-4 w-4" />
)}
{error.message}
</AlertTitle>
<AlertDescription className="mt-2 space-y-2">
<p className="text-sm">{error.details}</p>
{error.action}
</AlertDescription>
</Alert>
))}
{systemErrors
.filter(
(error, index, self) =>
self.findIndex((e) => e.message === error.message) ===
index,
)
.map((error, index) => (
<Alert
key={index}
variant={
error.severity === "critical" ? "destructive" : "default"
}
className="text-left"
>
<AlertTitle className="flex items-center gap-2">
{error.type === "update" ? (
<ArrowUpCircle className="h-4 w-4" />
) : (
<AlertCircle className="h-4 w-4" />
)}
{error.message}
</AlertTitle>
<AlertDescription className="mt-2 space-y-2">
<p className="text-sm">{error.details}</p>
{error.action}
</AlertDescription>
</Alert>
))}

{systemErrors.some(
(e) => e.type === "docker" || e.type === "python",
Expand Down
30 changes: 19 additions & 11 deletions app/components/NetworkPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ const NetworkTopology: React.FC = () => {
<Clock className="h-5 w-5 text-primary" />
<h3 className="text-sm font-medium">Average Latency</h3>
</div>
<div className="mt-2">
<p className="text-2xl font-bold">
<div className="mt-2 flex flex-col items-center justify-center">
<p className="text-center text-2xl font-bold">
{currentStats.averageLatency}s
</p>
<p className="text-sm text-muted-foreground">Response Time</p>
<p className="text-center text-sm text-muted-foreground">
Response Time
</p>
</div>
</CardContent>
</Card>
Expand All @@ -180,11 +182,13 @@ const NetworkTopology: React.FC = () => {
<CheckSquare className="h-5 w-5 text-primary" />
<h3 className="text-sm font-medium">Tasks Today</h3>
</div>
<div className="mt-2">
<p className="text-2xl font-bold">
<div className="mt-2 flex-col items-center justify-center">
<p className="text-center text-2xl font-bold">
{currentStats.totalTasksToday}
</p>
<p className="text-sm text-muted-foreground">Total Processed</p>
<p className="text-center text-sm text-muted-foreground">
Total Processed
</p>
</div>
</CardContent>
</Card>
Expand All @@ -195,9 +199,13 @@ const NetworkTopology: React.FC = () => {
<Zap className="h-5 w-5 text-primary" />
<h3 className="text-sm font-medium">Recent Tasks</h3>
</div>
<div className="mt-2">
<p className="text-2xl font-bold">{currentStats.tasksLastHour}</p>
<p className="text-sm text-muted-foreground">Last Hour</p>
<div className="mt-2 flex-col items-center justify-center">
<p className="text-center text-2xl font-bold">
{currentStats.tasksLastHour}
</p>
<p className="text-center text-sm text-muted-foreground">
Last Hour
</p>
</div>
</CardContent>
</Card>
Expand Down Expand Up @@ -268,13 +276,13 @@ const NetworkChat: React.FC<NetworkChatProps> = ({ userId, userName }) => {
}`}
>
<div
className={`max-w-[70%] rounded-lg p-3 ${
className={`max-w-[80%] rounded-lg p-3 ${
message.senderId === userId
? "bg-primary text-primary-foreground"
: "bg-muted"
}`}
>
<div className="mb-1 text-xs opacity-70">
<div className="mb-1 w-fit text-xs opacity-70">
{message.senderName.replaceAll("-", "@ ")}
</div>
<div>{message.content}</div>
Expand Down
2 changes: 1 addition & 1 deletion app/data/data.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const currentDASHVersion="1.8.9"
export const currentDASHVersion = "1.9.0";

0 comments on commit 00dddda

Please sign in to comment.