-
Notifications
You must be signed in to change notification settings - Fork 298
Change best(Session)Diff type from string to number #1202
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
WantClue
merged 14 commits into
bitaxeorg:master
from
duckaxe:bugfix/switch-bestdiff-type-to-number
Oct 21, 2025
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b6871ae
BestDiff: Changing the type from string to number
e174305
FUP
f56d222
Adapt AxeOS to the new best(Session)Diff type
0921ad9
Fix total bestDiff
2e8a86d
Merge branch 'master' into bugfix/switch-bestdiff-type-to-number
duckaxe afa58bf
Fallback: Numerize device best diffs
e9a3fc9
Merge branch 'master' into bugfix/switch-bestdiff-type-to-number
duckaxe b459ff6
Fix merge conflicts
2c2b3b9
Merge branch 'master' into bugfix/switch-bestdiff-type-to-number
duckaxe a67a535
Remove regex from parseSuffixString()
e55f536
Replace ISystemInfo by any
87a68d0
Merge branch 'master' into bugfix/switch-bestdiff-type-to-number
duckaxe 078ea5e
Merge branch 'master' into bugfix/switch-bestdiff-type-to-number
duckaxe cdceff5
Merge branch 'master' into bugfix/switch-bestdiff-type-to-number
duckaxe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
main/http_server/axe-os/src/app/pipes/diff-suffix.pipe.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { DiffSuffixPipe } from './diff-suffix.pipe'; | ||
|
|
||
| describe('DiffSuffixPipe', () => { | ||
| it('create an instance', () => { | ||
| const pipe = new DiffSuffixPipe(); | ||
| expect(pipe).toBeTruthy(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { Pipe, PipeTransform } from '@angular/core'; | ||
|
|
||
| @Pipe({ | ||
| name: 'diffSuffix', | ||
| pure: true | ||
| }) | ||
| export class DiffSuffixPipe implements PipeTransform { | ||
|
|
||
| private static _this = new DiffSuffixPipe(); | ||
|
|
||
| public static transform(value: number): string { | ||
| return this._this.transform(value); | ||
| } | ||
|
|
||
| public transform(value: number): string { | ||
| if (value == null || value < 0) { | ||
| return '0'; | ||
| } | ||
|
|
||
| const suffixes = ['', 'K', 'M', 'G', 'T', 'P', 'E']; | ||
|
|
||
| const power = Math.max(0, Math.floor(Math.log10(value) / 3)); | ||
| const scaledValue = value / Math.pow(1000, power); | ||
| const suffix = suffixes[power] ?? ''; | ||
| const space = suffix ? ' ' : ''; | ||
|
|
||
| if (power > 0) { | ||
| return scaledValue.toFixed(2) + space + suffix; | ||
| } else { | ||
| return scaledValue.toFixed(0) + space + suffix; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.