Scott Baker | c7325a4 | 2014-05-30 16:06:46 -0700 | [diff] [blame^] | 1 | from view_common import * |
| 2 | |
| 3 | class DashboardAnalyticsAjaxView(View): |
| 4 | def get(self, request, name="hello_world", **kwargs): |
| 5 | if (name == "hpcSummary"): |
| 6 | return HttpResponse(json.dumps(hpc_wizard.get_hpc_wizard().get_summary_for_view()), mimetype='application/javascript') |
| 7 | elif (name == "hpcUserSite"): |
| 8 | return HttpResponse(json.dumps(getDashboardContext(request.user, tableFormat=True)), mimetype='application/javascript') |
| 9 | elif (name == "hpcMap"): |
| 10 | return HttpResponse(json.dumps(getCDNOperatorData(True)), mimetype='application/javascript') |
| 11 | elif (name == "bigquery"): |
| 12 | (mimetype, data) = DoPlanetStackAnalytics(request) |
| 13 | return HttpResponse(data, mimetype=mimetype) |
| 14 | else: |
| 15 | return HttpResponse(json.dumps("Unknown"), mimetype='application/javascript') |