Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
Hetzner-NewGeneration
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Hetzner-NewGeneration
Commits
ae409654
Commit
ae409654
authored
Mar 11, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update app.js
parent
506c79e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
app.js
app.js
+18
-17
No files found.
app.js
View file @
ae409654
...
...
@@ -150,33 +150,34 @@ function postRequest() {
});
}
async
function
calculateSpeed
()
{
async
function
calculateSpeed
()
{
let
d
=
await
shellExec
(
'
vnstat -tr
'
)
d
=
d
.
stdout
let
d
=
await
shellExec
(
'
vnstat -tr
'
)
d
=
d
.
stdout
d
=
d
.
match
(
decimalPointRegex
)
let
arr
=
d
.
match
(
decimalPointRegex
)
if
(
d
.
includes
(
'
kbit/s
'
))
{
d
[
0
]
=
1
d
[
1
]
=
1
}
else
if
(
d
.
includes
(
'
Mbit/s
'
))
{
}
else
if
(
d
.
includes
(
'
Gbit/s
'
))
{
d
[
0
]
=
d
[
0
]
*
1000
d
[
1
]
=
d
[
1
]
*
1000
}
else
if
(
d
.
includes
(
'
bit/s
'
))
{
d
[
0
]
=
1
d
[
1
]
=
1
}
if
(
d
.
includes
(
'
kbit/s
'
))
{
arr
[
0
]
=
1
arr
[
1
]
=
1
}
else
if
(
d
.
includes
(
'
Mbit/s
'
))
{
}
else
if
(
d
.
includes
(
'
Gbit/s
'
))
{
arr
[
0
]
=
arr
[
0
]
*
1000
arr
[
1
]
=
arr
[
1
]
*
1000
}
else
if
(
d
.
includes
(
'
bit/s
'
))
{
arr
[
0
]
=
1
arr
[
1
]
=
1
}
await
sendRate
(
d
[
0
],
d
[
1
])
await
sendRate
(
arr
[
0
],
arr
[
1
])
}
}
function
sendRate
(
rx
,
tx
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment