8000 Update gitignore, simplify layout, fix refresh button UI, unify headlines/margins, improve modal responsiveness and theme color selection by ciruz · Pull Request #834 · bitaxeorg/ESP-Miner · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update gitignore, simplify layout, fix refresh button UI, unify headlines/margins, improve modal responsiveness and theme color selection #834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 22, 2025
Merged
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ components/components/*
config.bin
config.cvs
managed_components/*

# System files
.DS_Store
Thumbs.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.theme-color{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}

.color-dot {
position: relative;

.selected-icon {
color: white;
font-size: 1rem;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
pointer-events: none;
}
}
< 10000 td id="diff-dab06d9933210a2771ffa2f4958da5d7b9ca7c5ada67befe18dcb2f21b6aa609L232" data-line-number="232" class="blob-num blob-num-context js-linkable-line-number">
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,28 @@ interface ThemeOption {
</div>
</div>

<div class="col-12">
<div class="col-12 mt-4">
<h6>Theme Colors</h6>
<div class="grid gap-2">
<div *ngFor="let theme of themes" class="col-2">
<div *ngFor="let theme of themes" class="col-2 theme-color">
<button pButton [class]="'p-button-rounded p-button-text color-dot'"
[style.backgroundColor]="theme.primaryColor"
style="width: 2rem; height: 2rem; border: none;"
(click)="changeTheme(theme)">
<i *ngIf="theme.primaryColor === currentColor" class="pi pi-check selected-icon"></i>
</button>
<div class="text-sm mt-1">{{theme.name}}</div>
</div>
</div>
</div>
</div>
</div>
`
`,
styleUrls: ['./design-component.scss']
})
export class ThemeConfigComponent implements OnInit {
selectedScheme: string;
currentColor: string = '';
themes: ThemeOption[] = [
{
name: 'Orange',
Expand Down Expand Up @@ -227,6 +230,7 @@ export class ThemeConfigComponent implements OnInit {
settings => {
if (settings && settings.accentColors) {
this.applyThemeColors(settings.accentColors);
this.currentColor = settings.accentColors['--primary-color'];
}
},
error => console.error('Error loading theme settings:', error)
Expand All @@ -249,6 +253,7 @@ export class ThemeConfigComponent implements OnInit {
changeTheme(theme: ThemeOption) {
// Update CSS variables
this.applyThemeColors(theme.accentColors);
this.currentColor = theme.primaryColor;
// Save theme settings to NVS
this.themeService.saveThemeSettings({
colorScheme: this.selectedScheme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ <h4>Loading...</h4>
</p-message>

<div class="grid" *ngIf="info$ | async as info; else loading">
<div class="col-12">
<div class="grid">
<div class="col-12 md:col-6 xl:col-3">
<div class="card mb-0">
<div class="flex justify-content-between mb-3">
Expand Down Expand Up @@ -114,9 +112,7 @@ <h4>Loading...</h4>
</div>
</div>

</div>
</div>
<div class="col-12 mb-4" *ngIf="!info.power_fault">
<div class="col-12" *ngIf="!info.power_fault">
<div class="card">
<p-chart [data]="chartData" [options]="chartOptions"></p-chart>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="grid">
<div class="col-12 lg:col-6">
<div class="card">
<h5>Overview</h5>
<h2>Overview</h2>
<table *ngIf="info$ | async as info">
<tr>
<td>Model:</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="grid">
<div class="col-12">
<div class="card">
<h5>Pool Configuration</h5>
<h2>Pool Configuration</h2>
<form [formGroup]="form" *ngIf="form != null">
<div class="field grid p-fluid">
<label htmlFor="stratumURL" class="col-12 mb-2 md:col-2 md:mb-0">Stratum Host:</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ <h2>Settings</h2>
</div>

<div class="grid">
<div class="col-12 lg:col-6 xl:col-4">
<div class="col-12 xl:col-4">
<div class="card" *ngIf="checkLatestRelease == false">
<h5>Current Version: {{(info$ | async)?.version}}</h5>
<h2>Latest Release: <p-button (onClick)="checkLatestRelease = true">Check</p-button></h2>
<small>Clicking this button will connect to GitHub to check for recent updates</small>
</div>
<div class="card" *ngIf="checkLatestRelease == true">
<div class="card h-full" *ngIf="checkLatestRelease == true">
<ng-container *ngIf="latestRelease$ | async as latestRelease">
<h5>Current Version: {{(info$ | async)?.version}}</h5>
<h2>Latest Release: {{latestRelease.name}}</h2>
Expand All @@ -28,8 +28,8 @@ <h2>Latest Release: {{latestRelease.name}}</h2>
</ng-container>
</div>
</div>
<div class="col-12 lg:col-12 xl:col-4">
<div class="card">
<div class="col-12 lg:col-6 xl:col-4">
<div class="card h-full">
<h2>Update Website <span *ngIf="websiteUpdateProgress != null">{{websiteUpdateProgress}}%</span></h2>

<p-fileUpload #websiteUpload [customUpload]="true" mode="basic" accept=".bin" (uploadHandler)="otaWWWUpdate($event)"
Expand All @@ -39,7 +39,7 @@ <h2>Update Website <span *ngIf="websiteUpdateProgress != null">{{websiteUpdatePr
</div>
</div>
<div class="col-12 lg:col-6 xl:col-4">
<div class="card">
<div class="card h-full">
<h2>Update Firmware <span *ngIf="firmwareUpdateProgress != null">{{firmwareUpdateProgress}}%</span></h2>
<!-- <input type="file" id="file" (change)="otaUpdate($event)" accept=".bin"> -->
<p-fileUpload #firmwareUpload [customUpload]="true" mode="basic" accept=".bin" (uploadHandler)="otaUpdate($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
<div class="flex flex-column sm:flex-row gap-4 justify-content-between">
<div class="flex gap-1 sm:gap-3 text-sm md:text-base">
<button pButton (click)="scanNetwork()" [disabled]="scanning">{{scanning ? 'Scanning...' : 'Automatic Scan'}}</button>
<button pButton severity="secondary" (click)="refreshList()" [disabled]="scanning || isRefreshing">
{{isRefreshing ? 'Refreshing...' : 'Refresh List (' + refreshIntervalTime + ')'}}
<button pButton severity="secondary" (click)="refreshList()" [disabled]="scanning || isRefreshing" class="refresh-button">
<span aria-hidden="true">Refresh List (30)</span>
<span>{{ isRefreshing ? 'Refreshing...' : 'Refresh List (' + refreshIntervalTime + ')' }}</span>
</button>
</div>
<div class="flex align-items-center gap-2">
Expand Down Expand Up @@ -49,7 +50,7 @@
<table cellspacing="0" cellpadding="0" class="text-sm md:text-base">
<tr>
<th>
<div class="flex items-center cursor-pointer select-none h-full" (click)="sortBy('IP')">
<div class="flex align-items-center cursor-pointer select-none h-full" (click)="sortBy('IP')">
<span class="flex-1">IP</span>
<i class="pi text-xs flex items-center" [ngClass]="{
'pi-sort-alt': sortField !== 'IP',
Expand All @@ -59,7 +60,7 @@
</div>
</th>
<th>
<div class="flex items-center cursor-pointer select-none h-full" (click)="sortBy('hostname')">
<div class="flex align-items-center cursor-pointer select-none h-full" (click)="sortBy('hostname')">
<span class="flex-1">Hostname</span>
<i class="pi text-xs flex items-center" [ngClass]="{
'pi-sort-alt': sortField !== 'hostname',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ th {
text-align: left;
background-color: #1f2d40;
padding: 0;

> div {
height: 100%;
padding: 0.5rem 1rem;
gap: 0.75rem;
}

.pi {
opacity: 0.7;
height: 1em;
line-height: 1;

&.pi-sort-amount-up-alt,
&.pi-sort-amount-down {
opacity: 1;
Expand All @@ -36,7 +36,7 @@ td {
}

th > div {
min-width: 100px;
min-width: 100px;
padding-right: 0.5rem;
}

Expand All @@ -56,16 +56,28 @@ a {

.modal {
position: fixed;
max-height: 70vh;
width: 50vw;
max-height: 80dvh;
width: 90dvw;
z-index: 999;
top: 0;
left: 0;
margin: 12vh 25vw;
padding: 50px;
top: 10vh;
left: 50%;
transform: translateX(-50%);
padding: 2rem;
overflow-y: auto;
}

@media (min-width: 768px) {
.modal {
width: 70dvw;
}
}

@media (min-width: 1024px) {
.modal {
width: 50dvw;
}
}

.close {
position: absolute;
right: 20px;
Expand All @@ -77,11 +89,11 @@ a {
width: 100%;
overflow-x: auto;
margin: 0;

table {
min-width: 100%;
white-space: nowrap;

th, td {
padding: 0.75rem;
text-align: left;
Expand All @@ -91,4 +103,18 @@ a {
}
}
}
}
}

.refresh-button {
display: grid;
place-items: center;

> span:first-child {
visibility: hidden;
grid-area: 1 / 1;
}

> span:last-child {
grid-area: 1 / 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
padding: 7rem 2rem 2rem 4rem;
transition: margin-left $transitionDuration;

@media (max-width: 991px) {
padding: 7rem 2rem 2rem 2rem;
}

@media (max-width: 768px) {
padding: 7rem 1rem 1rem 1rem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
background: var(--surface-card);
border: 1px solid var(--surface-border);
padding: 2rem;
margin-bottom: 2rem;
margin-bottom: 1rem;
box-shadow: var(--card-shadow);
border-radius: $borderRadius;

Expand All @@ -17,4 +17,4 @@
&.p-toast-top-center {
top: 100px;
}
}
}
Loading
0