-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: rename the plugin from Monitor to Kube Panel and update UI sty…
…le (#4269) * feat: lens demo of web version * chore: add & remove some packages * fix: connect to desktop bug and change icon * init: plugin Monitor init * style: restore frontend/pnpm-workspace.yaml & pnpm-lock.yaml and create new ones in plugins/monitor * restore: frontend/Makefile * restore: frontend/pnpm-workspace.yaml * restore * style: rename the plugin from Monitor to Kube Panel * style: update ui style
- Loading branch information
Showing
188 changed files
with
425 additions
and
362 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
3 changes: 3 additions & 0 deletions
3
frontend/plugins/monitor/pnpm-lock.yaml → frontend/plugins/kubepanel/pnpm-lock.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
frontend/plugins/kubepanel/src/pages/kubepanel/components/drawer/drawer-panel.tsx
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,17 @@ | ||
import DrawerTitle from './drawer-title'; | ||
|
||
interface Props { | ||
title?: React.ReactNode; | ||
children: React.ReactNode; | ||
} | ||
|
||
const DrawerPanel = ({ title, children }: Props) => { | ||
return ( | ||
<div className="pb-2"> | ||
{title && typeof title === 'string' ? <DrawerTitle>{title}</DrawerTitle> : title} | ||
<div className="px-7">{children}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DrawerPanel; |
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
File renamed without changes.
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
70 changes: 70 additions & 0 deletions
70
...ins/kubepanel/src/pages/kubepanel/components/storage/volume-claim/volume-claim-detail.tsx
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,70 @@ | ||
import { PersistentVolumeClaim, Pod } from '@/k8slens/kube-object'; | ||
import Drawer from '../../drawer/drawer'; | ||
import { KubeObjectInfoList } from '@/components/kube/object/detail/kube-object-detail-info-list'; | ||
import { KubeRecord } from '@/components/kube/kube-record'; | ||
import { KubeBadge } from '@/components/kube/kube-badge'; | ||
import React from 'react'; | ||
import DrawerPanel from '../../drawer/drawer-panel'; | ||
|
||
interface Props { | ||
volumeClaim?: PersistentVolumeClaim; | ||
pods: Pod[]; | ||
open: boolean; | ||
onClose: () => void; | ||
} | ||
const PersistentVolumeClaimDetail = ({ volumeClaim, pods, open, onClose }: Props) => { | ||
if (!volumeClaim) return null; | ||
|
||
if (!(volumeClaim instanceof PersistentVolumeClaim)) { | ||
// logger.error("[PersistentVolumeClaimDetail]: passed object that is not an instanceof PersistentVolumeClaim", volumeClaim); | ||
|
||
return null; | ||
} | ||
|
||
const { storageClassName, accessModes } = volumeClaim.spec; | ||
|
||
// const storageClassDetailsUrl = getDetailsUrl(storageClassApi.formatUrlForNotListing({ | ||
// name: storageClassName, | ||
// })); | ||
|
||
return ( | ||
<Drawer open={open} title={`PersistentVolumeClaim: ${volumeClaim.getName()}`} onClose={onClose}> | ||
<DrawerPanel> | ||
<KubeObjectInfoList obj={volumeClaim} /> | ||
<KubeRecord name={'Access Modes'} value={accessModes?.join(', ')} /> | ||
<KubeRecord name="Storage Class Names" value={storageClassName} /> | ||
<KubeRecord name="Storage" value={volumeClaim.getStorage()} /> | ||
<KubeRecord | ||
name="Pods" | ||
value={volumeClaim.getPods(pods).map((pod) => ( | ||
<span key={pod.getName()} className="mr-1"> | ||
{pod.getName()} | ||
</span> | ||
))} | ||
/> | ||
<KubeRecord name="Status" value={volumeClaim.getStatus()} /> | ||
</DrawerPanel> | ||
|
||
<DrawerPanel title="Selector"> | ||
<KubeRecord | ||
name="Match Labels" | ||
value={volumeClaim.getMatchLabels().map((label) => ( | ||
<KubeBadge key={label} label={label} /> | ||
))} | ||
/> | ||
<KubeRecord | ||
name="Match Expressions" | ||
value={volumeClaim.getMatchExpressions().map(({ key, operator, values }, i) => ( | ||
<React.Fragment key={i}> | ||
<KubeRecord name="Key" value={key} /> | ||
<KubeRecord name="Operator" value={operator} /> | ||
<KubeRecord name="Values" value={values?.join(', ')} /> | ||
</React.Fragment> | ||
))} | ||
/> | ||
</DrawerPanel> | ||
</Drawer> | ||
); | ||
}; | ||
|
||
export default PersistentVolumeClaimDetail; |
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
40 changes: 40 additions & 0 deletions
40
frontend/plugins/kubepanel/src/pages/kubepanel/components/table/table.tsx
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,40 @@ | ||
import { ConfigProvider, TableProps } from 'antd'; | ||
import { Table as AntdTable } from 'antd'; | ||
import { blue } from '@ant-design/colors'; | ||
|
||
type DefaultRecordType = Record<string, any>; | ||
type PanelRender<RecordType> = (data: readonly RecordType[]) => React.ReactNode; | ||
|
||
interface Props<RecordType = unknown> extends Omit<TableProps<RecordType>, 'title'> { | ||
title?: string | PanelRender<RecordType>; | ||
} | ||
|
||
const TableStringTile = ({ title }: { title: string }) => { | ||
return <span className="p-4 mb-4 text-xl font-light">{title}</span>; | ||
}; | ||
|
||
function Table<RecordType extends DefaultRecordType>(tableProps: Props<RecordType>) { | ||
const { scroll = { x: true }, pagination = false, title } = tableProps; | ||
|
||
return ( | ||
<ConfigProvider | ||
theme={{ | ||
components: { | ||
Table: { | ||
rowHoverBg: blue[0] | ||
} | ||
} | ||
}} | ||
> | ||
<AntdTable | ||
{...tableProps} | ||
rowClassName="cursor-pointer" | ||
title={typeof title === 'string' ? () => <TableStringTile title={title} /> : title} | ||
scroll={scroll} | ||
pagination={pagination} | ||
/> | ||
</ConfigProvider> | ||
); | ||
} | ||
|
||
export default Table; |
Oops, something went wrong.