Add a page to display beans applications information.
This commit is contained in:
parent
6712a4ad44
commit
f39b8467e9
|
@ -525,7 +525,7 @@ def beans_apply(cur_user,user,form,issue):
|
|||
return json.dumps({'success':'True'})
|
||||
elif issue == 'applymsgs':
|
||||
applymsgs = G_applicationmgr.query(user)
|
||||
return json.dumps({'success':'True','applymsgs':str(applymsgs)})
|
||||
return json.dumps({'success':'True','applymsgs':applymsgs})
|
||||
else:
|
||||
return json.dumps({'success':'false','message':'Unsupported URL!'})
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
<!-- Status -->
|
||||
<a href="#"><i class="fa fa-circle text-success"></i> {{ mysession['status']}}</a>
|
||||
<!-- Beans -->
|
||||
<a href="#"><i><img src="/static/img/bean.png" /></i> {{ beans }}</a>
|
||||
<a href="/beans/application/"><i><img src="/static/img/bean.png" /></i> {{ beans }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
{% extends 'base_AdminLTE.html' %}
|
||||
|
||||
{% block title %}Docklet | Beans Application{% endblock %}
|
||||
|
||||
{% block panel_title %}Beans Application{% endblock %}
|
||||
|
||||
{% block panel_list %}
|
||||
<ol class="breadcrumb">
|
||||
<li>
|
||||
<a href="/dashboard/"><i class="fa fa-dashboard"></i>Home</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<strong>Beans Application</strong>
|
||||
</li>
|
||||
</ol>
|
||||
{% endblock %}
|
||||
|
||||
{% block css_src %}
|
||||
<link href="/static/dist/css/flotconfig.css" rel="stylesheet">
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-info">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">All Applications</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table class="table table-striped table-bordered table-hover table-image" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Application ID</th>
|
||||
<th>Username</th>
|
||||
<th>Number</th>
|
||||
<th>Reason</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for application in applications %}
|
||||
<tr>
|
||||
<td>{{ application.id }}</td>
|
||||
<td>{{ application.username }}</td>
|
||||
<td>{{ application.number }} beans</td>
|
||||
<td>{{ application.reason }}</td>
|
||||
<td>{{ application.status }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block script_src %}
|
||||
|
||||
<script src="http://cdn.bootcss.com/datatables/1.10.11/js/jquery.dataTables.js"></script>
|
||||
<script src="http://cdn.bootcss.com/datatables/1.10.11/js/dataTables.bootstrap.js"></script>
|
||||
<script src="http://cdn.bootcss.com/datatables-tabletools/2.1.5/js/TableTools.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".table-image").DataTable();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -33,6 +33,7 @@ from webViews.dockletrequest import dockletRequest
|
|||
from webViews.cluster import *
|
||||
from webViews.admin import *
|
||||
from webViews.monitor import *
|
||||
from webViews.beansapplication import *
|
||||
from webViews.authenticate.auth import login_required, administration_required,activated_required
|
||||
from webViews.authenticate.register import registerView
|
||||
from webViews.authenticate.login import loginView, logoutView
|
||||
|
@ -291,6 +292,11 @@ def monitor_request(comid,infotype):
|
|||
result = dockletRequest.post(request.path, data)
|
||||
return json.dumps(result)
|
||||
|
||||
@app.route("/beans/application/", methods=['GET'])
|
||||
@login_required
|
||||
def beansapplication():
|
||||
return beansapplicationView.as_view()
|
||||
|
||||
'''@app.route("/monitor/User/", methods=['GET'])
|
||||
@administration_required
|
||||
def monitorUserAll():
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
from flask import session,render_template
|
||||
from webViews.view import normalView
|
||||
from webViews.dockletrequest import dockletRequest
|
||||
|
||||
|
||||
class beansapplicationView(normalView):
|
||||
template_path = "beansapplication.html"
|
||||
|
||||
@classmethod
|
||||
def get(self):
|
||||
result = dockletRequest.post('/beans/applymsgs/').get('applymsgs')
|
||||
return self.render(self.template_path, applications = result)
|
||||
|
||||
@classmethod
|
||||
def post(self):
|
||||
return self.get()
|
Loading…
Reference in New Issue