Skip to content

Commit

Permalink
Merge pull request #88 from fangshun-z/fix/87
Browse files Browse the repository at this point in the history
fix(MigrateDialog): add Scheduling Policy
  • Loading branch information
Ruby-rc authored May 24, 2024
2 parents 095f0c3 + 850ef07 commit ac06fad
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"localVolumeName": "LocalVolumeName",
"state": "State",
"node": "Node",
"schedulingPolicies": "Scheduling Policy",
"affinity": "Affinity-based scheduling",
"random": "Random scheduling",
"noty": {
"success": "Dispatched migration task successfully",
"error": "Failed to dispatch migration task"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"localVolumeName": "LV 名称",
"state": "状态",
"node": "节点",
"schedulingPolicies": "调度策略",
"affinity": "亲和性调度",
"random": "随机",
"noty": {
"success": "迁移任务下发成功",
"error": "迁移任务下发失败"
Expand Down
2 changes: 1 addition & 1 deletion src/services/Metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ContentType, HttpClient, RequestParams } from "./http-client";

export class Metric<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
/**
* @description EventList 排序 resourceType枚举(Cluster;StorageNode;DiskNode;Pool;Volume;DiskVolume;Disk) sort枚举 (time、name、type) sortDir:升序"ASC" 降序"DESC"
* @description EventList 排序 resourceType枚举(Cluster;StorageNode;DiskNode;Pool;Volume;DiskVolume;Disk) sort枚举 (time、name、type)
*
* @tags Metric
* @name EventsList
Expand Down
2 changes: 1 addition & 1 deletion src/services/Volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class Volume<SecurityDataType = unknown> extends HttpClient<SecurityDataT
*
* @tags Volume
* @name VolumesEventsDetail
* @summary 摘要 获取指定数据卷审计日志 sort=time, sortDir:升序"ASC" 降序"DESC"
* @summary 摘要 获取指定数据卷审计日志 sort=time ,先不做按操作查询
* @request GET:/cluster/volumes/{volumeName}/events
*/
volumesEventsDetail = ({ volumeName, ...query }: VolumesEventsDetailParams, params: RequestParams = {}) =>
Expand Down
12 changes: 7 additions & 5 deletions src/services/data-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ export interface ApiVolumeList {
}

export interface ApiVolumeMigrateInfo {
replicaAffinity?: string;
selectedNode?: string;
srcNode?: string;
volumeName?: string;
Expand Down Expand Up @@ -555,6 +556,7 @@ export interface ApiVolumeMigrateOperation {

export interface ApiVolumeMigrateReqBody {
abort?: boolean;
replicaAffinity?: string;
selectedNode?: string;
srcNode?: string;
}
Expand Down Expand Up @@ -2086,11 +2088,6 @@ export interface V1Alpha1SmartInfo {
}

export enum V1Alpha1State {
MountPointStateEmpty = "",
MountPointToBeMounted = "ToBeMounted",
MountPointToBeUnMount = "ToBeUnMount",
MountPointMounted = "Mounted",
MountPointNotReady = "NotReady",
NodeStateReady = "Ready",
NodeStateMaintain = "Maintain",
NodeStateOffline = "Offline",
Expand Down Expand Up @@ -2125,6 +2122,11 @@ export enum V1Alpha1State {
DiskStateAvailable = "Available",
DiskStateInUse = "InUse",
DiskStateOffline = "Offline",
MountPointStateEmpty = "",
MountPointToBeMounted = "ToBeMounted",
MountPointToBeUnMount = "ToBeUnMount",
MountPointMounted = "Mounted",
MountPointNotReady = "NotReady",
}

export interface V1Alpha1StorageNodeCondition {
Expand Down
20 changes: 20 additions & 0 deletions src/views/local-volumes/dialogs/MigrateDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,24 @@
/>
</dao-select>
</dao-form-item>
<dao-form-item
:label="$t('views.local-volumes.dialogs.MigrateDialog.schedulingPolicies')"
wrapper-type="radio"
>
<dao-radio-group
v-model="policy"
:vertical="false"
>
<dao-radio
value="need"
:label="$t('views.local-volumes.dialogs.MigrateDialog.affinity')"
/>
<dao-radio
value="forbid"
:label="$t('views.local-volumes.dialogs.MigrateDialog.random')"
/>
</dao-radio-group>
</dao-form-item>
</dao-form>

<template #footer>
Expand Down Expand Up @@ -149,6 +167,7 @@ const nodes = ref<ApiStorageNode[]>([]);
const sourceNode = ref<string>();
const targetNode = ref<string>();
const targetNodeType = ref<'auto' | 'manual'>('auto');
const policy = ref('need');
const columns = computed(() => [
{
id: 'name',
Expand Down Expand Up @@ -177,6 +196,7 @@ const onConfirm = async () => {
await VolumeApi.volumesMigrateCreate(props.name, {
selectedNode: targetNodeType.value === 'manual' ? targetNode.value : undefined,
srcNode: sourceNode.value,
replicaAffinity: policy.value,
});
emits('resolve');
Expand Down
34 changes: 20 additions & 14 deletions swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
},
"/cluster/events": {
"get": {
"description": "EventList 排序 resourceType枚举(Cluster;StorageNode;DiskNode;Pool;Volume;DiskVolume;Disk) sort枚举 (time、name、type) sortDir:升序\"ASC\" 降序\"DESC\"",
"description": "EventList 排序 resourceType枚举(Cluster;StorageNode;DiskNode;Pool;Volume;DiskVolume;Disk) sort枚举 (time、name、type)",
"consumes": [
"application/json"
],
Expand Down Expand Up @@ -1648,7 +1648,7 @@
"tags": [
"Volume"
],
"summary": "摘要 获取指定数据卷审计日志 sort=time, sortDir:升序\"ASC\" 降序\"DESC\"",
"summary": "摘要 获取指定数据卷审计日志 sort=time ,先不做按操作查询",
"parameters": [
{
"type": "string",
Expand Down Expand Up @@ -2982,6 +2982,9 @@
"api.VolumeMigrateInfo": {
"type": "object",
"properties": {
"replicaAffinity": {
"type": "string"
},
"selectedNode": {
"type": "string"
},
Expand Down Expand Up @@ -3021,6 +3024,9 @@
"abort": {
"type": "boolean"
},
"replicaAffinity": {
"type": "string"
},
"selectedNode": {
"type": "string"
},
Expand Down Expand Up @@ -5090,11 +5096,6 @@
"v1alpha1.State": {
"type": "string",
"enum": [
"",
"ToBeMounted",
"ToBeUnMount",
"Mounted",
"NotReady",
"Ready",
"Maintain",
"Offline",
Expand Down Expand Up @@ -5128,14 +5129,14 @@
"Failed",
"Available",
"InUse",
"Offline"
"Offline",
"",
"ToBeMounted",
"ToBeUnMount",
"Mounted",
"NotReady"
],
"x-enum-varnames": [
"MountPointStateEmpty",
"MountPointToBeMounted",
"MountPointToBeUnMount",
"MountPointMounted",
"MountPointNotReady",
"NodeStateReady",
"NodeStateMaintain",
"NodeStateOffline",
Expand Down Expand Up @@ -5169,7 +5170,12 @@
"OperationStateFailed",
"DiskStateAvailable",
"DiskStateInUse",
"DiskStateOffline"
"DiskStateOffline",
"MountPointStateEmpty",
"MountPointToBeMounted",
"MountPointToBeUnMount",
"MountPointMounted",
"MountPointNotReady"
]
},
"v1alpha1.StorageNodeCondition": {
Expand Down

0 comments on commit ac06fad

Please sign in to comment.