Skip to content

Commit

Permalink
Merge pull request #41 from shufps/fix-esp-miner-download-link
Browse files Browse the repository at this point in the history
fixed download link for esp-miner binaries
  • Loading branch information
shufps authored Nov 12, 2024
2 parents e6de121 + 4ada971 commit 2f2f45d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ <h2>Settings</h2>
<div class="grid">
<div class="col-12 lg:col-6 xl:col-4">
<div class="card" *ngIf="checkLatestRelease == false">
<h5>Current Version: {{(info$ | async)?.version}}</h5>
<h5>Current Version: {{(info$ | async)?.version}}</h5>
<h2>Latest Release: <p-button (onClick)="checkLatestRelease = true">Check</p-button></h2>
</div>
<div class="card" *ngIf="checkLatestRelease == true">
<ng-container *ngIf="latestRelease$ | async as latestRelease">
<h5>Current Version: {{(info$ | async)?.version}}</h5>
<h5>Current Version: {{(info$ | async)?.version}}</h5>
<h2>Latest Release: {{latestRelease.name}}</h2>

<div *ngFor="let asset of latestRelease.assets">
<div *ngIf="asset.name == 'esp-miner.bin'">
<div *ngIf="asset.name === expectedFileName">
<a style="text-decoration: underline;" target="_blank"
[href]="asset.browser_download_url">esp-miner.bin</a>
[href]="asset.browser_download_url">{{ expectedFileName }}</a>
</div>
<div *ngIf="asset.name == 'www.bin'">
<a style="text-decoration: underline;" target="_blank"
Expand All @@ -37,7 +37,7 @@ <h2>Update Firmware <span *ngIf="firmwareUpdateProgress != null">{{firmwareUpdat
<p-fileUpload [customUpload]="true" mode="basic" accept=".bin" (uploadHandler)="otaUpdate($event)"
[auto]="true" chooseLabel="Browse"></p-fileUpload>

<small>(esp-miner.bin)</small>
<small>({{ expectedFileName }})</small>
</div>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class SettingsComponent {

public checkLatestRelease: boolean = false;
public latestRelease$: Observable<any>;
public expectedFileName: string = "";

public info$: Observable<any>;

Expand Down Expand Up @@ -92,6 +93,8 @@ export class SettingsComponent {
this.form.controls['fanspeed'].enable();
}
});
// Replace 'γ' with 'Gamma' if present
this.expectedFileName = `esp-miner-${this.deviceModel}.bin`.replace('γ', 'Gamma');
});

}
Expand Down Expand Up @@ -146,11 +149,8 @@ export class SettingsComponent {
otaUpdate(event: FileUploadHandlerEvent) {
const file = event.files[0];

// Replace 'γ' with 'Gamma' if present
const expectedFileName = `esp-miner-${this.deviceModel}.bin`.replace('γ', 'Gamma');

if (file.name !== expectedFileName) {
this.toastrService.error(`Incorrect file, looking for ${expectedFileName}.`, 'Error');
if (file.name !== this.expectedFileName) {
this.toastrService.error(`Incorrect file, looking for ${this.expectedFileName}.`, 'Error');
return;
}

Expand Down

0 comments on commit 2f2f45d

Please sign in to comment.