mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-07 13:31:43 -07:00
feat: fix ipv6 hint
This commit is contained in:
parent
4a0cdacc05
commit
a4d3b069c5
1 changed files with 51 additions and 19 deletions
|
@ -24,8 +24,7 @@ function IPv6AutoAssign({ id, v6AssignMode, handleChange }) {
|
||||||
/>
|
/>
|
||||||
<span>ZeroTier RFC4193 (/128 for each device)</span>
|
<span>ZeroTier RFC4193 (/128 for each device)</span>
|
||||||
{v6AssignMode["rfc4193"] && (
|
{v6AssignMode["rfc4193"] && (
|
||||||
<div>
|
<div style={{ marginLeft: '4rem', letterSpacing: '1px' }}>
|
||||||
<small style={{ marginLeft: '2rem', letterSpacing: '1px' }}>
|
|
||||||
<code>
|
<code>
|
||||||
fd
|
fd
|
||||||
<span style={{ backgroundColor: '#ffffcc' }}>{id.slice(0, 2)}</span>
|
<span style={{ backgroundColor: '#ffffcc' }}>{id.slice(0, 2)}</span>
|
||||||
|
@ -34,7 +33,9 @@ function IPv6AutoAssign({ id, v6AssignMode, handleChange }) {
|
||||||
:
|
:
|
||||||
<span style={{ backgroundColor: '#ffffcc' }}>{id.slice(6, 10)}</span>
|
<span style={{ backgroundColor: '#ffffcc' }}>{id.slice(6, 10)}</span>
|
||||||
:
|
:
|
||||||
<span style={{ backgroundColor: '#ffffcc' }}>{id.slice(10, 12)}</span>
|
<span style={{ backgroundColor: '#ffffcc' }}>{id.slice(10, 14)}</span>
|
||||||
|
:
|
||||||
|
<span style={{ backgroundColor: '#ffffcc' }}>{id.slice(14, 16)}</span>
|
||||||
99:93
|
99:93
|
||||||
<span style={{ backgroundColor: '#ccffff' }}>__</span>
|
<span style={{ backgroundColor: '#ccffff' }}>__</span>
|
||||||
:
|
:
|
||||||
|
@ -42,7 +43,6 @@ function IPv6AutoAssign({ id, v6AssignMode, handleChange }) {
|
||||||
:
|
:
|
||||||
<span style={{ backgroundColor: '#ccffff' }}>____</span>
|
<span style={{ backgroundColor: '#ccffff' }}>____</span>
|
||||||
</code>
|
</code>
|
||||||
</small>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -61,6 +61,38 @@ function IPv6AutoAssign({ id, v6AssignMode, handleChange }) {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<span>ZeroTier 6PLANE (/80 routable for each device)</span>
|
<span>ZeroTier 6PLANE (/80 routable for each device)</span>
|
||||||
|
{v6AssignMode["6plane"] && (
|
||||||
|
<div style={{ marginLeft: '4rem', letterSpacing: '1px' }}>
|
||||||
|
<code>
|
||||||
|
fc
|
||||||
|
{
|
||||||
|
(() => {
|
||||||
|
const sixPlaneID = id.match(/.{1,2}/g)
|
||||||
|
.map((substr, idx, arr) => parseInt(substr, 16) ^ parseInt(arr[idx + 4], 16))
|
||||||
|
.map((byte) => byte.toString(16).toLowerCase())
|
||||||
|
.map((byte) => (byte.length === 2) ? byte : '0' + byte)
|
||||||
|
.slice(0, 4)
|
||||||
|
.join('')
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<span style={{ backgroundColor: '#ffffcc' }}>{sixPlaneID.slice(0, 2)}</span>
|
||||||
|
:
|
||||||
|
<span style={{ backgroundColor: '#ffffcc' }}>{sixPlaneID.slice(2, 6)}</span>
|
||||||
|
:
|
||||||
|
<span style={{ backgroundColor: '#ffffcc' }}>{sixPlaneID.slice(6, 8)}</span>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
})()
|
||||||
|
}
|
||||||
|
<span style={{ backgroundColor: '#ccffff' }}>__</span>
|
||||||
|
:
|
||||||
|
<span style={{ backgroundColor: '#ccffff' }}>____</span>
|
||||||
|
:
|
||||||
|
<span style={{ backgroundColor: '#ccffff' }}>____</span>
|
||||||
|
:0000:0000:0001
|
||||||
|
</code>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{/* TODO: Implement v6 ipAssignmentPools, might break ipv4 pool settings */}
|
{/* TODO: Implement v6 ipAssignmentPools, might break ipv4 pool settings */}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue