diff --git a/docs/docs.go b/docs/docs.go
index 4d363d1..d029d62 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -66,7 +66,7 @@ const docTemplate = `{
},
"/miners": {
"get": {
- "description": "Get a list of all running miners",
+ "description": "Get a list of all running miners, including their full stats.",
"produces": [
"application/json"
],
@@ -79,9 +79,7 @@ const docTemplate = `{
"description": "OK",
"schema": {
"type": "array",
- "items": {
- "$ref": "#/definitions/mining.XMRigMiner"
- }
+ "items": {}
}
}
}
diff --git a/docs/swagger.json b/docs/swagger.json
index 157348b..9c25a5c 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -60,7 +60,7 @@
},
"/miners": {
"get": {
- "description": "Get a list of all running miners",
+ "description": "Get a list of all running miners, including their full stats.",
"produces": [
"application/json"
],
@@ -73,9 +73,7 @@
"description": "OK",
"schema": {
"type": "array",
- "items": {
- "$ref": "#/definitions/mining.XMRigMiner"
- }
+ "items": {}
}
}
}
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index c734675..70593ba 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -318,15 +318,14 @@ paths:
- system
/miners:
get:
- description: Get a list of all running miners
+ description: Get a list of all running miners, including their full stats.
produces:
- application/json
responses:
"200":
description: OK
schema:
- items:
- $ref: '#/definitions/mining.XMRigMiner'
+ items: {}
type: array
summary: List all running miners
tags:
diff --git a/ui/src/app/dashboard.component.css b/ui/src/app/dashboard.component.css
index 76a0616..eafdf67 100644
--- a/ui/src/app/dashboard.component.css
+++ b/ui/src/app/dashboard.component.css
@@ -1,74 +1,56 @@
-.admin-panel {
- padding: 1rem;
+/* Set up the container */
+.dashboard-view {
+ container-type: inline-size;
+ container-name: dashboard;
+ height: 100%;
+ display: flex; /* Ensure it fills height */
+ flex-direction: column;
}
-.admin-title {
- margin-top: 0;
-}
-
-.miner-list, .path-list {
- margin-bottom: 1.5rem;
-}
-
-.miner-item, .path-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0.5rem;
- border: 1px solid #ccc;
- border-radius: 4px;
- margin-bottom: 0.5rem;
-}
-
-.path-list ul {
- list-style-type: none;
- padding: 0;
-}
-
-.path-list li {
- background-color: #f5f5f5;
- padding: 0.5rem;
- border-radius: 4px;
- margin-bottom: 0.5rem;
- font-family: monospace;
-}
-
-.dashboard-summary {
- padding: 1rem;
-}
-
-.miner-summary-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 1rem;
-}
-
-.miner-name {
- font-weight: bold;
-}
-
-.start-buttons {
- display: flex;
- gap: 0.5rem;
-}
-
-.start-options {
- padding: 1rem;
- border: 1px solid #ccc;
- border-radius: 4px;
- margin-top: 0.5rem;
+.dashboard-content {
display: flex;
flex-direction: column;
- gap: 1rem;
+ height: 100%;
+ flex-grow: 1; /* Allow content to grow */
}
-.dashboard-charts {
- padding: 1rem;
+/* Default (mobile/narrow) layout */
+.stats-list-container {
+ display: none; /* Hide the detailed list by default */
}
-.miner-chart-item {
- margin-bottom: 1.5rem;
+.stats-bar-container {
+ display: block; /* Show the bar by default */
+}
+
+.chart-container {
+ flex-grow: 1;
+ min-height: 200px; /* Ensure chart has a minimum height */
+}
+
+/* Wide layout using container queries */
+@container dashboard (min-width: 768px) {
+ .dashboard-content {
+ display: grid;
+ grid-template-columns: 2fr 1fr; /* 2/3 for chart, 1/3 for stats */
+ gap: 1.5rem;
+ align-items: stretch; /* Stretch items to fill height */
+ }
+
+ .stats-bar-container {
+ display: none; /* Hide the bar in wide view */
+ }
+
+ .stats-list-container {
+ display: block; /* Show the detailed list in wide view */
+ grid-column: 2;
+ grid-row: 1;
+ }
+
+ .chart-container {
+ grid-column: 1;
+ grid-row: 1;
+ }
}
.centered-container {
@@ -78,10 +60,7 @@
justify-content: center;
padding: 2rem;
text-align: center;
-}
-
-.button-spinner {
- font-size: 1rem;
+ height: 100%;
}
.card-error {
diff --git a/ui/src/app/dashboard.component.html b/ui/src/app/dashboard.component.html
index 052948d..8e5b0dd 100644
--- a/ui/src/app/dashboard.component.html
+++ b/ui/src/app/dashboard.component.html
@@ -9,11 +9,22 @@
}
-
@if (state().runningMiners.length > 0) {
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
} @else {
diff --git a/ui/src/app/dashboard.component.ts b/ui/src/app/dashboard.component.ts
index bd5264e..3ad89f2 100644
--- a/ui/src/app/dashboard.component.ts
+++ b/ui/src/app/dashboard.component.ts
@@ -4,9 +4,6 @@ import { FormsModule } from '@angular/forms';
import { HttpErrorResponse } from '@angular/common/http';
import { MinerService } from './miner.service';
import { ChartComponent } from './chart.component';
-import { ProfileListComponent } from './profile-list.component';
-import { ProfileCreateComponent } from './profile-create.component';
-import { StatsBarComponent } from './stats-bar.component';
// Import Web Awesome components
import "@awesome.me/webawesome/dist/webawesome.js";
@@ -17,84 +14,18 @@ import '@awesome.me/webawesome/dist/components/icon/icon.js';
import '@awesome.me/webawesome/dist/components/spinner/spinner.js';
import '@awesome.me/webawesome/dist/components/input/input.js';
import '@awesome.me/webawesome/dist/components/select/select.js';
+import {StatsBarComponent} from './stats-bar.component';
@Component({
selector: 'snider-mining-dashboard',
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
- imports: [CommonModule, FormsModule, ChartComponent, ProfileListComponent, ProfileCreateComponent, StatsBarComponent],
+ imports: [CommonModule, FormsModule, ChartComponent, StatsBarComponent], // Add to imports
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.css']
})
export class MiningDashboardComponent {
minerService = inject(MinerService);
state = this.minerService.state;
-
- actionInProgress = signal
(null);
error = signal(null);
-
- showProfileManager = signal(false);
- // Use a map to track the selected profile for each miner type
- selectedProfileIds = signal