README upgrade
parent
538319ac71
commit
b5f33685aa
|
@ -196,6 +196,8 @@ v2:
|
|||
v2.1 On going :
|
||||
|
||||
- [x] Add Network usage
|
||||
- [x] Add boot time
|
||||
- [x] Update dynamically Progress Bar
|
||||
|
||||
Next:
|
||||
|
||||
|
|
10
app.py
10
app.py
|
@ -23,6 +23,10 @@ def get_remote(hostname, port, username, password, local_script_path, remote_scr
|
|||
finally:
|
||||
ssh.close()
|
||||
|
||||
def get_boot_time(psboot):
|
||||
boot_time = datetime.fromtimestamp(psboot - 60)
|
||||
return str(boot_time)
|
||||
|
||||
def get_full(node):
|
||||
remote_info = get_remote(node, ssh_conf.port, ssh_conf.username, ssh_conf.password, paths.agent_path, paths.remote_path)
|
||||
full = eval(remote_info)
|
||||
|
@ -32,12 +36,14 @@ def get_full(node):
|
|||
def get_info():
|
||||
node = 'localhost'
|
||||
full = get_full(node)
|
||||
return render_template('index.html', full = full, client = client, titre = flask_conf.title, node = node)
|
||||
boottime = get_boot_time(full['boot_time'])
|
||||
return render_template('index.html', full = full, client = client, titre = flask_conf.title, node = node, boottime = boottime)
|
||||
|
||||
@app.route("/n/<node>", methods = ['POST', 'GET'])
|
||||
def get_node_info(node):
|
||||
full = get_full(node)
|
||||
return render_template('index.html', full = full, client = client, titre = flask_conf.title, node = node)
|
||||
boottime = get_boot_time(full['boot_time'])
|
||||
return render_template('index.html', full = full, client = client, titre = flask_conf.title, node = node, boottime = boottime)
|
||||
|
||||
def get_ressources(nodename):
|
||||
while True:
|
||||
|
|
Loading…
Reference in New Issue