添加新接口
This commit is contained in:
parent
1bf6534c6d
commit
e5f2202104
|
@ -45,6 +45,8 @@ class NotificationMgr:
|
|||
'id': notify.id,
|
||||
'title': notify.title,
|
||||
'content': notify.content,
|
||||
'create_date': notify.create_date,
|
||||
'status': notify.status,
|
||||
'groups': [group.group_name for group in groups]
|
||||
})
|
||||
return {'success': 'true', 'data': notify_infos}
|
||||
|
|
|
@ -34,9 +34,40 @@
|
|||
|
||||
<div class="box-body">
|
||||
<p>test rendering...</p>
|
||||
|
||||
{% for title in notification_titles %}
|
||||
<p>{{ title }}</p>
|
||||
{% endfor %}
|
||||
|
||||
<div class="table table-responsive">
|
||||
<table id="notificationTable" class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Title</th>
|
||||
<th>Content</th>
|
||||
<th>Groups</th>
|
||||
<th>Create Date</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for notify in notifications %}
|
||||
<tr>
|
||||
<td>{{ notify['id'] }}</td>
|
||||
<td>{{ notify['title'] }}</td>
|
||||
<td>{{ notify['content'] }}</td>
|
||||
<td>
|
||||
{% for group_name in notify['groups'] %}{{ group_name }} {% endfor %}
|
||||
</td>
|
||||
<td>{{ notify['create_date'] }}</td>
|
||||
<td>{{ notify['status'] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@ class NotificationView(normalView):
|
|||
result = dockletRequest.post('/notification/list/')
|
||||
notifications = result['data']
|
||||
notification_titles = [notify['title'] for notify in notifications]
|
||||
return cls.render(cls.template_path, notification_titles=notification_titles)
|
||||
return cls.render(cls.template_path, notifications=notifications, notification_titles=notification_titles)
|
||||
|
||||
|
||||
class CreateNotificationView(normalView):
|
||||
|
|
Loading…
Reference in New Issue