Update load IOS switch
This commit is contained in:
parent
f160cd2905
commit
e14d4ca216
|
|
@ -1146,6 +1146,13 @@ export default class LineConnection {
|
||||||
repeat: '1',
|
repeat: '1',
|
||||||
note: '',
|
note: '',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
expect: '#',
|
||||||
|
send: `show version`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
expect: '#',
|
expect: '#',
|
||||||
send: `configure terminal`,
|
send: `configure terminal`,
|
||||||
|
|
@ -1205,76 +1212,6 @@ export default class LineConnection {
|
||||||
const timeZone = process.env.TIME_ZONE || 'Australia/Sydney'
|
const timeZone = process.env.TIME_ZONE || 'Australia/Sydney'
|
||||||
const startTime = momentTZ().tz(timeZone).format('YYYY/MM/DD, HH:mm:ss')
|
const startTime = momentTZ().tz(timeZone).format('YYYY/MM/DD, HH:mm:ss')
|
||||||
const body = [
|
const body = [
|
||||||
{
|
|
||||||
expect: '',
|
|
||||||
send: ``,
|
|
||||||
delay: '1',
|
|
||||||
repeat: '1',
|
|
||||||
note: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
expect: '',
|
|
||||||
send: `IP_ADDRESS=${a}.${b}.100.${this.config.id < 254 ? this.config.id : 254 - this.config.id}`,
|
|
||||||
delay: '1',
|
|
||||||
repeat: '1',
|
|
||||||
note: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
expect: 'switch:',
|
|
||||||
send: `IP_SUBNET_MASK=255.255.0.0`,
|
|
||||||
delay: '1',
|
|
||||||
repeat: '1',
|
|
||||||
note: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
expect: 'switch:',
|
|
||||||
send: `DEFAULT_GATEWAY=${station?.gateway ? station?.gateway : '0.0.0.0'}`,
|
|
||||||
delay: '1',
|
|
||||||
repeat: '1',
|
|
||||||
note: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
expect: 'switch:',
|
|
||||||
send: `TFTP_SERVER=${station?.tftp_ip}`,
|
|
||||||
delay: '1',
|
|
||||||
repeat: '1',
|
|
||||||
note: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
expect: 'switch:',
|
|
||||||
send: `TFTP_FILE=ios/${nameIos}`,
|
|
||||||
delay: '1',
|
|
||||||
repeat: '1',
|
|
||||||
note: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
expect: 'switch:',
|
|
||||||
send: `tftpdnld`,
|
|
||||||
delay: '1',
|
|
||||||
repeat: '1',
|
|
||||||
note: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
expect: 'y/n',
|
|
||||||
send: `y`,
|
|
||||||
delay: '2',
|
|
||||||
repeat: '1',
|
|
||||||
note: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
expect: 'switch:',
|
|
||||||
send: `boot flash:${nameIos}`,
|
|
||||||
delay: '1',
|
|
||||||
repeat: '1',
|
|
||||||
note: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
expect: 'Press RETURN to get started',
|
|
||||||
send: ``,
|
|
||||||
delay: '1',
|
|
||||||
repeat: '1',
|
|
||||||
note: '',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
expect: '',
|
expect: '',
|
||||||
send: ``,
|
send: ``,
|
||||||
|
|
@ -1296,9 +1233,79 @@ export default class LineConnection {
|
||||||
repeat: '1',
|
repeat: '1',
|
||||||
note: '',
|
note: '',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
expect: '#',
|
||||||
|
send: `interface vlan 1`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '#',
|
||||||
|
send: `ip address ${a}.${b}.100.${this.config.id < 254 ? this.config.id : 254 - this.config.id} 255.255.0.0`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '#',
|
||||||
|
send: `no shutdown`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '#',
|
||||||
|
send: `end`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '#',
|
||||||
|
send: `copy tftp: flash:`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
expect: '',
|
expect: '',
|
||||||
send: `boot system usbflash0:${nameIos}`,
|
send: `${station?.tftp_ip}`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '',
|
||||||
|
send: `ios/${nameIos}`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '',
|
||||||
|
send: ``,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '',
|
||||||
|
send: ``,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '#',
|
||||||
|
send: `configure terminal`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '#',
|
||||||
|
send: `boot system flash:${nameIos}`,
|
||||||
delay: '1',
|
delay: '1',
|
||||||
repeat: '1',
|
repeat: '1',
|
||||||
note: '',
|
note: '',
|
||||||
|
|
@ -1317,6 +1324,13 @@ export default class LineConnection {
|
||||||
repeat: '1',
|
repeat: '1',
|
||||||
note: '',
|
note: '',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
expect: '',
|
||||||
|
send: `reload`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
expect: '',
|
expect: '',
|
||||||
send: ``,
|
send: ``,
|
||||||
|
|
@ -1324,6 +1338,34 @@ export default class LineConnection {
|
||||||
repeat: '1',
|
repeat: '1',
|
||||||
note: '',
|
note: '',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
expect: 'Press RETURN to get started!',
|
||||||
|
send: ``,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '',
|
||||||
|
send: ``,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '',
|
||||||
|
send: `enable`,
|
||||||
|
delay: '3',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expect: '#',
|
||||||
|
send: `show version`,
|
||||||
|
delay: '1',
|
||||||
|
repeat: '1',
|
||||||
|
note: '',
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const script = {
|
const script = {
|
||||||
|
|
|
||||||
|
|
@ -539,7 +539,7 @@ const ModalTerminal = ({
|
||||||
/>
|
/>
|
||||||
General
|
General
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab w={"50%"} value="messages">
|
<Tabs.Tab w={"50%"} value="physical">
|
||||||
<IconPlug
|
<IconPlug
|
||||||
color="green"
|
color="green"
|
||||||
size={16}
|
size={16}
|
||||||
|
|
@ -933,7 +933,7 @@ const ModalTerminal = ({
|
||||||
</Flex>
|
</Flex>
|
||||||
</Tabs.Panel>
|
</Tabs.Panel>
|
||||||
|
|
||||||
<Tabs.Panel value="messages">
|
<Tabs.Panel value="physical">
|
||||||
<fieldset
|
<fieldset
|
||||||
style={{
|
style={{
|
||||||
marginTop: "12px",
|
marginTop: "12px",
|
||||||
|
|
@ -943,26 +943,30 @@ const ModalTerminal = ({
|
||||||
<Flex>
|
<Flex>
|
||||||
<Text>
|
<Text>
|
||||||
List ports{" "}
|
List ports{" "}
|
||||||
{line?.ports?.length
|
{line?.runningPhysical
|
||||||
? `(${line?.listPortsPhysical?.length}/${line?.ports?.length})`
|
? `(${line?.listPortsPhysical?.length || 0}/${
|
||||||
|
line?.ports?.length || 0
|
||||||
|
})`
|
||||||
: ""}
|
: ""}
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</legend>
|
</legend>
|
||||||
<ScrollArea h={"50vh"} p={"4px"}>
|
<ScrollArea h={"50vh"} p={"4px"}>
|
||||||
<Flex wrap={"wrap"} gap={"xs"}>
|
<Flex wrap={"wrap"} gap={"xs"}>
|
||||||
{line?.ports?.map((port, i) => (
|
{line?.runningPhysical && line?.ports
|
||||||
<Text
|
? line?.ports?.map((port, i) => (
|
||||||
key={i}
|
<Text
|
||||||
c={
|
key={i}
|
||||||
line?.listPortsPhysical?.includes(port)
|
c={
|
||||||
? "#19bc4f"
|
line?.listPortsPhysical?.includes(port)
|
||||||
: "#dedede"
|
? "#19bc4f"
|
||||||
}
|
: "#dedede"
|
||||||
>
|
}
|
||||||
{port}
|
>
|
||||||
</Text>
|
{port}
|
||||||
))}
|
</Text>
|
||||||
|
))
|
||||||
|
: ""}
|
||||||
</Flex>
|
</Flex>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue