Repository navigation
feat(software): device lists sort and filter, type, installedBy and a real up-to-date status CU-17tkuw61fh5 #2909
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7808893
feat(software): CU-17tkuw61fh5 device lists sort and filter, type, in…
andrii-flamingo daab8f7
fix(software): CU-17tkuw61fh5 an organization without a name no longe…
andrii-flamingo 74fa57e
Merge branch 'main' into feat/software-lists-api
andrii-flamingo b73e34b
Merge branch 'main' into feat/software-lists-api
andrii-flamingo 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
10 changes: 10 additions & 0 deletions
10
...ib/src/main/java/com/openframe/api/dto/rmm/software/SoftwareVulnerabilityFilterInput.java
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,10 @@ | ||
| package com.openframe.api.dto.rmm.software; | ||
|
|
||
| import lombok.Data; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Data | ||
| public class SoftwareVulnerabilityFilterInput { | ||
| private List<SoftwareCveSeverity> severities; | ||
| } |
168 changes: 118 additions & 50 deletions
168
...pi-lib/src/main/java/com/openframe/api/service/rmm/software/SoftwareInventoryService.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
32 changes: 32 additions & 0 deletions
32
openframe-api-lib/src/main/java/com/openframe/api/util/SoftwareVersions.java
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,32 @@ | ||
| package com.openframe.api.util; | ||
|
|
||
| import lombok.experimental.UtilityClass; | ||
|
|
||
| import java.util.regex.Matcher; | ||
| import java.util.regex.Pattern; | ||
|
|
||
| @UtilityClass | ||
| public class SoftwareVersions { | ||
|
|
||
| private static final Pattern LEADING_DIGITS = Pattern.compile("^\\d{1,18}"); | ||
|
|
||
| // Numeric, segment-wise version order so "9.0" precedes "10.0" (plain String sort would not). | ||
| public static int compare(String a, String b) { | ||
| String[] pa = a.split("\\."); | ||
| String[] pb = b.split("\\."); | ||
| for (int i = 0; i < Math.max(pa.length, pb.length); i++) { | ||
| long va = i < pa.length ? parseSegment(pa[i]) : 0; | ||
| long vb = i < pb.length ? parseSegment(pb[i]) : 0; | ||
| if (va != vb) { | ||
| return Long.compare(va, vb); | ||
| } | ||
| } | ||
| return a.compareTo(b); | ||
| } | ||
|
andrii-flamingo marked this conversation as resolved.
Resolved
|
||
|
|
||
| // the leading number of a segment, so "3-beta" and "0_2" still count as 3 and 0 | ||
| private static long parseSegment(String segment) { | ||
| Matcher digits = LEADING_DIGITS.matcher(segment.trim()); | ||
| return digits.find() ? Long.parseLong(digits.group()) : 0; | ||
| } | ||
| } | ||
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.
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.