the files of NEO panel

this commit contains all the files of Mellanox NEO panel that
show the dashboard of NEO

Change-Id: I2901db8afff08e68016e5c4a6e7de082706c6493
This commit is contained in:
Murad Awawdeh 2016-05-17 14:13:02 +03:00
parent f5c212ab37
commit ca38cba7c7
6 changed files with 175 additions and 0 deletions

View File

View File

@ -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 Neopanel(horizon.Panel):
name = _("NEO")
slug = "neopanel"
dashboard.MlnxDashboard.register(Neopanel)

View File

@ -0,0 +1,47 @@
shit{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "NEO" %}{% endblock %}
{% block main %}
<style>
#content_body .container-fluid{
height: 100% !important;
margin-left: -15px;
}
#content_body .container-fluid .row{
height: 100% !important;
}
#content_body .container-fluid .row .col-xs-12{
height: 100% !important;
padding-right: 0px;
}
#content_body .container-fluid .row .col-xs-12 .page-header{
display: none !important;
}
iframe#neo_iframe{
width: 100%;
height: 99%;
}
</style>
<ng-include src="'{{ STATIC_URL }}horizon_mellanox/js/horizon_mellanox.js'"></ng-include>
<script>
alert(getCookie("mellanox_neo_host"));
</script>
<iframe id="neo_iframe" src="http://10.224.15.51/neo">
<p>Your browser does not support iframes.</p>
</iframe>
{% endblock %}

View File

@ -0,0 +1,48 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "NEO" %}{% endblock %}
{% block main %}
<style>
#content_body .container-fluid{
height: 100% !important;
margin-left: -15px;
}
#content_body .container-fluid .row{
height: 100% !important;
}
#content_body .container-fluid .row .col-xs-12{
height: 100% !important;
padding-right: 0px;
}
#content_body .container-fluid .row .col-xs-12 .page-header{
display: none !important;
}
iframe#neo_iframe{
width: 100%;
height: 99%;
}
</style>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$( document ).ready(function() {
horizon.horizon_mellanox.prepareNEOPanel();
});
</script>
<iframe id="neo_iframe" src="">
<p>Your browser does not support iframes.</p>
</iframe>
{% endblock %}

View File

@ -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.neopanel.views import IndexView
urlpatterns = patterns(
'',
url(r'^$', IndexView.as_view(), name='index'),
)

View File

@ -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/neopanel/index.html'
def get_data(self, request, context, *args, **kwargs):
# Add data to the context here...
return context