Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Aruba-Master
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
Aruba-Master
Commits
c24b1790
Commit
c24b1790
authored
Apr 16, 2020
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
3d990ba1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
40 deletions
+12
-40
app.js
app.js
+11
-29
aruba.js
aruba.js
+1
-11
No files found.
app.js
View file @
c24b1790
...
...
@@ -2,7 +2,7 @@ let groups = 0
let
generation
=
0
const
express
=
require
(
'
express
'
)
const
app
=
express
()
const
port
=
4
000
const
port
=
3
000
const
shell
=
require
(
'
shelljs
'
)
const
cron
=
require
(
'
node-cron
'
);
const
cronRemover
=
require
(
'
node-cron
'
);
...
...
@@ -29,25 +29,7 @@ app.get('/ip/:ip/', (req, res) => {
return
addNewIp
(
req
,
res
)
})
//
// app.get('/add/:num/', (req, res) => {
// // console.log(req.params.acc)
// return newFloatingIpsOrder(req, res)
//
// })
//
// app.get('/del/', (req, res) => {
// // console.log(req.params.acc)
// res.send('Done')
// het.removeAllFloatingIps()
//
// })
//
// app.get('/test', (req, res) => {
// // console.log(req.params.acc)
// res.sendfile('jetmtp.png')
//
// })
...
...
@@ -79,7 +61,7 @@ cron.schedule('*/10 * * * * *', () => {
});
postRequest
()
cronRemover
.
schedule
(
'
*/
15
* * * *
'
,
()
=>
{
cronRemover
.
schedule
(
'
*/
2
* * * *
'
,
()
=>
{
init
()
});
...
...
@@ -247,24 +229,24 @@ async function calculateSpeed() {
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
arr
[
0
]
=
1
arr
[
1
]
=
1
}
else
if
(
d
.
includes
(
'
Mbit/s
'
))
{
}
else
if
(
d
.
includes
(
'
Gbit/s
'
))
{
d
[
0
]
=
d
[
0
]
*
1000
d
[
1
]
=
d
[
1
]
*
1000
arr
[
0
]
=
arr
[
0
]
*
1000
arr
[
1
]
=
arr
[
1
]
*
1000
}
else
if
(
d
.
includes
(
'
bit/s
'
))
{
d
[
0
]
=
1
d
[
1
]
=
1
arr
[
0
]
=
1
arr
[
1
]
=
1
}
await
sendRate
(
d
[
0
],
d
[
1
])
await
sendRate
(
arr
[
0
],
arr
[
1
])
}
...
...
aruba.js
View file @
c24b1790
...
...
@@ -13,17 +13,7 @@ let serverId
async
function
test
()
{
// getNewIp('b.','1','EU-West-1')
// await init()
// console.log(foundDc)
// let d=await unAttachedToServer(1,)
// for(let i=0;i<10;i++)
// {
// let f= await createFloatingIp(1)
// console.log(f)
// }
// let ips = await getAllIps(1)
// console.log(ips)
await
deleteAllIps
(
1
)
}
...
...
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