Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: jetbrain modal #5253

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7a506a3
feat: basic style and logic of modal
mlhiter Nov 29, 2024
cdab0f1
style: blue style
mlhiter Nov 29, 2024
5253b1e
fix: hydro bug
mlhiter Nov 29, 2024
c50588a
style: copy hover style
mlhiter Nov 29, 2024
b218461
fix: copy error bug
mlhiter Nov 29, 2024
5b81255
fix: workdir bug
mlhiter Nov 29, 2024
1d5ef5f
style: space adjust
mlhiter Nov 29, 2024
eed0826
fix: download sshkey file bug
mlhiter Nov 29, 2024
8b63bed
feat: cover css
mlhiter Nov 29, 2024
6385e12
feat: dymatic inject info to image and text
mlhiter Dec 2, 2024
726f1cc
chore: text bug
mlhiter Dec 2, 2024
f7b7072
fix: gateway url bug
mlhiter Dec 2, 2024
6a6c107
fix: text i18n perf
mlhiter Dec 2, 2024
0d19341
chore: text adjust
mlhiter Dec 3, 2024
3ef6be7
chore: icon adjust to upperRight
mlhiter Dec 3, 2024
cac8b3e
feat: add close button
mlhiter Dec 3, 2024
b5b9ab7
fix: ts lint bug
mlhiter Dec 11, 2024
10371a3
feat: jetbrain modal basic style
mlhiter Dec 11, 2024
fdf44f8
feat: basic style
mlhiter Dec 12, 2024
0fa6f24
feat: tab and code
mlhiter Dec 12, 2024
ab314fc
feat: script feat
mlhiter Dec 12, 2024
b2d385d
fix: modal scroll bug
mlhiter Dec 12, 2024
7abea0e
fix: style bug
mlhiter Dec 12, 2024
53dea53
feat: copy code
mlhiter Dec 12, 2024
a375974
feat: download function
mlhiter Dec 12, 2024
fd7729a
feat: connect style
mlhiter Dec 12, 2024
8217149
feat: detail sshconfig
mlhiter Dec 12, 2024
cbae1e8
feat: basic execCommand logic
mlhiter Dec 12, 2024
bdb3bb3
feat: basic connection logic
mlhiter Dec 17, 2024
bb370d7
fix: 无法解决,遂退一步
mlhiter Dec 17, 2024
c330992
fix: connect error
mlhiter Dec 18, 2024
0167aa7
fix: macos script bug
mlhiter Dec 18, 2024
79300b3
fix: windows script test and fix
mlhiter Dec 18, 2024
778c46d
feat: default system
mlhiter Dec 20, 2024
eff6651
fix: powershell text bug
mlhiter Dec 20, 2024
eb057f6
fix: show h bug
mlhiter Dec 20, 2024
b086bcb
style: some transition
mlhiter Dec 20, 2024
7c8978e
fix: macos script bug
mlhiter Dec 20, 2024
9366ec7
fix: windows script re-test and fix
mlhiter Dec 20, 2024
da76b56
feat: verify connection
mlhiter Dec 20, 2024
80d19b8
fix: webpack build error
mlhiter Dec 20, 2024
1120c36
fix: webpack build error return
mlhiter Dec 20, 2024
f410456
feat: check connection
mlhiter Dec 20, 2024
d2e0589
style: arrow style perf
mlhiter Dec 20, 2024
139ae46
Merge branch 'main' into feature/jetbrain-modal
mlhiter Dec 27, 2024
8a914a3
fix: basic type bug
mlhiter Dec 27, 2024
356ccbf
fix: runtimeType and runtimeVersion bug
mlhiter Dec 30, 2024
6e18e43
style: idebutton style adjust
mlhiter Jan 2, 2025
20655e9
chore: build error
mlhiter Jan 3, 2025
9920c7b
fix: 妥协之举
mlhiter Jan 3, 2025
a877df5
fix: some style adjust and text adjust
mlhiter Jan 9, 2025
fa8f40f
feat: config confirm
mlhiter Jan 9, 2025
f67324e
chore: remove more action
mlhiter Jan 9, 2025
10eae68
fix: online code
mlhiter Jan 10, 2025
549e9b6
feat: tabs style
mlhiter Jan 10, 2025
2e54d3b
fix: detail sshConnection bug
mlhiter Jan 13, 2025
40d2b1f
style: modal style fix
mlhiter Jan 13, 2025
84cc497
Merge branch 'main' into feature/jetbrain-modal
mlhiter Jan 13, 2025
e77c8ef
fix: style adjust
mlhiter Jan 13, 2025
58f80d4
Merge branch 'main' into feature/jetbrain-modal
mlhiter Jan 13, 2025
fca6629
fix: build bug
mlhiter Jan 13, 2025
2f69ac3
fix: test deal bug
mlhiter Jan 13, 2025
4c2ee5e
chore: prettier manual
mlhiter Jan 13, 2025
ecf01d6
style: another adjust
mlhiter Jan 13, 2025
63b1ad0
style: style minH perf
mlhiter Jan 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions frontend/providers/devbox/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@
},
{
"name": "next/navigation",
"importNames": [
"redirect",
"permanentRedirect",
"useRouter",
"usePathname"
],
"importNames": ["redirect", "permanentRedirect", "useRouter", "usePathname"],
"message": "Please import from `@/i18n` instead."
}
]
}
}
}
2 changes: 1 addition & 1 deletion frontend/providers/devbox/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ module.exports = {
proseWrap: 'preserve',
htmlWhitespaceSensitivity: 'css',
endOfLine: 'lf'
}
};
101 changes: 60 additions & 41 deletions frontend/providers/devbox/api/devbox.ts
Original file line number Diff line number Diff line change
@@ -1,75 +1,80 @@
import { V1Deployment, V1Pod, V1StatefulSet } from '@kubernetes/client-node'
import { V1Deployment, V1Pod, V1StatefulSet } from '@kubernetes/client-node';

import { DELETE, GET, POST } from '@/services/request'
import { GetDevboxByNameReturn } from '@/types/adapt'
import { DELETE, GET, POST } from '@/services/request';
import { GetDevboxByNameReturn } from '@/types/adapt';
import {
DevboxEditTypeV2,
DevboxListItemTypeV2,
DevboxPatchPropsType,
DevboxVersionListItemType
} from '@/types/devbox'
import { KBDevboxReleaseType, KBDevboxTypeV2 } from '@/types/k8s'
import { MonitorDataResult, MonitorQueryKey } from '@/types/monitor'
} from '@/types/devbox';
import { KBDevboxReleaseType, KBDevboxTypeV2 } from '@/types/k8s';
import {
adaptAppListItem,
adaptDevboxDetailV2,
adaptDevboxListItemV2,
adaptDevboxVersionListItem,
adaptPod
} from '@/utils/adapt'
} from '@/utils/adapt';
import { MonitorDataResult, MonitorQueryKey } from '@/types/monitor';
import { AxiosProgressEvent } from 'axios';

export const getMyDevboxList = () =>
GET<[KBDevboxTypeV2, {
templateRepository: {
iconId: string | null;
};
uid: string;
}][]>('/api/getDevboxList').then((data): DevboxListItemTypeV2[] =>
GET<
[
KBDevboxTypeV2,
{
templateRepository: {
iconId: string | null;
};
uid: string;
}
][]
>('/api/getDevboxList').then((data): DevboxListItemTypeV2[] =>
data.map(adaptDevboxListItemV2).sort((a, b) => {
return new Date(b.createTime).getTime() - new Date(a.createTime).getTime()
return new Date(b.createTime).getTime() - new Date(a.createTime).getTime();
})
)
);
export const getDevboxByName = (devboxName: string) =>
GET<GetDevboxByNameReturn>('/api/getDevboxByName', { devboxName }).then(adaptDevboxDetailV2)
GET<GetDevboxByNameReturn>('/api/getDevboxByName', { devboxName }).then(adaptDevboxDetailV2);

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

export const createDevbox = (payload: {
devboxForm: DevboxEditTypeV2
}) => POST(`/api/createDevbox`, payload)
export const createDevbox = (payload: { devboxForm: DevboxEditTypeV2 }) =>
POST(`/api/createDevbox`, payload);

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

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

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

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

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

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

export const releaseDevbox = (data: {
devboxName: string
tag: string
releaseDes: string
devboxUid: string
}) => POST('/api/releaseDevbox', data)
devboxName: string;
tag: string;
releaseDes: string;
devboxUid: string;
}) => POST('/api/releaseDevbox', data);

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

export const delDevboxVersionByName = (versionName: string) =>
DELETE('/api/delDevboxVersionByName', { versionName })
DELETE('/api/delDevboxVersionByName', { versionName });

export const getSSHConnectionInfo = (data: { devboxName: string }) =>
GET<{
Expand All @@ -80,18 +85,32 @@ export const getSSHConnectionInfo = (data: { devboxName: string }) =>
workingDir: string;
releaseCommand: string;
releaseArgs: string;
}>('/api/getSSHConnectionInfo', data)
}>('/api/getSSHConnectionInfo', data);

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

export const getDevboxMonitorData = (payload: {
queryName: string
queryKey: keyof MonitorQueryKey
step: string
}) => GET<MonitorDataResult[]>(`/api/monitor/getMonitorData`, payload)
queryName: string;
queryKey: keyof MonitorQueryKey;
step: string;
}) => GET<MonitorDataResult[]>(`/api/monitor/getMonitorData`, payload);

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

export const execCommandInDevboxPod = (data: {
devboxName: string;
command: string;
idePath: string;
onDownloadProgress: (progressEvent: AxiosProgressEvent) => void;
signal: AbortSignal;
}) =>
POST('/api/execCommandInDevboxPod', data, {
// responseType: 'stream',
timeout: 0,
onDownloadProgress: data.onDownloadProgress,
signal: data.signal
});
24 changes: 12 additions & 12 deletions frontend/providers/devbox/api/platform.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { GET, POST } from '@/services/request'
import type { UserQuotaItemType, UserTask } from '@/types/user'
import type { Env } from '@/types/static'
import { getDesktopSessionFromSessionStorage, getSessionFromSessionStorage } from '@/utils/user'
export const getAppEnv = () => GET<Env>('/api/getEnv')
import { GET, POST } from '@/services/request';
import type { UserQuotaItemType, UserTask } from '@/types/user';
import type { Env } from '@/types/static';
import { getDesktopSessionFromSessionStorage, getSessionFromSessionStorage } from '@/utils/user';
export const getAppEnv = () => GET<Env>('/api/getEnv');

export const getUserQuota = () =>
GET<{
quota: UserQuotaItemType[]
}>('/api/platform/getQuota')
quota: UserQuotaItemType[];
}>('/api/platform/getQuota');

export const getRuntime = () => GET('/api/platform/getRuntime')
export const getRuntime = () => GET('/api/platform/getRuntime');

export const getResourcePrice = () => GET('/api/platform/resourcePrice')
export const getResourcePrice = () => GET('/api/platform/resourcePrice');

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

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

export const checkUserTask = () =>
POST('/api/guide/checkTask', {
desktopToAppToken: getDesktopSessionFromSessionStorage()?.token
})
});
Loading
Loading