|
@ -1,5 +1,7 @@ |
|
|
import moment from "moment"; |
|
|
import moment from "moment"; |
|
|
import { capitalize } from "../../../common/util/Util"; |
|
|
import { capitalize } from "../../../common/util/Util"; |
|
|
|
|
|
import { AdminUserDTO } from "../../../common/dto/AdminUserDTO"; |
|
|
|
|
|
import log from "loglevel"; |
|
|
|
|
|
|
|
|
export async function viewUsers(authToken: string) { |
|
|
export async function viewUsers(authToken: string) { |
|
|
// const users = await getOtherUsers(authToken);
|
|
|
// const users = await getOtherUsers(authToken);
|
|
@ -30,6 +32,32 @@ export async function viewUsers(authToken: string) { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
|
|
|
buttons: [ |
|
|
|
|
|
{ |
|
|
|
|
|
extend: "selectedSingle", |
|
|
|
|
|
text: "User Profile", |
|
|
|
|
|
action: (e, dt, button, config) => { |
|
|
|
|
|
const username = (dt.row({ selected: true }).data() as AdminUserDTO) |
|
|
|
|
|
.userName; |
|
|
|
|
|
window.location.assign(`/admin/users/${username}`); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
extend: "selectedSingle", |
|
|
|
|
|
text: "Delete User", |
|
|
|
|
|
action: (e, dt, button, config) => { |
|
|
|
|
|
log.error("Not implemented yet"); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
text: "New User", |
|
|
|
|
|
action: () => { |
|
|
|
|
|
log.error("Not implemented yet"); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
dom: "Blfrtip", |
|
|
lengthMenu: [2, 10, 25, 50, 75, 100], |
|
|
lengthMenu: [2, 10, 25, 50, 75, 100], |
|
|
|
|
|
select: true, |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |