Skip to content

Commit

Permalink
chore: remove unused code and adjust UI
Browse files Browse the repository at this point in the history
  • Loading branch information
silenceqi committed Feb 21, 2025
1 parent 1e2f8c2 commit cf807cc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 47 deletions.
26 changes: 1 addition & 25 deletions web/src/components/InstallAgent/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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",
Expand All @@ -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"
Expand Down
8 changes: 0 additions & 8 deletions web/src/pages/Alerting/Message/Index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
12 changes: 0 additions & 12 deletions web/src/pages/Alerting/Message/components/EventDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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%"}}>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/DataManagement/View/WidgetLoader.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
position: absolute;
display: none;
right: 0px;
top: 0px;
bottom: 0px;
width: 24px;
height: 24px;
border-radius: 4px;
Expand Down
5 changes: 4 additions & 1 deletion web/src/pages/Platform/Overview/components/Logs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit cf807cc

Please sign in to comment.