diff --git a/ui/src/lib/api/index.ts b/ui/src/lib/api/index.ts index 5e3c76c..1900727 100644 --- a/ui/src/lib/api/index.ts +++ b/ui/src/lib/api/index.ts @@ -92,6 +92,12 @@ export interface listEntitiesResponse { Result: entity[]; } +export interface createUserRequest { + Username: string; + Password: string; + Admin?: boolean; +} + export async function login(info: loginInfo): Promise { let retVal = {}; await client @@ -190,6 +196,23 @@ export async function listUsers( return retVal; } +export async function adminCreateUser(user: createUserRequest): Promise { + let retVal = {}; + await client + .post('/user/', user) + .then((resp: AxiosResponse) => { + retVal = resp.data; + }) + .catch((err: AxiosError) => { + retVal = + (err.response?.data as errorResponse) || + { + message: unknownError, + }; + }); + return retVal; +} + export async function createEntity(entity: entityCreateRequest): Promise { let retVal = {}; await client diff --git a/ui/src/views/user/ManageView.vue b/ui/src/views/user/ManageView.vue index 3de8333..e51c362 100644 --- a/ui/src/views/user/ManageView.vue +++ b/ui/src/views/user/ManageView.vue @@ -6,6 +6,36 @@ + + + + + + + + + + + + Admin + + + + Create + + + + +
@@ -84,8 +114,9 @@