From b80ec46ea13dfa8eb0a26dc0c962ae76063c9807 Mon Sep 17 00:00:00 2001 From: Murad Awawdeh Date: Mon, 16 May 2016 15:12:00 +0300 Subject: [PATCH] the files of the about panel of Mellanox Dashboard this commit contains about panel files, that show information about Mellanox Change-Id: Ie05238d14d19d8b79dbd1cd1e8f96217652a75b4 --- horizon_mellanox/aboutpanel/__init__.py | 0 horizon_mellanox/aboutpanel/panel.py | 28 +++++++++++++ .../templates/aboutpanel/index.html | 40 +++++++++++++++++++ horizon_mellanox/aboutpanel/urls.py | 26 ++++++++++++ horizon_mellanox/aboutpanel/views.py | 26 ++++++++++++ 5 files changed, 120 insertions(+) create mode 100644 horizon_mellanox/aboutpanel/__init__.py create mode 100644 horizon_mellanox/aboutpanel/panel.py create mode 100644 horizon_mellanox/aboutpanel/templates/aboutpanel/index.html create mode 100644 horizon_mellanox/aboutpanel/urls.py create mode 100644 horizon_mellanox/aboutpanel/views.py diff --git a/horizon_mellanox/aboutpanel/__init__.py b/horizon_mellanox/aboutpanel/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/horizon_mellanox/aboutpanel/panel.py b/horizon_mellanox/aboutpanel/panel.py new file mode 100644 index 0000000..d2295d8 --- /dev/null +++ b/horizon_mellanox/aboutpanel/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 Aboutpanel(horizon.Panel): + name = _("About") + slug = "aboutpanel" + + +dashboard.MlnxDashboard.register(Aboutpanel) diff --git a/horizon_mellanox/aboutpanel/templates/aboutpanel/index.html b/horizon_mellanox/aboutpanel/templates/aboutpanel/index.html new file mode 100644 index 0000000..48f379f --- /dev/null +++ b/horizon_mellanox/aboutpanel/templates/aboutpanel/index.html @@ -0,0 +1,40 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}{% trans "NEO" %}{% endblock %} + +{% block main %} + + + + + +{% endblock %} + + + diff --git a/horizon_mellanox/aboutpanel/urls.py b/horizon_mellanox/aboutpanel/urls.py new file mode 100644 index 0000000..ccf4c83 --- /dev/null +++ b/horizon_mellanox/aboutpanel/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.aboutpanel.views import IndexView + + +urlpatterns = patterns( + '', + url(r'^$', IndexView.as_view(), name='index'), +) diff --git a/horizon_mellanox/aboutpanel/views.py b/horizon_mellanox/aboutpanel/views.py new file mode 100644 index 0000000..d0fad19 --- /dev/null +++ b/horizon_mellanox/aboutpanel/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/aboutpanel/index.html' + + def get_data(self, request, context, *args, **kwargs): + # Add data to the context here... + return context