Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat:cronjob detail page Signed-off-by: jingyang <3161362058@qq.com> * fix * fix * sort job * pod log * code --------- Signed-off-by: jingyang <3161362058@qq.com>
- Loading branch information
Showing
39 changed files
with
10,482 additions
and
3,002 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { GET } from '@/services/request'; | ||
import { adaptAppListItem, adaptServiceAccountList } from '@/utils/adapt'; | ||
import { V1Deployment, V1ServiceAccount } from '@kubernetes/client-node'; | ||
|
||
export const getMyApps = () => | ||
GET<V1Deployment[]>('/api/launchpad/getApps').then((res) => res.map(adaptAppListItem)); | ||
|
||
export const getMyServiceAccount = () => | ||
GET<V1ServiceAccount[]>('/api/launchpad/getServiceAccount').then((res) => | ||
res.map(adaptServiceAccountList) | ||
); | ||
|
||
export const getAppByName = (name: string) => | ||
GET<V1Deployment>(`/api/launchpad/getAppByAppName?appName=${name}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { authSession } from '@/services/backend/auth'; | ||
import { getK8s } from '@/services/backend/kubernetes'; | ||
import { jsonRes } from '@/services/backend/response'; | ||
import { ApiResp } from '@/services/kubernet'; | ||
import type { NextApiRequest, NextApiResponse } from 'next'; | ||
|
||
export default async function handler(req: NextApiRequest, res: NextApiResponse<ApiResp>) { | ||
try { | ||
const { jobNames } = req.body as { | ||
jobNames: string[]; | ||
}; | ||
const labelSelector = jobNames.join(','); | ||
const { k8sCore, namespace } = await getK8s({ | ||
kubeconfig: await authSession(req) | ||
}); | ||
|
||
const response = await k8sCore.listNamespacedPod( | ||
namespace, | ||
undefined, | ||
undefined, | ||
undefined, | ||
undefined, | ||
`job-name in (${labelSelector})` | ||
); | ||
|
||
return jsonRes(res, { | ||
data: response.body | ||
}); | ||
} catch (err: any) { | ||
jsonRes(res, { | ||
code: 500, | ||
error: err | ||
}); | ||
} | ||
} |
Oops, something went wrong.