Complete platform management workflows

This commit is contained in:
npc0-hue
2026-07-14 16:39:37 +08:00
parent 7e05d0a4e7
commit 4f33f761a3
106 changed files with 11313 additions and 460 deletions
+31
View File
@@ -0,0 +1,31 @@
import type { UserResponse, UserStatus } from "../api/types";
export type UserListSource = "api" | "local-development";
export type UserRemovalAction = "deactivate";
export interface UserEditFormState {
displayName: string;
email: string;
phone: string;
qq: string;
contactNote: string;
roles: string[];
status: UserStatus;
}
export interface UserRemovalConfirmationState {
action: UserRemovalAction;
user: UserResponse;
}
export function userEditFormFromResponse(user: UserResponse): UserEditFormState {
return {
displayName: user.displayName,
email: user.email ?? "",
phone: user.profile?.phone ?? "",
qq: user.profile?.qq ?? "",
contactNote: user.profile?.contactNote ?? "",
roles: [...user.roles],
status: user.status
};
}