Skip to content

Commit cf807cc

Browse files
committed
chore: remove unused code and adjust UI
1 parent 1e2f8c2 commit cf807cc

File tree

5 files changed

+6
-47
lines changed

5 files changed

+6
-47
lines changed

web/src/components/InstallAgent/index.js

+1-25
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { formatMessage } from "umi/locale";
88
import { getDocPathByLang, getWebsitePathByLang } from "@/utils/utils";
99

1010
export default ({autoInit = false}) => {
11-
const { loading, value } = useFetch(`/instance/_search`);
1211

1312
const [tokenLoading, setTokenLoading] = useState(false);
1413

@@ -18,7 +17,6 @@ export default ({autoInit = false}) => {
1817

1918
const fetchTokenInfo = async () => {
2019
setTokenInfo()
21-
// if (seletedGateways.length === 0) return;
2220
setTokenLoading(true)
2321
const res = await request('/instance/_generate_install_script', {
2422
method: "POST",
@@ -35,32 +33,10 @@ export default ({autoInit = false}) => {
3533
}
3634
}, [])
3735

38-
const gateways = value?.hits?.hits || []
3936

4037
return (
41-
<Spin spinning={loading || tokenLoading}>
38+
<Spin spinning={tokenLoading}>
4239
<div className={styles.installAgent}>
43-
{/* <Form className={styles.gateway} layout="vertical">
44-
<Form.Item label="选择接入网关" required>
45-
<Select
46-
mode="multiple"
47-
style={{ width: '100%' }}
48-
onChange={(value) => setSeletedGateways(value)}
49-
onBlur={() => fetchTokenInfo()}
50-
>
51-
{
52-
gateways.map((item) => (
53-
<Select.Option key={item._source.endpoint}>
54-
<span>
55-
<span style={{marginRight: 4}}>{item._source.name}</span>
56-
<span>[{item._source.endpoint}]</span>
57-
</span>
58-
</Select.Option>
59-
))
60-
}
61-
</Select>
62-
</Form.Item>
63-
</Form> */}
6440
{!autoInit && <Button className={styles.gateway} type="primary" onClick={() => fetchTokenInfo()}>
6541
{formatMessage({
6642
id:"agent.install.label.get_cmd"

web/src/pages/Alerting/Message/Index.jsx

-8
Original file line numberDiff line numberDiff line change
@@ -682,14 +682,6 @@ const Index = (props) => {
682682
gap: 10,
683683
}}
684684
>
685-
<Button
686-
icon="redo"
687-
onClick={() => {
688-
onRefreshClick();
689-
}}
690-
>
691-
{formatMessage({ id: "form.button.refresh" })}
692-
</Button>
693685
{hasAuthority("alerting.message:all") ? (
694686
<Dropdown overlay={batchMenu}>
695687
<Button type="primary">

web/src/pages/Alerting/Message/components/EventDetail.jsx

-12
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,6 @@ const MessageDetail = (props) => {
123123
recentlyUsedRangesKey={"rule-detail"}
124124
/>
125125
</div>
126-
<Button
127-
onClick={() => {
128-
handleTimeChange({
129-
start: timeRange.min,
130-
end: timeRange.max,
131-
});
132-
}}
133-
icon={"reload"}
134-
type="primary"
135-
>
136-
{formatMessage({ id: "form.button.refresh" })}
137-
</Button>
138126
</div>
139127
<div style={{marginTop: 15,display:"flex", gap: 15, marginBottom:10}}>
140128
<div style={{flex: "1 1 50%"}}>

web/src/pages/DataManagement/View/WidgetLoader.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
position: absolute;
2121
display: none;
2222
right: 0px;
23-
top: 0px;
23+
bottom: 0px;
2424
width: 24px;
2525
height: 24px;
2626
border-radius: 4px;

web/src/pages/Platform/Overview/components/Logs/index.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Side from "../Side";
1313
import { WidgetRender } from "@/pages/DataManagement/View/WidgetLoader";
1414
import { cloneDeep } from "lodash";
1515
import { Link } from "umi";
16+
import InstallAgent from "@/components/InstallAgent";
1617

1718
const COLORS = {
1819
'INFO': '#e8eef2',
@@ -317,7 +318,9 @@ export default (props) => {
317318
<Empty
318319
image={Empty.PRESENTED_IMAGE_SIMPLE}
319320
description={formatMessage({ id: `cluster.monitor.logs.empty.${isAgent ? 'agent' : 'agentless'}` })}
320-
/>
321+
>
322+
<div style={{width: 644}}>{!isAgent && <InstallAgent autoInit={false}/>}</div>
323+
</Empty>
321324
)
322325
}
323326
</div>

0 commit comments

Comments
 (0)