chore: remove unused code and adjust UI (#159)
This commit is contained in:
parent
ca52a5b00d
commit
6c9e8d28c7
|
@ -8,7 +8,6 @@ import { formatMessage } from "umi/locale";
|
|||
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
|
||||
|
||||
export default ({autoInit = false}) => {
|
||||
const { loading, value } = useFetch(`/instance/_search`);
|
||||
|
||||
const [tokenLoading, setTokenLoading] = useState(false);
|
||||
|
||||
|
@ -18,7 +17,6 @@ export default ({autoInit = false}) => {
|
|||
|
||||
const fetchTokenInfo = async () => {
|
||||
setTokenInfo()
|
||||
// if (seletedGateways.length === 0) return;
|
||||
setTokenLoading(true)
|
||||
const res = await request('/instance/_generate_install_script', {
|
||||
method: "POST",
|
||||
|
@ -35,32 +33,10 @@ export default ({autoInit = false}) => {
|
|||
}
|
||||
}, [])
|
||||
|
||||
const gateways = value?.hits?.hits || []
|
||||
|
||||
return (
|
||||
<Spin spinning={loading || tokenLoading}>
|
||||
<Spin spinning={tokenLoading}>
|
||||
<div className={styles.installAgent}>
|
||||
{/* <Form className={styles.gateway} layout="vertical">
|
||||
<Form.Item label="选择接入网关" required>
|
||||
<Select
|
||||
mode="multiple"
|
||||
style={{ width: '100%' }}
|
||||
onChange={(value) => setSeletedGateways(value)}
|
||||
onBlur={() => fetchTokenInfo()}
|
||||
>
|
||||
{
|
||||
gateways.map((item) => (
|
||||
<Select.Option key={item._source.endpoint}>
|
||||
<span>
|
||||
<span style={{marginRight: 4}}>{item._source.name}</span>
|
||||
<span>[{item._source.endpoint}]</span>
|
||||
</span>
|
||||
</Select.Option>
|
||||
))
|
||||
}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Form> */}
|
||||
{!autoInit && <Button className={styles.gateway} type="primary" onClick={() => fetchTokenInfo()}>
|
||||
{formatMessage({
|
||||
id:"agent.install.label.get_cmd"
|
||||
|
|
|
@ -682,14 +682,6 @@ const Index = (props) => {
|
|||
gap: 10,
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
icon="redo"
|
||||
onClick={() => {
|
||||
onRefreshClick();
|
||||
}}
|
||||
>
|
||||
{formatMessage({ id: "form.button.refresh" })}
|
||||
</Button>
|
||||
{hasAuthority("alerting.message:all") ? (
|
||||
<Dropdown overlay={batchMenu}>
|
||||
<Button type="primary">
|
||||
|
|
|
@ -123,18 +123,6 @@ const MessageDetail = (props) => {
|
|||
recentlyUsedRangesKey={"rule-detail"}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
onClick={() => {
|
||||
handleTimeChange({
|
||||
start: timeRange.min,
|
||||
end: timeRange.max,
|
||||
});
|
||||
}}
|
||||
icon={"reload"}
|
||||
type="primary"
|
||||
>
|
||||
{formatMessage({ id: "form.button.refresh" })}
|
||||
</Button>
|
||||
</div>
|
||||
<div style={{marginTop: 15,display:"flex", gap: 15, marginBottom:10}}>
|
||||
<div style={{flex: "1 1 50%"}}>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
position: absolute;
|
||||
display: none;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 4px;
|
||||
|
|
|
@ -13,6 +13,7 @@ import Side from "../Side";
|
|||
import { WidgetRender } from "@/pages/DataManagement/View/WidgetLoader";
|
||||
import { cloneDeep } from "lodash";
|
||||
import { Link } from "umi";
|
||||
import InstallAgent from "@/components/InstallAgent";
|
||||
|
||||
const COLORS = {
|
||||
'INFO': '#e8eef2',
|
||||
|
@ -317,7 +318,9 @@ export default (props) => {
|
|||
<Empty
|
||||
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
description={formatMessage({ id: `cluster.monitor.logs.empty.${isAgent ? 'agent' : 'agentless'}` })}
|
||||
/>
|
||||
>
|
||||
<div style={{width: 644}}>{!isAgent && <InstallAgent autoInit={false}/>}</div>
|
||||
</Empty>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue