@@ -8,7 +8,6 @@ import { formatMessage } from "umi/locale";
8
8
import { getDocPathByLang , getWebsitePathByLang } from "@/utils/utils" ;
9
9
10
10
export default ( { autoInit = false } ) => {
11
- const { loading, value } = useFetch ( `/instance/_search` ) ;
12
11
13
12
const [ tokenLoading , setTokenLoading ] = useState ( false ) ;
14
13
@@ -18,7 +17,6 @@ export default ({autoInit = false}) => {
18
17
19
18
const fetchTokenInfo = async ( ) => {
20
19
setTokenInfo ( )
21
- // if (seletedGateways.length === 0) return;
22
20
setTokenLoading ( true )
23
21
const res = await request ( '/instance/_generate_install_script' , {
24
22
method : "POST" ,
@@ -35,32 +33,10 @@ export default ({autoInit = false}) => {
35
33
}
36
34
} , [ ] )
37
35
38
- const gateways = value ?. hits ?. hits || [ ]
39
36
40
37
return (
41
- < Spin spinning = { loading || tokenLoading } >
38
+ < Spin spinning = { tokenLoading } >
42
39
< 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> */ }
64
40
{ ! autoInit && < Button className = { styles . gateway } type = "primary" onClick = { ( ) => fetchTokenInfo ( ) } >
65
41
{ formatMessage ( {
66
42
id :"agent.install.label.get_cmd"
0 commit comments