def show_page(request): logger.debug("Rendering Scheduler Page") version = read_kermit_version() services = core.kermit_modules.extract(CoreService) service_status = [] show_status_bar = request.user.is_superuser or kermitsettings.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('chain/chain.html', {"settings":settings, "base_url": settings.BASE_URL, "static_url":settings.STATIC_URL, 'service_status_url':settings.RUBY_REST_PING_URL, "service_status":service_status, "kermit_version":version}, context_instance=RequestContext(request))
def index(request): if not request.user.is_authenticated(): return HttpResponseRedirect(reverse('login')) #items = Menu.objects.filter(enabled=True).order_by('order') services = core.kermit_modules.extract(CoreService) service_status = [] show_status_bar = request.user.is_superuser or kermitsettings.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) widgets = registry.get_widgets_dashboard(request.user) version = read_kermit_version() return render_to_response('index/index.html', {"settings": kermitsettings, "base_url": settings.BASE_URL, "widgets": widgets, "service_status":service_status, "static_url":settings.STATIC_URL, "kermit_version":version}, context_instance=RequestContext(request))
def generate_commons_page_dict(request): services = kermit_modules.extract(CoreService) service_status = [] show_status_bar = request.user.is_superuser or kermitsettings.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) version = read_kermit_version() return {"settings": kermitsettings, "base_url": kermitsettings.BASE_URL, "static_url":kermitsettings.STATIC_URL, 'service_status_url':kermitsettings.RUBY_REST_PING_URL, "service_status":service_status, "kermit_version":version}
def hostInventory(request, hostname): server_info = [] 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) version = read_kermit_version() my_server = Server.objects.get(hostname=hostname) operations = {} server_operations = core.kermit_modules.extract(ServerOperation) if server_operations: for op in server_operations: if op.get_visible(my_server, request.user): group_name = 'nogroup' group_icon = None if op.get_group_name(): group_name = op.get_group_name() group_icon = op.get_group_icon() data = {"img": op.get_image(), "name": op.get_name(), "url": op.get_url(hostname), "hasparameters": op.request_parameters(), "agent": op.get_agent(), "action": op.get_action(), "filter": op.get_filter(hostname), "enabled": op.get_enabled(my_server), "groupname": group_name, "groupicon": group_icon} if not group_name in operations: operations[group_name] = [] operations[group_name].append(data) else: logger.debug("Operation %s is not visible for %s server" % (op.get_name(), hostname)) #TODO: Make a refactor to remove base_url and statis_url from context return render_to_response('server/details.html', {"settings": settings, "base_url": settings.BASE_URL, "static_url":settings.STATIC_URL, "serverdetails": server_info, "hostname": hostname, "service_status":service_status, 'server_operations': operations, "kermit_version":version}, context_instance=RequestContext(request))
def generate_commons_page_dict(request): services = kermit_modules.extract(CoreService) service_status = [] show_status_bar = request.user.is_superuser or kermitsettings.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) version = read_kermit_version() return { "settings": kermitsettings, "base_url": kermitsettings.BASE_URL, "static_url": kermitsettings.STATIC_URL, 'service_status_url': kermitsettings.RUBY_REST_PING_URL, "service_status": service_status, "kermit_version": version }