feat: add instance view
This commit is contained in:
@@ -47,6 +47,7 @@ const NO_CONTAINER_PAGES = [
|
||||
'clusterDetail',
|
||||
'clusterCreate',
|
||||
'benchmarkDetail',
|
||||
'deployment',
|
||||
'video'
|
||||
];
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import { PageContainerInner } from '@/pages/_components/page-box';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Segmented, Tabs } from 'antd';
|
||||
import { useMemo, useState } from 'react';
|
||||
import ModelView from './index';
|
||||
import InstanceView from './instance-view';
|
||||
|
||||
const TabsValueMap = {
|
||||
ModelView: 'modelView',
|
||||
InstanceView: 'instanceView'
|
||||
};
|
||||
|
||||
const Playground: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const [activeKey, setActiveKey] = useState(TabsValueMap.ModelView);
|
||||
|
||||
const header = useMemo(() => {
|
||||
return {
|
||||
title: (
|
||||
<div className="flex items-center">
|
||||
<span className="font-600">
|
||||
{intl.formatMessage({ id: 'menu.models.deployment' })}
|
||||
</span>
|
||||
<Segmented
|
||||
options={[
|
||||
{
|
||||
label: 'Model View',
|
||||
value: TabsValueMap.ModelView,
|
||||
icon: <IconFont type={'icon-models'}></IconFont>
|
||||
},
|
||||
{
|
||||
label: 'Instance View',
|
||||
value: TabsValueMap.InstanceView,
|
||||
icon: <IconFont type={'icon-database'}></IconFont>
|
||||
}
|
||||
]}
|
||||
size="middle"
|
||||
className="m-l-24 font-600"
|
||||
value={activeKey}
|
||||
onChange={(key) => setActiveKey(key)}
|
||||
></Segmented>
|
||||
</div>
|
||||
)
|
||||
};
|
||||
}, [activeKey, intl]);
|
||||
|
||||
return (
|
||||
<PageContainerInner header={header}>
|
||||
<Tabs
|
||||
renderTabBar={() => <></>}
|
||||
items={[
|
||||
{
|
||||
key: TabsValueMap.ModelView,
|
||||
label: 'Model View',
|
||||
children: <ModelView></ModelView>
|
||||
},
|
||||
{
|
||||
key: TabsValueMap.InstanceView,
|
||||
label: 'Instance View',
|
||||
children: <InstanceView></InstanceView>
|
||||
}
|
||||
]}
|
||||
activeKey={activeKey}
|
||||
></Tabs>
|
||||
</PageContainerInner>
|
||||
);
|
||||
};
|
||||
|
||||
export default Playground;
|
||||
@@ -0,0 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
const InstanceView: React.FC = () => {
|
||||
return <div>InstanceView</div>;
|
||||
};
|
||||
|
||||
export default InstanceView;
|
||||
@@ -25,7 +25,7 @@
|
||||
position: relative;
|
||||
padding: 0 4px;
|
||||
border-radius: var(--border-radius-mini);
|
||||
font-weight: var(--font-weight-500);
|
||||
color: var(--ant-color-text-tertiary);
|
||||
}
|
||||
|
||||
.actions {
|
||||
|
||||
Reference in New Issue
Block a user