blob: eef38dd4de25c2fbac6dc363c462a2ee8854b1c6 [file] [log] [blame]
srikanth116e6e82014-08-19 07:22:37 -07001#
2# Copyright (c) 2013 Big Switch Networks, Inc.
3#
4# Licensed under the Eclipse Public License, Version 1.0 (the
5# "License"); you may not use this file except in compliance with the
6# License. You may obtain a copy of the License at
7#
8# http://www.eclipse.org/legal/epl-v10.html
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied. See the License for the specific language governing
14# permissions and limitations under the License.
15#
16
17# Views for the application
18#
19
20from django.shortcuts import render_to_response
21from sdncon.apploader import AppLoader, AppLister
22from sdncon.controller.models import Switch
23import os
24
25def bsc_app_init():
26 # By default, App Name is the same as directory name. Change if needed.
27 APP_NAME = os.path.dirname(__file__).split("/")[-1]
28
29 # Create the App. Parameters are
30 # - Name: the id, lowercase letters only
31 # - Label: Human readable discription for the menu to the left
32 # - Priority: determines ranking the menu to the left), One-line description
33 # - Description: One line description of the app
34 app = AppLister(APP_NAME, "Controller Stats", 5, "Controller Stats")
35
36 # Add Tabs. Parameters are:
37 # - Name: the id, lowercase letters only
38 # - Label: Human readable discription for the menu to the left
39 # - View: name of the python function that contains the django view (see below)
40 app.addTab("openflow_graphs", "OpenFlow Graphs", flow_graphs_view)
41 app.addTab("system_graphs", "System Graphs", system_stats_graph_view)
42 AppLoader.addApp(app)
43
44def system_stats_graph_view(request):
45 return render_to_response('apps/cstats/templates/graphs.html', {} )
46
47def flow_graphs_view(request):
48 return render_to_response('apps/cstats/templates/openflowgraphs.html', {} )
49