From f5c212ab37cc188e3d95affd23daa85f01dd6df7 Mon Sep 17 00:00:00 2001 From: Murad Awawdeh Date: Tue, 17 May 2016 09:35:34 +0300 Subject: [PATCH] the files of the ufm panel this commit contains all files of the ufm panel that view the interview of Mellanox ufm Change-Id: I6fe955c1434792a45c28506559fcdb8be798b629 --- horizon_mellanox/ufmpanel/__init__.py | 0 horizon_mellanox/ufmpanel/panel.py | 28 +++++++++++ .../ufmpanel/templates/ufmpanel/index.html | 48 +++++++++++++++++++ horizon_mellanox/ufmpanel/urls.py | 26 ++++++++++ horizon_mellanox/ufmpanel/views.py | 26 ++++++++++ 5 files changed, 128 insertions(+) create mode 100644 horizon_mellanox/ufmpanel/__init__.py create mode 100644 horizon_mellanox/ufmpanel/panel.py create mode 100644 horizon_mellanox/ufmpanel/templates/ufmpanel/index.html create mode 100644 horizon_mellanox/ufmpanel/urls.py create mode 100644 horizon_mellanox/ufmpanel/views.py diff --git a/horizon_mellanox/ufmpanel/__init__.py b/horizon_mellanox/ufmpanel/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/horizon_mellanox/ufmpanel/panel.py b/horizon_mellanox/ufmpanel/panel.py new file mode 100644 index 0000000..0f2c731 --- /dev/null +++ b/horizon_mellanox/ufmpanel/panel.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +# Copyright 2016 Mellanox Technologies, Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from django.utils.translation import ugettext_lazy as _ + +import horizon +from horizon_mellanox import dashboard + + +class UFMpanel(horizon.Panel): + name = _("UFM") + slug = "ufmpanel" + + +dashboard.MlnxDashboard.register(UFMpanel) diff --git a/horizon_mellanox/ufmpanel/templates/ufmpanel/index.html b/horizon_mellanox/ufmpanel/templates/ufmpanel/index.html new file mode 100644 index 0000000..f82156f --- /dev/null +++ b/horizon_mellanox/ufmpanel/templates/ufmpanel/index.html @@ -0,0 +1,48 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}{% trans "NEO" %}{% endblock %} + +{% block main %} + + + + + + + + + +{% endblock %} + + + diff --git a/horizon_mellanox/ufmpanel/urls.py b/horizon_mellanox/ufmpanel/urls.py new file mode 100644 index 0000000..db4e685 --- /dev/null +++ b/horizon_mellanox/ufmpanel/urls.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- + +# Copyright 2016 Mellanox Technologies, Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from django.conf.urls import patterns +from django.conf.urls import url + +from horizon_mellanox.ufmpanel.views import IndexView + + +urlpatterns = patterns( + '', + url(r'^$', IndexView.as_view(), name='index'), +) diff --git a/horizon_mellanox/ufmpanel/views.py b/horizon_mellanox/ufmpanel/views.py new file mode 100644 index 0000000..d954a42 --- /dev/null +++ b/horizon_mellanox/ufmpanel/views.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- + +# Copyright 2016 Mellanox Technologies, Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from horizon import views + + +class IndexView(views.APIView): + # A very simple class-based view... + template_name = 'horizon_mellanox/ufmpanel/index.html' + + def get_data(self, request, context, *args, **kwargs): + # Add data to the context here... + return context