mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-03 02:52:08 +08:00
kafka-manager 2.0
This commit is contained in:
36
kafka-manager-console/src/container/wrapper/custom-modal.tsx
Normal file
36
kafka-manager-console/src/container/wrapper/custom-modal.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import * as React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import { modal } from 'store/modal';
|
||||
import { ConnectTopicList } from '../modal/connect-topic-list';
|
||||
import { ConnectAppList } from '../modal/offline-app-modal';
|
||||
import { CancelTopicPermission } from 'container/modal/cancel-topic-permission';
|
||||
import { OfflineClusterModal } from 'container/modal/offline-cluster-modal';
|
||||
import { RenderOrderOpResult } from 'container/modal/order';
|
||||
|
||||
@observer
|
||||
export default class AllCustomModalInOne extends React.Component {
|
||||
public render() {
|
||||
if (!modal.modalId && !modal.drawerId) return null;
|
||||
return (
|
||||
<>
|
||||
{drawerMap[modal.drawerId] || null}
|
||||
{modalMap[modal.modalId] || null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const modalMap = {
|
||||
offlineTopicModal: <ConnectTopicList />,
|
||||
offlineAppModal: <ConnectAppList />,
|
||||
cancelTopicPermission: <CancelTopicPermission />,
|
||||
offlineClusterModal: <OfflineClusterModal />,
|
||||
orderOpResult: <RenderOrderOpResult />,
|
||||
} as {
|
||||
[key: string]: JSX.Element;
|
||||
};
|
||||
|
||||
const drawerMap = {
|
||||
} as {
|
||||
[key: string]: JSX.Element;
|
||||
};
|
||||
103
kafka-manager-console/src/container/wrapper/index.less
Normal file
103
kafka-manager-console/src/container/wrapper/index.less
Normal file
@@ -0,0 +1,103 @@
|
||||
.ml-5 {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.order-detail {
|
||||
.ant-collapse-header {
|
||||
font-size: 15px;
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
.b-container {
|
||||
text-align: right;
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.2);
|
||||
// margin-top: 20px;
|
||||
.ant-col-14 {
|
||||
width: 100%;
|
||||
button {
|
||||
margin: 20px 10px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.u-password {
|
||||
width: 100%;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.t-expand {
|
||||
.ant-input,
|
||||
.ant-select {
|
||||
width: 87%;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-collapse > .ant-collapse-item {
|
||||
border: none;
|
||||
}
|
||||
.ruleArea {
|
||||
border: 1px solid #eaeefb;
|
||||
border-radius: 4px;
|
||||
transition: 0.2s;
|
||||
width: 380px;
|
||||
padding: 15px 2px 0 17px;
|
||||
margin-bottom: 17px;
|
||||
&:hover {
|
||||
box-shadow: 0px 0px 2px 0px #afafaf;
|
||||
}
|
||||
.label {
|
||||
display: inline-block;
|
||||
width: 72px;
|
||||
margin-top: 10px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.t-input {
|
||||
display: inline-block;
|
||||
width: 72%;
|
||||
}
|
||||
|
||||
.region_style {
|
||||
width: 100%;
|
||||
li {
|
||||
float: left;
|
||||
padding: 8px;
|
||||
border-radius: 9px;
|
||||
margin: 0px 5px 9px 0px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
&.success {
|
||||
background-color: rgba(47, 194, 91, 0.2);
|
||||
color: #2fc25b;
|
||||
}
|
||||
&.fail {
|
||||
background: rgb(241, 243, 243);
|
||||
color: #f5222d;
|
||||
}
|
||||
&.executing {
|
||||
background: rgb(190, 214, 203);
|
||||
color: rgb(112, 164, 189);
|
||||
}
|
||||
&.cancel {
|
||||
background: rgb(241, 226, 148);
|
||||
color: rgb(177, 174, 174);
|
||||
}
|
||||
&.pending {
|
||||
background: linear-gradient(
|
||||
to top right,
|
||||
rgba(47, 194, 91, 0.2) 60%,
|
||||
#fff 40%
|
||||
);
|
||||
color: #2fc25b;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-input-affix-wrapper .ant-input-disabled ~ .ant-input-suffix .icon-color {
|
||||
color: @primary-color;
|
||||
}
|
||||
|
||||
.question-icon {
|
||||
color: @primary-color;
|
||||
margin-left: 15px;
|
||||
}
|
||||
29
kafka-manager-console/src/container/wrapper/index.tsx
Normal file
29
kafka-manager-console/src/container/wrapper/index.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import * as React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import { wrapper } from 'store/wrapper';
|
||||
import { XFormWrapper } from 'component/x-form-wrapper';
|
||||
|
||||
import './index.less';
|
||||
|
||||
@observer
|
||||
export default class AllWrapperInOne extends React.Component {
|
||||
public changeXFormWrapperlVisible(visible: boolean) {
|
||||
wrapper.setXFormWrapper({ ...wrapper.xFormWrapper, visible });
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
wrapper.setXFormWrapperRef(null);
|
||||
wrapper.setXFormWrapper(null);
|
||||
}
|
||||
|
||||
public render() {
|
||||
return wrapper.xFormWrapper && wrapper.xFormWrapper.visible ?
|
||||
(
|
||||
<XFormWrapper
|
||||
ref={form => wrapper.setXFormWrapperRef(form)}
|
||||
onChangeVisible={this.changeXFormWrapperlVisible}
|
||||
{...wrapper.xFormWrapper}
|
||||
/>
|
||||
) : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user