Updates with logout and data management

community
Steve L. Nyemba 6 years ago
parent 57cab8b854
commit c25fcd5de5

@ -63,30 +63,11 @@ factory = DataSourceFactory()
@app.route('/') @app.route('/')
def home(): def home():
""" return redirect("/top",200)
This is the initial function (entry point), This function will load a dashboard @app.route("/1/data")
@param key customer's key def my_data():
""" context = SYS_ARGS.PARAMS['context']
context = PARAMS['context'] return render_template("account/data.html",context=context)
if 'title' in PARAMS :
title = PARAMS['title']
else:
title = 'Dashboard'
apps = []
try:
#
# The user must pass a key in heref
key = request.header['key']
args= dict(p)
args['uid'] = key
gReader = factory.instance(type=class_read,args=p)
apps = gReader.view('summary/nodes',key=p['uid'])
except Exception, e:
print (e)
return render_template('dashboard.html',context=context,title=title,app_names=apps)
def update_plan(uid,plan,auid=None): def update_plan(uid,plan,auid=None):
url = ":protocol://:host/store/subscribe/smart-top" url = ":protocol://:host/store/subscribe/smart-top"
url = url.replace(":protocol",CONFIG['protocol']).replace(":host",CONFIG['api']) url = url.replace(":protocol",CONFIG['protocol']).replace(":host",CONFIG['api'])
@ -426,6 +407,19 @@ def notify(key):
# #
pass pass
@app.route("/1/logout",methods=['GET'])
def logout():
"""
This function will clear all the session and redirect to the main page
"""
keys = session.keys()
for id in keys :
del session[id]
uri = SYS_ARGS.PARAMS['context'] if 'context' in SYS_ARGS.PARAMS else '/'
url = ":protocol://:host/store/logout"
url = url.replace(":protocol",CONFIG['protocol']).replace(":host",CONFIG['api'])
requests.post(url)
return redirect("/top",302)
@app.route('/1/get/nodes') @app.route('/1/get/nodes')
def get_nodes(): def get_nodes():

@ -0,0 +1,98 @@
<!--
Managing user emails that will be notified or receive emails from the user
-->
<meta charset="utf-8"/>
<script src="{{context}}/static/js/jquery/jquery.min.js"></script>
<script src="{{context}}/static/js/jx/dom.js"></script>
<link href="{{context}}/static/css/fa/css/font-awesome.css" rel="stylesheet" type="text/css">
<link href="{{context}}/static/css/fa/font-awesome-animation.css" rel="stylesheet" type="text/css">
<link href="{{context}}/static/js/jsgrid/jsgrid.css" rel="stylesheet" type="text/css">
<link href="{{context}}/static/js/jsgrid/jsgrid-theme.css" rel="stylesheet" type="text/css">
<script src="{{context}}/static/js/jsgrid/jsgrid.js"></script>
<script src="{{context}}/static/js/jx/dom.js"></script>
<script src="{{context}}/static/js/jx/utils.js"></script>
<script src="{{context}}/static/js/jx/rpc.js"></script>
<link href="{{context}}/static/css/default.css" rel="stylesheet" type="text/css">
<style>
.pane {
display:grid;
grid-template-columns:33% 33% 33% ;
grid-gap:2px;
}
.border-round { padding:8px ; border-radius:6px;}
.action .fa-cloud {color:#4682B4}
.action:hover .fa-cloud {color:#ffffff}
.fa-exclamation {color:maroon}
</style>
<script>
$(document).ready(function(){
}) ;
</script>
<div class="title-bar"><div class="title" align="left">Manage My Data</div> </div>
<div class="data-frame">
<div class="pane">
<div class=" " style="padding:8px">
<div class="title-bar bold border-bottom"><div class="title" align="center">Archive</div> </div>
<div class="" style="min-height:40%">
Archive to your cloud account in a <span class="bold">smart-top</span> folder:
<p style="margin-left:15px">
<br><i class="fa fa-check"></i> Using cloud storage as a device
<br><i class="fa fa-check"></i> Share and control access to your data
</p>
</div>
<div class="button action border-round border" style="width:50%; margin-left:25%">
<i class="fa fa-cloud"></i> <span class="bold"> Archive Now</span>
</div>
</div>
<div class=" border-left" style="padding:8px">
<div class="title-bar bold border-bottom"><div class="title" align="center">Download</div> </div>
<div class="" style="min-height:40%">
Download your logs in CSV or excel format:
<p style="margin-left:15px">
<br><i class="fa fa-check"></i> Conduct personal analysis
<br><i class="fa fa-check"></i> Integrate in third party tools
<br><i class="fa fa-check"></i> Archiving purposes (on a physical drive)
</p>
</div>
<div class="button action border-round border" style="width:50%; margin-left:25%">
<i class="fa fa-download"></i> <span class="bold"> Download Now</span>
</div>
</div>
<div class=" border-left" style="padding:8px">
<div class="title-bar bold border-bottom" style="color:maroon"><div class="title" align="center">Delete</div> </div>
<div style="min-height:40%">
Delete all of your logs from our servers. We recommend :
<p style="margin-left:15px">
<br><i class="fa fa-exclamation "></i> Either downloading or archiving first
<br><i class="fa fa-exclamation "></i> This process is NOT reversible.
</p>
This option does NOT delete your account.
</div>
<div class="button action border-round border" style="width:50%; margin-left:25%">
<i class="fa fa-times"></i> <span class="bold"> Delete Now</span>
</div>
</div>
</div>
<div class="comment border-top">
</div>
</div>
Loading…
Cancel
Save