Skip to content
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

Web UI: add server management pieces #762

Merged
merged 90 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
8c0c154
chore(striker-ui-api): install yup
ylei-tsubame Oct 10, 2024
91bd089
fix(striker-ui-api): add yup pre-schemas
ylei-tsubame Oct 11, 2024
fb00aa4
fix(striker-ui-api): add server rename endpoint
ylei-tsubame Oct 11, 2024
e5de7a8
fix(striker-ui-api): finish get server detail
ylei-tsubame Oct 11, 2024
37abdb4
chore(striker-ui-api): install fast-xml-parser
ylei-tsubame Oct 18, 2024
8464a51
fix(striker-ui-api): include libvirt domain xml info in server detail
ylei-tsubame Oct 23, 2024
b2664b0
fix(striker-ui-api): allow filter by job name
ylei-tsubame Oct 24, 2024
7f54859
fix(striker-ui): isolate data size select items in provision server
ylei-tsubame Oct 25, 2024
fa167a8
fix(striker-ui): consolidate row css in drag data grid
ylei-tsubame Oct 29, 2024
75c696d
fix(striker-ui-api): reshape server overview list
ylei-tsubame Oct 29, 2024
b8050b4
fix(striker-ui): align API /server response types
ylei-tsubame Oct 29, 2024
1fa8c9b
fix(striker-ui): adjust menu colours
ylei-tsubame Oct 29, 2024
d3dc4ba
fix(striker-ui): adjust autocomplete colours
ylei-tsubame Oct 29, 2024
5c80b72
fix(striker-ui): narrow server state value
ylei-tsubame Oct 29, 2024
b60fe6a
fix(striker-ui): make outlined labeled input with select work with un…
ylei-tsubame Oct 29, 2024
3a535ae
fix(striker-ui): adjust colours in select with label
ylei-tsubame Oct 29, 2024
963c171
fix(striker-ui): relocate panels' props
ylei-tsubame Oct 29, 2024
1eb209d
fix(striker-ui): expose panel props in preview
ylei-tsubame Oct 29, 2024
4d8a369
fix(striker-ui): hide outline in drag data grid cell on focus-within
ylei-tsubame Oct 29, 2024
802a61b
fix(striker-ui-api): include bridge list in server detail host
ylei-tsubame Oct 30, 2024
18554b2
fix(striker-ui-api): include available memory in anvil node memory
ylei-tsubame Oct 30, 2024
73c5ad3
fix(striker-ui): align to node memory response, add memory bar
ylei-tsubame Oct 30, 2024
2a828a8
feat(striker-ui): add manage server pieces WIP
ylei-tsubame Oct 30, 2024
63330f3
fix(striker-ui-api): ensure rows length in GET anvil node memory
ylei-tsubame Oct 30, 2024
bca21fa
fix(striker-ui-api): include state in server interfaces
ylei-tsubame Oct 30, 2024
fd6ef92
fix(striker-ui-api): restructure access instances
ylei-tsubame Oct 30, 2024
a5b7f3c
fix(striker-ui-api): include NIC model list in server detail
ylei-tsubame Oct 31, 2024
0f51d72
fix(striker-ui): correct server form submit disable condition
ylei-tsubame Oct 31, 2024
9285da4
fix(striker-ui): add lax mac pattern
ylei-tsubame Oct 31, 2024
9e588e4
fix(striker-ui): show cursor as pointer on hover row in select data grid
ylei-tsubame Oct 31, 2024
dab0125
fix(striker-ui): add server interface manage tab, form validations
ylei-tsubame Oct 31, 2024
cfb311a
fix(striker-ui): show error when field changed by user in formik utils
ylei-tsubame Oct 31, 2024
d23f4a9
fix(striker-ui): test memory sequentially in server memory
ylei-tsubame Oct 31, 2024
897a17b
fix(striker-ui-api): add responder class
ylei-tsubame Nov 1, 2024
571a7dd
fix(striker-ui-api): include variables in server detail
ylei-tsubame Nov 1, 2024
505ace2
fix(striker-ui-api): fill-in missing props in host detail
ylei-tsubame Nov 1, 2024
2d4dcaa
fix(striker-ui): isolate stay-off in server start dependency
ylei-tsubame Nov 1, 2024
22ceee6
fix(striker-ui): exclude self from server rename check
ylei-tsubame Nov 1, 2024
c04de0f
fix(striker-ui): show defaults in server add interface
ylei-tsubame Nov 1, 2024
b73abb6
fix(striker-ui): simplify server migration
ylei-tsubame Nov 1, 2024
e736589
fix(striker-ui): expose bar props in stack bar values
ylei-tsubame Nov 1, 2024
9aa28dd
fix(striker-ui): don't stack reserved in memory bar
ylei-tsubame Nov 1, 2024
0ae146d
fix(striker-ui): show server interface state
ylei-tsubame Nov 1, 2024
98c0ae4
fix(striker-ui): isolate file data converters, simplfy file list fetch
ylei-tsubame Nov 1, 2024
84f462f
fix(striker-ui-api): make build get request handler generic
ylei-tsubame Nov 1, 2024
a732604
fix(striker-ui-api): make hooks object required in build get request …
ylei-tsubame Nov 2, 2024
57342e7
fix(striker-ui-api): restructure /file/* response
ylei-tsubame Nov 2, 2024
6a63937
fix(striker-ui-api): respond with status 404 when body is undef in bu…
ylei-tsubame Nov 2, 2024
c63dbd7
fix(striker-ui-api): include anvil, file state in file overview, detail
ylei-tsubame Nov 2, 2024
ca00108
fix(striker-ui): align file response types, add file sync indicator
ylei-tsubame Nov 2, 2024
71ce6ea
fix(striker-ui-api): allow filter files by type, rename filter files …
ylei-tsubame Nov 2, 2024
5e73de9
fix(striker-ui-api): add paths in file detail
ylei-tsubame Nov 2, 2024
a7de045
fix(striker-ui-api): include opticals' mounted file's uuid in server …
ylei-tsubame Nov 2, 2024
d371e4b
fix(striker-ui-api): allow filter by multiple values in GET files
ylei-tsubame Nov 2, 2024
5b25fcf
fix(striker-ui): align server detail disk, file detail responses
ylei-tsubame Nov 2, 2024
89b5e51
fix(striker-ui): relabel server iface state for clarity
ylei-tsubame Nov 2, 2024
58af5c0
fix(striker-ui): add server disk list and change iso form
ylei-tsubame Nov 2, 2024
9d63ac8
fix(striker-ui): isolate data size validation
ylei-tsubame Nov 4, 2024
2412be9
fix(striker-ui-api): include disk size in server detail
ylei-tsubame Nov 5, 2024
dee6040
fix(striker-ui): simplify fetch+convert in anvil summary
ylei-tsubame Nov 5, 2024
4ca8a5b
fix(striker-ui): calculate used in shared storage overview
ylei-tsubame Nov 5, 2024
c942476
fix(striker-ui): add storage bar
ylei-tsubame Nov 5, 2024
c855d5d
fix(striker-ui): initial server add disk form
ylei-tsubame Nov 5, 2024
f78e497
fix(striker-ui): allow percent in server disk size
ylei-tsubame Nov 5, 2024
e8a67ad
fix(striker-ui): make server preview keep aspect ratio
ylei-tsubame Nov 5, 2024
0854130
fix(striker-ui-api): rm deleted IPs from network iface list
ylei-tsubame Nov 5, 2024
50a96dc
fix(striker-ui-api): simplify params in job data builder
ylei-tsubame Nov 6, 2024
ab730e4
fix(striker-ui-api): add yup lax mac schema
ylei-tsubame Nov 6, 2024
bffe40c
fix(striker-ui-api): add update server endpoints
ylei-tsubame Nov 6, 2024
a14ec9b
fix(share): add job title for update server jobs
ylei-tsubame Nov 6, 2024
200119b
fix(striker-ui): correct display in server migration
ylei-tsubame Nov 6, 2024
9b8b426
fix(striker-ui): correct types in form summary
ylei-tsubame Nov 6, 2024
a4abfac
fix(striker-ui): connect manage server actions, forms with API endpoints
ylei-tsubame Nov 7, 2024
c901637
fix(striker-ui): show response error when available
ylei-tsubame Nov 7, 2024
22d1c33
fix(striker-ui): show text when no options in select with label
ylei-tsubame Nov 7, 2024
a348ed9
fix(striker-ui): make delay as optional in server types
ylei-tsubame Nov 7, 2024
594b0ec
fix(striker-ui): allow submit with none as after in set server start dep
ylei-tsubame Nov 7, 2024
2c9975b
fix(striker-ui): include existing disk size in server grow disk form
ylei-tsubame Nov 7, 2024
fe14c52
fix(striker-ui): relocate eject in server change ISO
ylei-tsubame Nov 7, 2024
0992dd9
fix(striker-ui): add op messages to server rename, grow disk, disk list
ylei-tsubame Nov 8, 2024
63d5a54
fix(striker-ui-api): add job name, description keys in manage server …
ylei-tsubame Nov 8, 2024
8e9ddf8
fix(striker-ui-api): correct server data in build server update handler
ylei-tsubame Nov 8, 2024
bfa9cfd
fix(striker-ui-api): convert file uuid to path in server change ISO
ylei-tsubame Nov 8, 2024
4832247
fix(striker-ui): add placeholder to server change ISO input
ylei-tsubame Nov 8, 2024
d59a5ff
fix(striker-ui): change stay-off wording in server start dep confirm
ylei-tsubame Nov 8, 2024
18cf62d
fix(striker-ui): add server general info
ylei-tsubame Nov 8, 2024
c38abe3
build(striker-ui-api): rebuild
ylei-tsubame Nov 8, 2024
a8ab79c
fix(striker-ui): resolve type issues during build
ylei-tsubame Nov 8, 2024
719aec1
build(striker-ui): rebuild
ylei-tsubame Nov 8, 2024
963418c
Merge branch 'main' into issues/707-server-management
digimer Nov 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions share/words.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,36 @@ Note: This is a permanent action! If you protect this server again later, a full
[ Note ] - The host name was updated. The hostname is cached in several places, and it is important all are updated during the cluster config.
[ Note ] *** the system will now reboot. ***
[ Note ] - The job will restart on reboot (so long as 'anvil-daemon' is enabled).</key>
<!-- Job keys for tool anvil-manage-server -->
<key name="job_0489">Set server start dependency</key>
<key name="job_0490">Controls the order in which to start the server or prevents the server from starting.</key>
<!-- Job keys for tool anvil-manage-server-system -->
<key name="job_0491">Set server boot order</key>
<key name="job_0492">Controls the boot order of the server's possibly bootable devices.</key>
<key name="job_0493">Set server CPU</key>
<key name="job_0494">Controls the numerical CPU properties available to the server.</key>
<key name="job_0495">Set server memory</key>
<key name="job_0496">Controls the memory available for the server to use.</key>
<!-- Job keys for tool anvil-manage-server-storage -->
<key name="job_0497">Add server disk</key>
<key name="job_0498">Creates and attaches a new disk to the server by allocating space from a storage group.</key>
<key name="job_0499">Grow server disk</key>
<key name="job_0500">Extends the server's disk by allocating the specified remaining space from the storage group.</key>
<key name="job_0501">Change server ISO</key>
<key name="job_0502">Inserts or ejects ISO from the server's optical device.</key>
<!-- Job keys for tool anvil-manage-server-network -->
<key name="job_0503">Add server network interface</key>
<key name="job_0504">Creates and attaches a network interface to the server.</key>
<key name="job_0505">Plug or unplug server network interface</key>
<key name="job_0506">Changes the state (plugged-in or unplugged) of the server network interface.</key>
<key name="job_0507">Delete server network interface</key>
<key name="job_0508">Detaches and removes a network interface from the server.</key>
<!-- Job keys for tool anvil-rename-server -->
<key name="job_0509">Rename server</key>
<key name="job_0510">Changes the name of the server and its resources.</key>
<!-- Job keys for tool anvil-migrate-server -->
<key name="job_0511">Migrate server</key>
<key name="job_0512">Changes the host of the server.</key>

<!-- Log entries -->
<key name="log_0001">Starting: [#!variable!program!#].</key>
Expand Down
2 changes: 1 addition & 1 deletion striker-ui-api/out/index.js

Large diffs are not rendered by default.

113 changes: 112 additions & 1 deletion striker-ui-api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion striker-ui-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
"cors": "^2.8.5",
"express": "^4.21.1",
"express-session": "^1.18.1",
"fast-xml-parser": "^4.5.0",
"format-data-size": "^0.1.0",
"http-proxy-middleware": "^3.0.0-beta.1",
"passport": "^0.6.0",
"passport-local": "^1.0.0",
"regenerator-runtime": "^0.13.11"
"regenerator-runtime": "^0.13.11",
"yup": "^1.4.0"
},
"devDependencies": {
"@babel/core": "^7.17.8",
Expand Down
2 changes: 1 addition & 1 deletion striker-ui-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { perr, pout } from './lib/shell';
* the main bundle. Webpack defaults to put such modules in separate files to
* reduce the amount of loading.
*/
access.once('active', async () => {
access.default.once('active', async () => {
const { default: app } = await import(/* webpackMode: "eager" */ './app');
const { proxyServerVncUpgrade } = await import(
/* webpackMode: "eager" */ './middlewares'
Expand Down
47 changes: 47 additions & 0 deletions striker-ui-api/src/lib/Responder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { Response } from 'express';

import { ResponseError } from './ResponseError';
import { perr } from './shell';

export class Responder<
ResBody = Express.RhResBody,
Locals extends Express.RhLocals = Express.RhLocals,
> {
private response: Response<ResBody, Locals>;

constructor(response: Response<ResBody, Locals>) {
this.response = response;
}

private respond(status: number, body?: ResBody) {
return this.response.status(status).send(body);
}

private respondError(status: number, ...params: ResponseErrorParams) {
const error = new ResponseError(...params);

perr(error.toString());

return this.response.status(status).send(error.body as ResBody);
}

public s200(body?: ResBody) {
return this.respond(200, body);
}

public s201(body?: ResBody) {
return this.respond(201, body);
}

public s400(...params: ResponseErrorParams) {
return this.respondError(400, ...params);
}

public s404(body?: ResBody) {
return this.respond(404, body);
}

public s500(...params: ResponseErrorParams) {
return this.respondError(500, ...params);
}
}
Loading