Skip to content

Commit

Permalink
Include gh fast farmer client
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbrucker committed Feb 14, 2024
1 parent c806f80 commit f6a1ba9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
22 changes: 20 additions & 2 deletions src/app/clients/clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ export const fastFarmerClient: Client<string> = {
outdated: '0.0.0',
},
}
export const gigahorseFastFarmerClient: Client<string> = {
displayName: 'GH Fast Farmer',
versionInfoMatching: {
name: 'gh_fast_farmer',
localNames: [],
},
versions: {
minimum: '1.0.1',
recommendedMinimum: '1.0.1',
current: '1.0.1',
recent: '1.0.0',
outdated: '0.0.0',
},
}
export const liteFarmerClient: Client<string> = {
displayName: 'Lite Farmer',
versionInfoMatching: {
Expand Down Expand Up @@ -172,7 +186,9 @@ export function getClientForClientVersion(clientVersion: VersionInfo): Client<un
const localNames = [clientVersion.localName1, clientVersion.localName2, clientVersion.localName3]
if (clientVersion.clientName === fastFarmerClient.versionInfoMatching.name) {
return fastFarmerClient
} else if (clientVersion.clientName === liteFarmerClient.versionInfoMatching.name) {
} else if (clientVersion.clientName === gigahorseFastFarmerClient.versionInfoMatching.name) {
return gigahorseFastFarmerClient
} if (clientVersion.clientName === liteFarmerClient.versionInfoMatching.name) {
return liteFarmerClient
} else if (foxyFarmerClientWithDR.versionInfoMatching.localNames.every(localName => localNames.some(curr => curr === localName))) {
return foxyFarmerClientWithDR
Expand All @@ -196,7 +212,9 @@ export function getClientForClientVersion(clientVersion: VersionInfo): Client<un
export function getGroupedClientForClientVersion(clientVersion: VersionInfo): Client<unknown>|undefined {
if (clientVersion.clientName === fastFarmerClient.versionInfoMatching.name) {
return fastFarmerClient
} else if (clientVersion.clientName === liteFarmerClient.versionInfoMatching.name) {
} else if (clientVersion.clientName === gigahorseFastFarmerClient.versionInfoMatching.name) {
return gigahorseFastFarmerClient
} if (clientVersion.clientName === liteFarmerClient.versionInfoMatching.name) {
return liteFarmerClient
} else if (clientVersion.clientName === chiaClient.versionInfoMatching.name) {
return chiaClient
Expand Down
7 changes: 7 additions & 0 deletions src/app/harvester-card/harvester-card.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ <h5>{{lastAcceptedPartialAt}}</h5>
[versionUpdateInfo]="fastFarmerVersionUpdateInfo"
></app-version-info>
</div>
<div class="col-6 col-sm-6 col-md-4 col-lg-3 col-xl col-xxl col-xxxl col-xxxxl col-xxxxxl p-1" *ngIf="hasGigahorseFastFarmerVersion">
<app-version-info
versionName="GH Fast Farmer Version"
[versionString]="gigahorseFastFarmerVersion"
[versionUpdateInfo]="gigahorseFastFarmerVersionUpdateInfo"
></app-version-info>
</div>
<div class="col-6 col-sm-6 col-md-4 col-lg-3 col-xl col-xxl col-xxxl col-xxxxl col-xxxxxl p-1" *ngIf="hasLiteFarmerVersion">
<app-version-info
versionName="Lite Farmer Version"
Expand Down
17 changes: 16 additions & 1 deletion src/app/harvester-card/harvester-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
getIntegerVersionUpdateInfo,
getSemverVersionUpdateInfo,
getVersionFromClientVersion,
gigahorseClient,
gigahorseClient, gigahorseFastFarmerClient,
liteFarmerClient,
VersionUpdateInfo
} from '../clients/clients'
Expand Down Expand Up @@ -634,6 +634,18 @@ export class HarvesterCardComponent implements OnInit, OnDestroy {
return this.fastFarmerVersion !== undefined
}

public get gigahorseFastFarmerVersionUpdateInfo(): VersionUpdateInfo {
return getSemverVersionUpdateInfo(gigahorseFastFarmerClient, this.gigahorseFastFarmerVersion)
}

public get gigahorseFastFarmerVersion(): string|undefined {
return getVersionFromClientVersion(gigahorseFastFarmerClient, this.harvester.versionInfo)
}

public get hasGigahorseFastFarmerVersion(): boolean {
return this.gigahorseFastFarmerVersion !== undefined
}

public get liteFarmerVersionUpdateInfo(): VersionUpdateInfo {
return getSemverVersionUpdateInfo(liteFarmerClient, this.liteFarmerVersion)
}
Expand Down Expand Up @@ -679,6 +691,9 @@ export class HarvesterCardComponent implements OnInit, OnDestroy {
if (this.hasFastFarmerVersion) {
count += 1
}
if (this.hasGigahorseFastFarmerVersion) {
count += 1
}
if (this.hasLiteFarmerVersion) {
count += 1
}
Expand Down

0 comments on commit f6a1ba9

Please sign in to comment.