forked from kermitfr/kermit-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
views.py
25 lines (22 loc) · 1019 Bytes
/
views.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'''
Created on Nov 3, 2011
@author: mmornati
'''
import logging
from django.shortcuts import render_to_response
from webui import settings, core
from django.template.context import RequestContext
from webui.abstracts import CoreService
logger = logging.getLogger(__name__)
def appdetails(request, appname):
logger.debug("Application Details for %s" % appname)
services = core.kermit_modules.extract(CoreService)
service_status = []
show_status_bar = request.user.is_superuser or settings.SHOW_STATUS_BAR
if services and show_status_bar:
for service in services:
data = {"name": service.get_name(),
"description" : service.get_description(),
"status": service.get_status()}
service_status.append(data)
return render_to_response('platforms/application.html', {"base_url": settings.BASE_URL, "static_url":settings.STATIC_URL, "appname": appname ,"service_status":service_status}, context_instance=RequestContext(request))