-
Notifications
You must be signed in to change notification settings - Fork 73
feat(web): adapt to HTTP API of DASD operations #1549
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
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
9e8cc77
start with new web API for DASD
jreidinger daf6124
[WIP] Try to add a supported check to DASD API
teclator e05a7cc
try to have working dasd#supported
jreidinger 5e246d1
Replaced DASD is supported check
teclator c772472
[WIP] Start adapting DASDPage
teclator 7e4b34d
Temporal fix for showing dasds
teclator d866bd8
adapt ids
jreidinger 8788502
Merge branch 'http-dasd' into web-dasd
teclator 08edd00
Start moving DASD pages to Typescript
teclator e796206
add dasd probe
jreidinger 2b40f73
add more api and queries for dasd
jreidinger 455fa66
add format api call
jreidinger fa7ac90
fix sort types
jreidinger b2d7f6c
add backspace icon
jreidinger 6251f72
Move DASD actions to queries
teclator 6e8e581
add jobs api
jreidinger d4be0c8
Merge remote-tracking branch 'origin/http-dasd' into web-dasd
jreidinger fc3497f
Moved DASD filters to queries
teclator 41251bf
Move DASD selection to queries
teclator b7ab21c
Merge remote-tracking branch 'origin/http-dasd' into web-dasd
jreidinger 897bbf4
first attempt to implement proper format with storage jobs
jreidinger fc8f79c
optimize dasd devices query to not use invalidate
jreidinger f7530fd
Merge branch 'http-dasd' into web-dasd
teclator 87e4e13
Fix jobs url
teclator fa3eae7
Getting rid of the DASD initial state
teclator e2da06a
Use the DASD id for notifing format job changes
teclator 8991d01
Small fixes for the DASD Format progress dialog
teclator d67205d
Fix jobs summary test
teclator d7033e5
Merge remote-tracking branch 'origin/master' into web-dasd
jreidinger 94f92fa
add non-working test for component with mutating queries
jreidinger 23405eb
add test for dasd format progress together with fix it reveals
jreidinger 5dba41c
transform DASDFormatProgress component to typescript
jreidinger 40baceb
Update web/src/api/dasd.ts
jreidinger 4e8e129
Removing dasd client
teclator eeba75f
Removing leftovers
teclator ad92d01
use connsistent name in API
jreidinger 6b97d1d
Remove not needed code from DASD Page
teclator c13bfbf
Merge branch 'master' into web-dasd
teclator debcfb7
Merge remote-tracking branch 'origin/web-dasd' into dasd_failing_test
jreidinger 1a3d485
fix dasd table test
jreidinger a6cb882
Improve DASDFormat progress dialog
teclator df7ca94
Notify id in Jobs events
teclator 7ddbba5
Handle JobAdded event
teclator f585806
Remove running jobs when finish
teclator b028a3b
Fix DASDFormatProgress unit test
teclator 9fd4544
Removed leftover Deviceinfo
teclator dbdf722
Changes based on CR
teclator 8bbf57b
Changes based on code review
teclator 918a5e3
Use mutations instead of API direct calls
teclator 4405715
More changes based on code review
teclator 6d140be
Replace dasd filter queries by component state
teclator 8fc01b9
Replace dasd selection queries by component state
teclator 50e76ad
Do not set any info about formatting.
teclator a75354f
Added DASD route only if supported
teclator 669f102
Removed selected DASD leftover queries
teclator 76d295b
Use only one mutation for modifying DASD state
teclator a705ac6
Do not modify existent cache but return new object
teclator d0bf495
Another inmutability fix
teclator 3c9c319
Merge branch 'master' into web-dasd
teclator 1c9dfdd
Added changelog
teclator 9b96a93
Apply suggestions from CR
teclator e896085
Redirect to storage page in case DASD is not supported
teclator 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| /* | ||
| * Copyright (c) [2024] SUSE LLC | ||
| * | ||
| * All Rights Reserved. | ||
| * | ||
| * This program is free software; you can redistribute it and/or modify it | ||
| * under the terms of version 2 of the GNU General Public License as published | ||
| * by the Free Software Foundation. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| * more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License along | ||
| * with this program; if not, contact SUSE LLC. | ||
| * | ||
| * To contact SUSE LLC about this file by physical or electronic mail, you may | ||
| * find current contact information at www.suse.com. | ||
| */ | ||
|
|
||
| import { post, get, put } from "~/api/http"; | ||
| import { DASDDevice } from "~/types/dasd"; | ||
|
|
||
| /** | ||
| * Returns the list of DASD devices | ||
| */ | ||
| const fetchDASDDevices = (): Promise<DASDDevice[]> => get("/api/storage/dasd/devices"); | ||
|
|
||
| /** | ||
| * Returns if DASD is supported at all | ||
| */ | ||
| const DASDSupported = (): Promise<boolean> => get("/api/storage/dasd/supported"); | ||
|
|
||
| /** | ||
| * probes DASD devices | ||
| */ | ||
| const probeDASD = () => post("/api/storage/dasd/probe"); | ||
|
|
||
| /** | ||
| * Start format job for given list of DASD devices | ||
| * @param devicesIDs - array of DASD device ids | ||
| * @return id of format job | ||
| */ | ||
| const formatDASD = (devicesIDs: string[]): Promise<string> => | ||
| post("/api/storage/dasd/format", { devices: devicesIDs }).then(({ data }) => data); | ||
|
|
||
| /** | ||
| * Enable given list of DASD devices | ||
| * | ||
| * @param devicesIDs - array of DASD device ids | ||
| */ | ||
| const enableDASD = (devicesIDs: string[]) => | ||
| post("/api/storage/dasd/enable", { devices: devicesIDs }); | ||
|
|
||
| /** | ||
| * Disable given list of DASD devices | ||
| * | ||
| * @param devicesIDs - array of DASD device ids | ||
| */ | ||
| const disableDASD = (devicesIDs: string[]) => | ||
| post("/api/storage/dasd/disable", { devices: devicesIDs }); | ||
|
|
||
| /** | ||
| * Enables diag on given list of DASD devices | ||
| * | ||
| * @param devicesIDs - array of DASD device ids | ||
| */ | ||
| const enableDiag = (devicesIDs: string[]) => | ||
| put("/api/storage/dasd/diag", { devices: devicesIDs, diag: true }); | ||
|
|
||
| /** | ||
| * Disables diag on given list of DASD devices | ||
| * | ||
| * @param devicesIDs - array of DASD device ids | ||
| */ | ||
| const disableDiag = (devicesIDs: string[]) => | ||
| put("/api/storage/dasd/diag", { devices: devicesIDs, diag: false }); | ||
|
|
||
| export { | ||
| fetchDASDDevices, | ||
| DASDSupported, | ||
| formatDASD, | ||
| probeDASD, | ||
| enableDASD, | ||
| disableDASD, | ||
| enableDiag, | ||
| disableDiag, | ||
| }; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Copyright (c) [2024] SUSE LLC | ||
| * | ||
| * All Rights Reserved. | ||
| * | ||
| * This program is free software; you can redistribute it and/or modify it | ||
| * under the terms of version 2 of the GNU General Public License as published | ||
| * by the Free Software Foundation. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| * more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License along | ||
| * with this program; if not, contact SUSE LLC. | ||
| * | ||
| * To contact SUSE LLC about this file by physical or electronic mail, you may | ||
| * find current contact information at www.suse.com. | ||
| */ | ||
|
|
||
| import { get } from "~/api/http"; | ||
| import { Job } from "~/types/job"; | ||
|
|
||
| /** | ||
| * Returns the list of jobs | ||
| */ | ||
| const fetchStorageJobs = (): Promise<Job[]> => get("/api/storage/jobs"); | ||
|
|
||
| /** | ||
| * Returns the job with given id or undefined | ||
| */ | ||
| const findStorageJob = (id: string): Promise<Job | undefined> => | ||
| fetchStorageJobs().then((jobs: Job[]) => jobs.find((value) => value.id === id)); | ||
|
|
||
| export { fetchStorageJobs, findStorageJob }; |
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.