Skip to content

Commit af90775

Browse files
authored
chore: prettier all code (#5353)
1 parent c376548 commit af90775

File tree

164 files changed

+5992
-5658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+5992
-5658
lines changed

frontend/providers/devbox/.eslintrc.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,9 @@
1010
},
1111
{
1212
"name": "next/navigation",
13-
"importNames": [
14-
"redirect",
15-
"permanentRedirect",
16-
"useRouter",
17-
"usePathname"
18-
],
13+
"importNames": ["redirect", "permanentRedirect", "useRouter", "usePathname"],
1914
"message": "Please import from `@/i18n` instead."
2015
}
2116
]
2217
}
23-
}
18+
}

frontend/providers/devbox/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ dist
22
.vscode
33
**/.DS_Store
44
node_modules
5+
.next

frontend/providers/devbox/.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ module.exports = {
1717
proseWrap: 'preserve',
1818
htmlWhitespaceSensitivity: 'css',
1919
endOfLine: 'lf'
20-
}
20+
};
Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,116 @@
1-
import { V1Deployment, V1Pod, V1StatefulSet } from '@kubernetes/client-node'
1+
import { V1Deployment, V1Pod, V1StatefulSet } from '@kubernetes/client-node';
22

3-
import { DELETE, GET, POST } from '@/services/request'
4-
import { GetDevboxByNameReturn } from '@/types/adapt'
3+
import { DELETE, GET, POST } from '@/services/request';
4+
import { GetDevboxByNameReturn } from '@/types/adapt';
55
import {
66
DevboxEditTypeV2,
77
DevboxListItemTypeV2,
88
DevboxPatchPropsType,
99
DevboxVersionListItemType
10-
} from '@/types/devbox'
11-
import { KBDevboxReleaseType, KBDevboxTypeV2 } from '@/types/k8s'
10+
} from '@/types/devbox';
11+
import { KBDevboxReleaseType, KBDevboxTypeV2 } from '@/types/k8s';
1212
import {
1313
adaptAppListItem,
1414
adaptDevboxDetailV2,
1515
adaptDevboxListItemV2,
1616
adaptDevboxVersionListItem,
1717
adaptPod
18-
} from '@/utils/adapt'
19-
import { MonitorDataResult, MonitorQueryKey } from '@/types/monitor'
20-
import { AxiosProgressEvent } from 'axios'
18+
} from '@/utils/adapt';
19+
import { MonitorDataResult, MonitorQueryKey } from '@/types/monitor';
20+
import { AxiosProgressEvent } from 'axios';
2121

2222
export const getMyDevboxList = () =>
2323
GET<
2424
[
2525
KBDevboxTypeV2,
2626
{
2727
templateRepository: {
28-
iconId: string | null
29-
}
30-
uid: string
28+
iconId: string | null;
29+
};
30+
uid: string;
3131
}
3232
][]
3333
>('/api/getDevboxList').then((data): DevboxListItemTypeV2[] =>
3434
data.map(adaptDevboxListItemV2).sort((a, b) => {
35-
return new Date(b.createTime).getTime() - new Date(a.createTime).getTime()
35+
return new Date(b.createTime).getTime() - new Date(a.createTime).getTime();
3636
})
37-
)
37+
);
3838
export const getDevboxByName = (devboxName: string) =>
39-
GET<GetDevboxByNameReturn>('/api/getDevboxByName', { devboxName }).then(adaptDevboxDetailV2)
39+
GET<GetDevboxByNameReturn>('/api/getDevboxByName', { devboxName }).then(adaptDevboxDetailV2);
4040

4141
export const applyYamlList = (yamlList: string[], type: 'create' | 'replace' | 'update') =>
42-
POST('/api/applyYamlList', { yamlList, type })
42+
POST('/api/applyYamlList', { yamlList, type });
4343

4444
export const createDevbox = (payload: { devboxForm: DevboxEditTypeV2 }) =>
45-
POST(`/api/createDevbox`, payload)
45+
POST(`/api/createDevbox`, payload);
4646

4747
export const updateDevbox = (payload: { patch: DevboxPatchPropsType; devboxName: string }) =>
48-
POST(`/api/updateDevbox`, payload)
48+
POST(`/api/updateDevbox`, payload);
4949

50-
export const delDevbox = (devboxName: string) => DELETE('/api/delDevbox', { devboxName })
50+
export const delDevbox = (devboxName: string) => DELETE('/api/delDevbox', { devboxName });
5151

52-
export const restartDevbox = (data: { devboxName: string }) => POST('/api/restartDevbox', data)
52+
export const restartDevbox = (data: { devboxName: string }) => POST('/api/restartDevbox', data);
5353

54-
export const startDevbox = (data: { devboxName: string }) => POST('/api/startDevbox', data)
54+
export const startDevbox = (data: { devboxName: string }) => POST('/api/startDevbox', data);
5555

56-
export const pauseDevbox = (data: { devboxName: string }) => POST('/api/pauseDevbox', data)
56+
export const pauseDevbox = (data: { devboxName: string }) => POST('/api/pauseDevbox', data);
5757

5858
export const getDevboxVersionList = (devboxName: string, devboxUid: string) =>
5959
GET<KBDevboxReleaseType[]>('/api/getDevboxVersionList', { devboxName, devboxUid }).then(
6060
(data): DevboxVersionListItemType[] =>
6161
data.map(adaptDevboxVersionListItem).sort((a, b) => {
62-
return new Date(b.createTime).getTime() - new Date(a.createTime).getTime()
62+
return new Date(b.createTime).getTime() - new Date(a.createTime).getTime();
6363
})
64-
)
64+
);
6565

6666
export const releaseDevbox = (data: {
67-
devboxName: string
68-
tag: string
69-
releaseDes: string
70-
devboxUid: string
71-
}) => POST('/api/releaseDevbox', data)
67+
devboxName: string;
68+
tag: string;
69+
releaseDes: string;
70+
devboxUid: string;
71+
}) => POST('/api/releaseDevbox', data);
7272

7373
export const editDevboxVersion = (data: { name: string; releaseDes: string }) =>
74-
POST('/api/editDevboxVersion', data)
74+
POST('/api/editDevboxVersion', data);
7575

7676
export const delDevboxVersionByName = (versionName: string) =>
77-
DELETE('/api/delDevboxVersionByName', { versionName })
77+
DELETE('/api/delDevboxVersionByName', { versionName });
7878

7979
export const getSSHConnectionInfo = (data: { devboxName: string }) =>
8080
GET<{
81-
base64PublicKey: string
82-
base64PrivateKey: string
83-
token: string
84-
userName: string
85-
workingDir: string
86-
releaseCommand: string
87-
releaseArgs: string
88-
}>('/api/getSSHConnectionInfo', data)
81+
base64PublicKey: string;
82+
base64PrivateKey: string;
83+
token: string;
84+
userName: string;
85+
workingDir: string;
86+
releaseCommand: string;
87+
releaseArgs: string;
88+
}>('/api/getSSHConnectionInfo', data);
8989

9090
export const getDevboxPodsByDevboxName = (name: string) =>
91-
GET<V1Pod[]>('/api/getDevboxPodsByDevboxName', { name }).then((item) => item.map(adaptPod))
91+
GET<V1Pod[]>('/api/getDevboxPodsByDevboxName', { name }).then((item) => item.map(adaptPod));
9292

9393
export const getDevboxMonitorData = (payload: {
94-
queryName: string
95-
queryKey: keyof MonitorQueryKey
96-
step: string
97-
}) => GET<MonitorDataResult[]>(`/api/monitor/getMonitorData`, payload)
94+
queryName: string;
95+
queryKey: keyof MonitorQueryKey;
96+
step: string;
97+
}) => GET<MonitorDataResult[]>(`/api/monitor/getMonitorData`, payload);
9898

9999
export const getAppsByDevboxId = (devboxId: string) =>
100100
GET<V1Deployment & V1StatefulSet[]>('/api/getAppsByDevboxId', { devboxId }).then((res) =>
101101
res.map(adaptAppListItem)
102-
)
102+
);
103103

104104
export const execCommandInDevboxPod = (data: {
105-
devboxName: string
106-
command: string
107-
idePath: string
108-
onDownloadProgress: (progressEvent: AxiosProgressEvent) => void
109-
signal: AbortSignal
105+
devboxName: string;
106+
command: string;
107+
idePath: string;
108+
onDownloadProgress: (progressEvent: AxiosProgressEvent) => void;
109+
signal: AbortSignal;
110110
}) =>
111111
POST('/api/execCommandInDevboxPod', data, {
112112
// responseType: 'stream',
113113
timeout: 0,
114114
onDownloadProgress: data.onDownloadProgress,
115115
signal: data.signal
116-
})
116+
});
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
import { GET, POST } from '@/services/request'
2-
import type { UserQuotaItemType, UserTask } from '@/types/user'
3-
import type { Env } from '@/types/static'
4-
import { getDesktopSessionFromSessionStorage, getSessionFromSessionStorage } from '@/utils/user'
5-
export const getAppEnv = () => GET<Env>('/api/getEnv')
1+
import { GET, POST } from '@/services/request';
2+
import type { UserQuotaItemType, UserTask } from '@/types/user';
3+
import type { Env } from '@/types/static';
4+
import { getDesktopSessionFromSessionStorage, getSessionFromSessionStorage } from '@/utils/user';
5+
export const getAppEnv = () => GET<Env>('/api/getEnv');
66

77
export const getUserQuota = () =>
88
GET<{
9-
quota: UserQuotaItemType[]
10-
}>('/api/platform/getQuota')
9+
quota: UserQuotaItemType[];
10+
}>('/api/platform/getQuota');
1111

12-
export const getRuntime = () => GET('/api/platform/getRuntime')
12+
export const getRuntime = () => GET('/api/platform/getRuntime');
1313

14-
export const getResourcePrice = () => GET('/api/platform/resourcePrice')
14+
export const getResourcePrice = () => GET('/api/platform/resourcePrice');
1515

1616
export const postAuthCname = (data: { publicDomain: string; customDomain: string }) =>
17-
POST('/api/platform/authCname', data)
17+
POST('/api/platform/authCname', data);
1818

1919
export const getUserTasks = () =>
2020
POST<{ needGuide: boolean; task: UserTask }>('/api/guide/getTasks', {
2121
desktopToAppToken: getDesktopSessionFromSessionStorage()?.token
22-
})
22+
});
2323

2424
export const checkUserTask = () =>
2525
POST('/api/guide/checkTask', {
2626
desktopToAppToken: getDesktopSessionFromSessionStorage()?.token
27-
})
27+
});

0 commit comments

Comments
 (0)