-
+
+
+
-
+
);
};
diff --git a/frontend/plugins/kubepanel/src/pages/kubepanel/index.tsx b/frontend/plugins/kubepanel/src/pages/kubepanel/index.tsx
index a8e692fbab9..1b89f7aa771 100644
--- a/frontend/plugins/kubepanel/src/pages/kubepanel/index.tsx
+++ b/frontend/plugins/kubepanel/src/pages/kubepanel/index.tsx
@@ -10,6 +10,8 @@ import PersistentVolumeClaimOverviewPage from './components/kube-object/storage/
import { FloatButton } from 'antd';
import CreateResourceModal from './components/modal/create-resource-modal';
import { PlusOutlined } from '@ant-design/icons';
+import SecretOverviewPage from './components/kube-object/config/secret/secret';
+import IngressOverviewPage from './components/kube-object/network/ingress/ingress';
const switchPage = (key: SideNavItemKey): React.ReactNode => {
switch (key) {
@@ -25,6 +27,10 @@ const switchPage = (key: SideNavItemKey): React.ReactNode => {
return
;
case SideNavItemKey.PersistentVolumeClaim:
return
;
+ case SideNavItemKey.Secret:
+ return
;
+ case SideNavItemKey.Ingress:
+ return
;
default:
return
;
}
@@ -39,6 +45,8 @@ const Home = () => {
{switchPage(sideNavItemKey)}
}
+ tooltip="Create a resource."
+ style={{ left: 24, bottom: 30, width: 48, height: 48 }}
type="primary"
onClick={() => setOpenCreateResourceModal(true)}
/>
diff --git a/frontend/plugins/kubepanel/src/services/backend/api.ts b/frontend/plugins/kubepanel/src/services/backend/api.ts
index d62cdd85310..5ea341e2e47 100644
--- a/frontend/plugins/kubepanel/src/services/backend/api.ts
+++ b/frontend/plugins/kubepanel/src/services/backend/api.ts
@@ -3,7 +3,7 @@ import { merge } from 'lodash';
import { Options, get, post, delete as delete_, put } from 'request';
type ApiPrefix = 'api' | 'apis';
-type ApiGroup = 'apps';
+type ApiGroup = string;
type ApiVersion = 'v1';
export interface KubeApiUrlParams {
@@ -132,7 +132,6 @@ export const updateResource = async (
namespace: urlParams.namespace
}
});
- console.log(url);
return new Promise((resolve, reject) => {
try {
put(url, { body: data, ...opts }, (error, response, body) => {
diff --git a/frontend/plugins/kubepanel/src/store/k8s/event.store.ts b/frontend/plugins/kubepanel/src/store/k8s/event.store.ts
new file mode 100644
index 00000000000..c3f09e518bf
--- /dev/null
+++ b/frontend/plugins/kubepanel/src/store/k8s/event.store.ts
@@ -0,0 +1,8 @@
+import { KubeEvent } from '@/k8slens/kube-object';
+import { create } from 'zustand';
+import { createKubeStoreSlice } from './kube.store';
+import { EventStore } from '@/types/state';
+
+export const useEventStore = create
()((...a) => ({
+ ...createKubeStoreSlice(KubeEvent.kind)(...a)
+}));
diff --git a/frontend/plugins/kubepanel/src/store/k8s/ingress.store.ts b/frontend/plugins/kubepanel/src/store/k8s/ingress.store.ts
new file mode 100644
index 00000000000..19569cc66c9
--- /dev/null
+++ b/frontend/plugins/kubepanel/src/store/k8s/ingress.store.ts
@@ -0,0 +1,8 @@
+import { IngressStore } from '@/types/state';
+import { create } from 'zustand';
+import { createKubeStoreSlice } from './kube.store';
+import { Ingress } from '@/k8slens/kube-object';
+
+export const useIngressStore = create()((...a) => ({
+ ...createKubeStoreSlice(Ingress.kind)(...a)
+}));
diff --git a/frontend/plugins/kubepanel/src/store/k8s/secret.store.ts b/frontend/plugins/kubepanel/src/store/k8s/secret.store.ts
new file mode 100644
index 00000000000..45f933c734a
--- /dev/null
+++ b/frontend/plugins/kubepanel/src/store/k8s/secret.store.ts
@@ -0,0 +1,8 @@
+import { Secret } from '@/k8slens/kube-object';
+import { create } from 'zustand';
+import { createKubeStoreSlice } from './kube.store';
+import { SecretStore } from '@/types/state';
+
+export const useSecretStore = create()((...a) => ({
+ ...createKubeStoreSlice(Secret.kind)(...a)
+}));
diff --git a/frontend/plugins/kubepanel/src/store/kube.ts b/frontend/plugins/kubepanel/src/store/kube.ts
index 8f7ce5e9a9f..7a06c6ae19a 100644
--- a/frontend/plugins/kubepanel/src/store/kube.ts
+++ b/frontend/plugins/kubepanel/src/store/kube.ts
@@ -3,4 +3,6 @@ export * from './k8s/deployment.store';
export * from './k8s/stateful-set.store';
export * from './k8s/config-map.store';
export * from './k8s/volume-claim.store';
+export * from './k8s/ingress.store';
+export * from './k8s/secret.store';
export * from './k8s/kube.store';
diff --git a/frontend/plugins/kubepanel/src/types/detail.d.ts b/frontend/plugins/kubepanel/src/types/detail.d.ts
new file mode 100644
index 00000000000..f24a69588c3
--- /dev/null
+++ b/frontend/plugins/kubepanel/src/types/detail.d.ts
@@ -0,0 +1,7 @@
+import { KubeObject } from '@/k8slens/kube-object';
+
+type DetailDrawerProps = {
+ obj?: K;
+ onClose: () => void;
+ open: boolean;
+};
diff --git a/frontend/plugins/kubepanel/src/types/state.d.ts b/frontend/plugins/kubepanel/src/types/state.d.ts
index a7b133b2940..9dde82e067e 100644
--- a/frontend/plugins/kubepanel/src/types/state.d.ts
+++ b/frontend/plugins/kubepanel/src/types/state.d.ts
@@ -1,33 +1,38 @@
import {
- ConfigMap,
- Deployment,
- KubeObject,
- PersistentVolumeClaim,
- Pod,
- StatefulSet
- } from '@/k8slens/kube-object';
-
- type KubeStoreState = {
- items: Array;
- kind: K['kind'];
- isLoaded: boolean;
- };
- type KubeStoreAction = {
- modify: (item: K) => void;
- remove: (item: K) => void;
- replace: (items: K[]) => void;
- setIsLoaded: (isLoaded: boolean) => void;
- };
-
- type KubeStore = KubeStoreState & KubeStoreAction;
-
- type StatusesComputed = {
- getStatuses: Record;
- };
-
- type PodStore = KubeStore;
- type DeploymentStore = KubeStore;
- type StatefulSetStore = KubeStore;
- type ConfigMapStore = KubeStore;
- type VolumeClaimStore = KubeStore;
-
\ No newline at end of file
+ ConfigMap,
+ Deployment,
+ Ingress,
+ KubeEvent,
+ KubeObject,
+ PersistentVolumeClaim,
+ Pod,
+ Secret,
+ StatefulSet
+} from '@/k8slens/kube-object';
+
+type KubeStoreState = {
+ items: Array;
+ kind: K['kind'];
+ isLoaded: boolean;
+};
+type KubeStoreAction = {
+ modify: (item: K) => void;
+ remove: (item: K) => void;
+ replace: (items: K[]) => void;
+ setIsLoaded: (isLoaded: boolean) => void;
+};
+
+type KubeStore = KubeStoreState & KubeStoreAction;
+
+type StatusesComputed = {
+ getStatuses: Record;
+};
+
+type PodStore = KubeStore;
+type DeploymentStore = KubeStore;
+type StatefulSetStore = KubeStore;
+type ConfigMapStore = KubeStore;
+type VolumeClaimStore = KubeStore;
+type SecretStore = KubeStore;
+type IngressStore = KubeStore;
+type EventStore = KubeStore;