1
0
mirror of https://github.com/cwchristerw/bokxin-ip synced 2024-09-08 00:14:37 +00:00

Lisää DNS ip:n.

This commit is contained in:
Juho Salli 2020-11-27 14:59:55 +02:00
parent cb2655b7fd
commit 050f8a5d97

View File

@ -13,7 +13,12 @@ const IndexPage = () => {
setIp("")
if (osat.loppu === "" || osat.loppu.length !== 4) return
if (osat.loppu.slice(0, 1) !== "2" && osat.loppu.slice(0, 1) !== "3") return
if (parseInt(osat.loppu.slice(1)) >= 255 || parseInt(osat.loppu.slice(1)) === 0 || isNaN(parseInt(osat.loppu.slice(1)))) return
if (
parseInt(osat.loppu.slice(1)) >= 255 ||
parseInt(osat.loppu.slice(1)) === 0 ||
isNaN(parseInt(osat.loppu.slice(1)))
)
return
let ekanumero = ""
let loppu = osat.loppu
@ -30,8 +35,8 @@ const IndexPage = () => {
let loppuosa = ""
loppuosa = loppu.slice(1)
while(loppuosa.charAt(0) === '0'){
loppuosa = loppuosa.substr(1)
while (loppuosa.charAt(0) === "0") {
loppuosa = loppuosa.substr(1)
}
setIp(`10.22${ekanumero}.${loppuosa}.x`)
@ -94,12 +99,19 @@ const IndexPage = () => {
<br />
{ip !== "" ? `${ip} (valitse x väliltä 2-254)` : "10.22x.xxx.xxx"}
<br />
<span>
<b>Default gateway</b>
</span>
<br />
{ip !== "" ? `${ip} (x on 1)` : "10.22x.xxx.1"}
<br />
<span>
<b>DNS</b>
</span>
<br />
193.166.40.28
<br />
<br />
</div>
</Layout>
)