feat(group): add node group management UI
Add node group management interface with automatic user assignment and traffic-based grouping. Features: - Node group CRUD with traffic range configuration - Three grouping modes: average, subscription-based, and traffic-based - Group recalculation with preview and history tracking - Subscribe-to-group mapping management - User subscription group locking - Group calculation history with detailed reports - Multi-language support (en-US, zh-CN) - Enhanced node and subscription forms with group selection
This commit is contained in:
@@ -53,17 +53,18 @@ export function DatePicker({
|
||||
)}
|
||||
variant="outline"
|
||||
>
|
||||
{value ? intlFormat(value) : <span>{placeholder}</span>}
|
||||
<span className="truncate">{value ? intlFormat(value) : <span>{placeholder}</span>}</span>
|
||||
<div className="flex items-center gap-2">
|
||||
{value && (
|
||||
<button
|
||||
className="flex items-center"
|
||||
<span
|
||||
className="flex items-center cursor-pointer"
|
||||
onClick={handleClear}
|
||||
onMouseDown={handleClear}
|
||||
type="button"
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
>
|
||||
<X className="size-4 opacity-50 hover:opacity-100" />
|
||||
</button>
|
||||
</span>
|
||||
)}
|
||||
<CalendarIcon className="size-4" />
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,394 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
import request from "@workspace/ui/lib/request";
|
||||
|
||||
/** Get user group list GET /v1/admin/group/user/list */
|
||||
export async function getUserGroupList(
|
||||
params: API.GetUserGroupListRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.GetUserGroupListResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/user/list`,
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Create user group POST /v1/admin/group/user */
|
||||
export async function createUserGroup(
|
||||
body: API.CreateUserGroupRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/user`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Update user group PUT /v1/admin/group/user */
|
||||
export async function updateUserGroup(
|
||||
body: API.UpdateUserGroupRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/user`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Delete user group DELETE /v1/admin/group/user */
|
||||
export async function deleteUserGroup(
|
||||
body: API.DeleteUserGroupRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/user`,
|
||||
{
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Get node group list GET /v1/admin/group/node/list */
|
||||
export async function getNodeGroupList(
|
||||
params: API.GetNodeGroupListRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.GetNodeGroupListResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/node/list`,
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Create node group POST /v1/admin/group/node */
|
||||
export async function createNodeGroup(
|
||||
body: API.CreateNodeGroupRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/node`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Update node group PUT /v1/admin/group/node */
|
||||
export async function updateNodeGroup(
|
||||
body: API.UpdateNodeGroupRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/node`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Delete node group DELETE /v1/admin/group/node */
|
||||
export async function deleteNodeGroup(
|
||||
body: API.DeleteNodeGroupRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/node`,
|
||||
{
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Get subscribe mapping list GET /v1/admin/group/subscribe/mapping */
|
||||
export async function getSubscribeMapping(
|
||||
params: API.GetSubscribeMappingRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.GetSubscribeMappingResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/subscribe/mapping`,
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Update subscribe mapping PUT /v1/admin/group/subscribe/mapping */
|
||||
export async function updateSubscribeMapping(
|
||||
body: API.UpdateSubscribeMappingRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/subscribe/mapping`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Get subscribe group mapping GET /v1/admin/group/subscribe/mapping */
|
||||
export async function getSubscribeGroupMapping(
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.GetSubscribeGroupMappingResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/subscribe/mapping`,
|
||||
{
|
||||
method: "GET",
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Get group config GET /v1/admin/group/config */
|
||||
export async function getGroupConfig(
|
||||
params?: API.GetGroupConfigRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.GetGroupConfigResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/config`,
|
||||
{
|
||||
method: "GET",
|
||||
params: params || {},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Update group config PUT /v1/admin/group/config */
|
||||
export async function updateGroupConfig(
|
||||
body: API.UpdateGroupConfigRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/config`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Get recalculation status GET /v1/admin/group/recalculation/status */
|
||||
export async function getRecalculationStatus(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.RecalculationState }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/recalculation/status`,
|
||||
{
|
||||
method: "GET",
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Recalculate groups POST /v1/admin/group/recalculate */
|
||||
export async function recalculateGroup(
|
||||
body: API.RecalculateGroupRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/recalculate`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Get group history GET /v1/admin/group/history */
|
||||
export async function getGroupHistory(
|
||||
params: API.GetGroupHistoryRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.GetGroupHistoryResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/history`,
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Get group history detail GET /v1/admin/group/history/detail */
|
||||
export async function getGroupHistoryDetail(
|
||||
params: { id: number },
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.GetGroupHistoryDetailResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/history/detail`,
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
id: params.id,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Export group result GET /v1/admin/group/export */
|
||||
export async function exportGroupResult(
|
||||
params?: API.ExportGroupResultRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<Blob>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/export`,
|
||||
{
|
||||
method: "GET",
|
||||
params: params || {},
|
||||
responseType: 'blob',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Preview user nodes GET /v1/admin/group/preview */
|
||||
export async function previewUserNodes(
|
||||
params: API.PreviewUserNodesRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.PreviewUserNodesResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/preview`,
|
||||
{
|
||||
method: "GET",
|
||||
params: {
|
||||
user_id: params.user_id,
|
||||
},
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Migrate users to another group POST /v1/admin/group/migrate */
|
||||
export async function migrateUsersToGroup(
|
||||
body: API.MigrateUsersRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: API.MigrateUsersResponse }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/migrate`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Update user user group PUT /v1/admin/user/user_group */
|
||||
export async function updateUserUserGroup(
|
||||
body: API.UpdateUserUserGroupRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/user/user_group`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Reset all groups POST /v1/admin/group/reset */
|
||||
export async function resetGroups(
|
||||
body: API.ResetGroupsRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/reset`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** Bind node group to user groups POST /v1/admin/group/user/bind-node-groups */
|
||||
export async function bindNodeGroups(
|
||||
body: API.BindNodeGroupsRequest,
|
||||
options?: { [key: string]: any }
|
||||
) {
|
||||
return request<API.Response & { data?: any }>(
|
||||
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/group/user/bind-node-groups`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import * as authMethod from "./authMethod";
|
||||
import * as console from "./console";
|
||||
import * as coupon from "./coupon";
|
||||
import * as document from "./document";
|
||||
import * as group from "./group";
|
||||
import * as log from "./log";
|
||||
import * as marketing from "./marketing";
|
||||
import * as order from "./order";
|
||||
@@ -27,6 +28,7 @@ export default {
|
||||
console,
|
||||
coupon,
|
||||
document,
|
||||
group,
|
||||
log,
|
||||
marketing,
|
||||
order,
|
||||
|
||||
+278
-5
@@ -103,6 +103,7 @@ declare namespace API {
|
||||
longitude: string;
|
||||
created_at: number;
|
||||
download: number;
|
||||
port: number;
|
||||
};
|
||||
|
||||
type AuthConfig = {
|
||||
@@ -534,7 +535,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type DeleteUserSubscribeRequest = {
|
||||
user_subscribe_id: number;
|
||||
user_subscribe_id: string;
|
||||
};
|
||||
|
||||
type DeviceAuthticateConfig = {
|
||||
@@ -702,12 +703,14 @@ declare namespace API {
|
||||
page: number;
|
||||
size: number;
|
||||
search?: string;
|
||||
node_group_id?: number;
|
||||
};
|
||||
|
||||
type FilterNodeListRequest = {
|
||||
page: number;
|
||||
size: number;
|
||||
search?: string;
|
||||
node_group_id?: number;
|
||||
};
|
||||
|
||||
type FilterNodeListResponse = {
|
||||
@@ -1147,6 +1150,7 @@ declare namespace API {
|
||||
size: number;
|
||||
language?: string;
|
||||
search?: string;
|
||||
node_group_id?: number;
|
||||
};
|
||||
|
||||
type GetSubscribeListRequest = {
|
||||
@@ -1154,6 +1158,7 @@ declare namespace API {
|
||||
size: number;
|
||||
language?: string;
|
||||
search?: string;
|
||||
node_group_id?: number;
|
||||
};
|
||||
|
||||
type GetSubscribeListResponse = {
|
||||
@@ -1210,6 +1215,7 @@ declare namespace API {
|
||||
unscoped?: boolean;
|
||||
subscribe_id?: number;
|
||||
user_subscribe_id?: number;
|
||||
user_group_id?: number;
|
||||
};
|
||||
|
||||
type GetUserListRequest = {
|
||||
@@ -1440,6 +1446,8 @@ declare namespace API {
|
||||
protocol: string;
|
||||
enabled: boolean;
|
||||
sort?: number;
|
||||
node_group_id?: number;
|
||||
node_group_ids?: number[];
|
||||
created_at: number;
|
||||
updated_at: number;
|
||||
};
|
||||
@@ -1921,11 +1929,11 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type ResetUserSubscribeTokenRequest = {
|
||||
user_subscribe_id: number;
|
||||
user_subscribe_id: any;
|
||||
};
|
||||
|
||||
type ResetUserSubscribeTrafficRequest = {
|
||||
user_subscribe_id: number;
|
||||
user_subscribe_id: string;
|
||||
};
|
||||
|
||||
type Response = {
|
||||
@@ -2106,6 +2114,8 @@ declare namespace API {
|
||||
quota: number;
|
||||
nodes: number[];
|
||||
node_tags: string[];
|
||||
node_group_ids?: number[];
|
||||
node_group_id?: number;
|
||||
show: boolean;
|
||||
sell: boolean;
|
||||
sort: number;
|
||||
@@ -2171,6 +2181,8 @@ declare namespace API {
|
||||
quota?: number;
|
||||
nodes?: number[];
|
||||
node_tags?: string[];
|
||||
node_group_ids?: number[];
|
||||
node_group_id?: number;
|
||||
show?: boolean;
|
||||
sell?: boolean;
|
||||
sort?: number;
|
||||
@@ -2244,7 +2256,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type ToggleUserSubscribeStatusRequest = {
|
||||
user_subscribe_id: number;
|
||||
user_subscribe_id: any;
|
||||
};
|
||||
|
||||
type TosConfig = {
|
||||
@@ -2473,7 +2485,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type UpdateUserSubscribeRequest = {
|
||||
user_subscribe_id: number;
|
||||
user_subscribe_id: string;
|
||||
subscribe_id: number;
|
||||
traffic: number;
|
||||
expired_at: number;
|
||||
@@ -2498,6 +2510,8 @@ declare namespace API {
|
||||
enable_login_notify: boolean;
|
||||
enable_subscribe_notify: boolean;
|
||||
enable_trade_notify: boolean;
|
||||
user_group_id: string;
|
||||
group_locked: boolean;
|
||||
auth_methods: UserAuthMethod[];
|
||||
user_devices: UserDevice[];
|
||||
rules: string[];
|
||||
@@ -2659,4 +2673,263 @@ declare namespace API {
|
||||
security: string;
|
||||
security_config: SecurityConfig;
|
||||
};
|
||||
|
||||
// ===== Group Management Types =====
|
||||
|
||||
type UserGroup = {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
sort: number;
|
||||
node_group_id?: number | null;
|
||||
for_calculation?: boolean;
|
||||
created_at: number;
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type NodeGroup = {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
sort: number;
|
||||
for_calculation: boolean;
|
||||
min_traffic_gb?: number;
|
||||
max_traffic_gb?: number;
|
||||
created_at: number;
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type Subscribe = {
|
||||
id: number;
|
||||
name: string;
|
||||
unit_price: number;
|
||||
unit_time: number;
|
||||
show?: boolean;
|
||||
sell?: boolean;
|
||||
sort: number;
|
||||
created_at: number;
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type SubscribeGroupMapping = {
|
||||
subscribe_id: number;
|
||||
user_group_id: string;
|
||||
created_at: number;
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type SubscribeGroupMappingInfo = {
|
||||
id: number;
|
||||
subscribe_id: number;
|
||||
user_group_id: number;
|
||||
subscribe?: Subscribe;
|
||||
user_group?: UserGroup;
|
||||
created_at: number;
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type GroupHistory = {
|
||||
id: number;
|
||||
group_mode: string;
|
||||
trigger_type: string;
|
||||
total_users: number;
|
||||
success_count: number;
|
||||
failed_count: number;
|
||||
start_time?: number;
|
||||
end_time?: number;
|
||||
operator?: string;
|
||||
error_log?: string;
|
||||
created_at: number;
|
||||
};
|
||||
|
||||
type GroupHistoryDetailItem = {
|
||||
id: number;
|
||||
history_id: number;
|
||||
user_group_id: string;
|
||||
node_group_id: string;
|
||||
user_count: number;
|
||||
node_count: number;
|
||||
user_data?: string;
|
||||
created_at: number;
|
||||
};
|
||||
|
||||
type GroupHistoryDetail = {
|
||||
id: number;
|
||||
group_mode: string;
|
||||
trigger_type: string;
|
||||
total_users: number;
|
||||
success_count: number;
|
||||
failed_count: number;
|
||||
start_time?: number;
|
||||
end_time?: number;
|
||||
operator?: string;
|
||||
error_log?: string;
|
||||
created_at: number;
|
||||
config_snapshot?: {
|
||||
group_details?: GroupHistoryDetailItem[];
|
||||
config?: Record<string, unknown>;
|
||||
};
|
||||
};
|
||||
|
||||
type RecalculationState = {
|
||||
state: string;
|
||||
progress: number;
|
||||
total: number;
|
||||
};
|
||||
|
||||
// ===== Group Request/Response Types =====
|
||||
|
||||
type GetUserGroupListRequest = {
|
||||
page: number;
|
||||
size: number;
|
||||
group_id?: string;
|
||||
};
|
||||
|
||||
type GetUserGroupListResponse = {
|
||||
total: number;
|
||||
list: UserGroup[];
|
||||
};
|
||||
|
||||
type CreateUserGroupRequest = {
|
||||
name: string;
|
||||
description?: string;
|
||||
sort?: number;
|
||||
node_group_id?: number | null;
|
||||
for_calculation?: boolean | null;
|
||||
};
|
||||
|
||||
type UpdateUserGroupRequest = {
|
||||
id: number;
|
||||
name?: string;
|
||||
description?: string;
|
||||
sort?: number;
|
||||
node_group_id?: number | null;
|
||||
for_calculation?: boolean | null;
|
||||
};
|
||||
|
||||
type DeleteUserGroupRequest = {
|
||||
id: number;
|
||||
};
|
||||
|
||||
type BindNodeGroupsRequest = {
|
||||
user_group_ids: number[];
|
||||
node_group_id?: number | null;
|
||||
};
|
||||
|
||||
type GetNodeGroupListRequest = {
|
||||
page: number;
|
||||
size: number;
|
||||
group_id?: string;
|
||||
};
|
||||
|
||||
type GetNodeGroupListResponse = {
|
||||
total: number;
|
||||
list: NodeGroup[];
|
||||
};
|
||||
|
||||
type CreateNodeGroupRequest = {
|
||||
name: string;
|
||||
description?: string;
|
||||
sort?: number;
|
||||
for_calculation?: boolean;
|
||||
min_traffic_gb?: number;
|
||||
max_traffic_gb?: number;
|
||||
};
|
||||
|
||||
type UpdateNodeGroupRequest = {
|
||||
id: number;
|
||||
name?: string;
|
||||
description?: string;
|
||||
sort?: number;
|
||||
for_calculation?: boolean;
|
||||
min_traffic_gb?: number;
|
||||
max_traffic_gb?: number;
|
||||
};
|
||||
|
||||
type DeleteNodeGroupRequest = {
|
||||
id: number;
|
||||
};
|
||||
|
||||
type GetSubscribeMappingRequest = {
|
||||
page: number;
|
||||
size: number;
|
||||
subscribe_id?: number;
|
||||
user_group_id?: number;
|
||||
};
|
||||
|
||||
type GetSubscribeMappingResponse = {
|
||||
total: number;
|
||||
list: SubscribeGroupMappingInfo[];
|
||||
};
|
||||
|
||||
type UpdateSubscribeMappingRequest = {
|
||||
subscribe_id: number;
|
||||
user_group_id: number;
|
||||
};
|
||||
|
||||
type GetGroupConfigResponse = {
|
||||
enabled: boolean;
|
||||
mode: string;
|
||||
};
|
||||
|
||||
type UpdateGroupConfigRequest = {
|
||||
enabled?: boolean;
|
||||
mode?: string;
|
||||
};
|
||||
|
||||
type RecalculateGroupRequest = {
|
||||
mode: string;
|
||||
};
|
||||
|
||||
type GetGroupHistoryRequest = {
|
||||
page: number;
|
||||
size: number;
|
||||
group_mode?: string;
|
||||
trigger_type?: string;
|
||||
};
|
||||
|
||||
type GetGroupHistoryResponse = {
|
||||
total: number;
|
||||
list: GroupHistory[];
|
||||
};
|
||||
|
||||
type GetGroupHistoryDetailRequest = {
|
||||
id: number;
|
||||
};
|
||||
|
||||
type GetGroupHistoryDetailResponse = GroupHistoryDetail;
|
||||
|
||||
type ExportGroupResultRequest = {
|
||||
history_id?: number;
|
||||
};
|
||||
type MigrateUsersRequest = {
|
||||
from_user_group_id: number;
|
||||
to_user_group_id: number;
|
||||
include_locked?: boolean;
|
||||
};
|
||||
type MigrateUsersResponse = {
|
||||
success_count: number;
|
||||
failed_count: number;
|
||||
};
|
||||
type ResetGroupsRequest = {
|
||||
confirm: boolean;
|
||||
};
|
||||
|
||||
type PreviewUserNodesRequest = {
|
||||
user_id: number;
|
||||
};
|
||||
|
||||
type PreviewUserNodesResponse = {
|
||||
user_id: number;
|
||||
node_groups: Array<{
|
||||
id: number;
|
||||
name: string;
|
||||
nodes: Array<{
|
||||
id: number;
|
||||
name: string;
|
||||
address: string;
|
||||
port: number;
|
||||
}>;
|
||||
}>;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user