<button type="button" class="btn btn-default" data-container="body"
data-toggle="tooltip" data-placement="top" title="Instantiate NS"
- onclick="javascript:openModalCreateNS({ 'project_id':'{{ project_id }}','vim_list_url': '{% url "vim:list" %}', 'nsd_list_url': '{% url "projects:list_descriptors" project_id=project_id descriptor_type='nsd' %}'})">
+ onclick="javascript:openModalCreateNS({ 'project_id':'{{ project_id }}','vim_list_url': '{% url "projects:vims:list" project_id=project_id %}', 'nsd_list_url': '{% url "projects:list_descriptors" project_id=project_id descriptor_type='nsd' %}'})">
<i class="fa fa-paper-plane"></i> <span> New NS</span></button>
</div>
<td>
<div class="btn-group">
{% if descriptor_type == "nsd" %}
- <button type="button" class="btn btn-default" data-container="body" data-toggle="tooltip" data-placement="top" title="Instantiate NS" onclick="javascript:openModalCreateNS({ 'project_id':'{{project_id}}', 'descriptor_type': '{{descriptor_type}}', 'descriptor_name':'{{ k|get:"name" }}', 'descriptor_id':'{{ k|get:"_id" }}','vim_list_url': '{% url "vim:list" %}', 'nsd_list_url': '{% url "projects:list_descriptors" project_id=project_id descriptor_type=descriptor_type %}' })"><i class="fa fa-paper-plane"></i></button>
+ <button type="button" class="btn btn-default" data-container="body" data-toggle="tooltip" data-placement="top" title="Instantiate NS" onclick="javascript:openModalCreateNS({ 'project_id':'{{project_id}}', 'descriptor_type': '{{descriptor_type}}', 'descriptor_name':'{{ k|get:"name" }}', 'descriptor_id':'{{ k|get:"_id" }}','vim_list_url': '{% url "projects:vims:list" project_id=project_id%}', 'nsd_list_url': '{% url "projects:list_descriptors" project_id=project_id descriptor_type=descriptor_type %}' })"><i class="fa fa-paper-plane"></i></button>
{% endif %}
<button type="button" class="btn btn-default" data-container="body" data-toggle="tooltip" data-placement="top" title="Edit" onclick="javascript:openDescriptorView('{{project_id}}', '{{descriptor_type}}', '{{ k|get:"_id" }}')"><i class="fa fa-edit"></i></button>
<button type="button" class="btn btn-default" data-container="body" data-toggle="tooltip" data-placement="top" title="Show content" onclick="javascript:openPackageContentList('{{project_id}}', '{{descriptor_type}}', '{{ k|get:"_id" }}')"><i class="fa fa-folder-open"></i></button>
<i class="fa fa-list fa-fw"></i><span>SDN Controllers</span>
</a>
</li>
- <li class="header">CONFIG</li>
- {% url "vim:list" type='ns' as vim_list_url %}
+
+ {% url "projects:vims:list" project_id=project_id as vim_list_url %}
<li {% if request.get_full_path == vim_list_url %} class="active" {% endif %}>
- <a href='{% url "vim:list" %}'>
+ <a href='{% url "projects:vims:list" project_id=project_id %}'>
<i class="fa fa-list fa-fw"></i><span>VIM Accounts</span>
</a>
</li>
url(r'^new/', views.create_new_project, name='new_project'),
url(r'^(?P<project_id>\d+)/$', views.open_project, name='open_project'),
url(r'^(?P<project_id>\d+)/sdn/', include('sdnctrlhandler.urls', namespace='sdns'), name='sdns_base'),
+ url(r'^(?P<project_id>\d+)/vims/', include('vimhandler.urls', namespace='vims'), name='vims_base'),
url(r'^(?P<project_id>\d+)/instances/', include('instancehandler.urls', namespace='instances'), name='instances_base'),
url(r'^(?P<project_id>\d+)/delete$', views.delete_project, name='delete_project'),
url(r'^(?P<project_id>\d+)/graph(/$)', views.graph, name='graph_view'),
url(r'^auth_guest/$', user_views.guest_login, name='auth_user_guest'),
url(r'^register', user_views.register_view, name='register_user'),
url(r'^projects/', include('projecthandler.urls.project', namespace='projects'), name='projects_base'),
- url(r'^vims/', include('vimhandler.urls', namespace='vim'), name='vims_base'),
+ #url(r'^vims/', include('vimhandler.urls', namespace='vim'), name='vims_base'),
#url(r'^sdn/', include('sdnctrlhandler.urls', namespace='sdn'), name='sdns_base'),
url(r'^$', views.home, name='home'),
<li {% if request.get_full_path == home_url %} class="active" {% endif %} ><a href='{% url "home" %}'><i class="fa fa-home fa-fw"></i><span>Home</span></a></li>
{% url "projects:projects_list" as projects_list_url %}
<li {% if request.get_full_path == projects_list_url %} class="active" {% endif %}><a href='{% url "projects:projects_list" %}'><i class="fa fa-th-list fa-fw"></i><span>Projects</span></a></li>
- {% url "vim:list" as vims_list_url %}
- <li {% if request.get_full_path == vims_list_url %} class="active" {% endif %}><a href='{% url "vim:list" %}'><i class="fa fa-th-list fa-fw"></i><span>VIM Accounts</span></a></li>
-
{% block left_sidebar_base %}
{% endblock %}
{% block left_sidebar %}
- {% include 'left_sidebar_base.html' %}
+ {% include 'osm/osm_project_left_sidebar.html' %}
{% endblock %}
{% block breadcrumb_body %}
{{ block.super }}
- <li><a href="{% url 'vim:list' %}">VIMS</a></li>
+ <li><a href="{% url 'projects:vims:list' project_id=project_id %}">VIMS</a></li>
{% endblock %}
{% block content_body %}
<div class="row">
<div class="col-md-12">
- <form action='{% url "vim:create" %}' method="post">
+ <form action='{% url "projects:vims:create" project_id=project_id %}' method="post">
{% csrf_token %}
<div class="box">
<div class="box-header with-border">
</div>
<div class="box-footer">
- <button onclick="location.href='{% url 'vim:list' %}'" class="btn btn-default pull-left">Back to
+ <button onclick="location.href='{% url 'projects:vims:list' project_id=project_id%}'" class="btn btn-default pull-left">Back to
VIM Accounts
</button>
<button class="btn btn-primary pull-right">Create</button>
{% endblock %}
{% block left_sidebar %}
- {% include 'left_sidebar_base.html' %}
+ {% include 'osm/osm_project_left_sidebar.html' %}
{% endblock %}
{% block breadcrumb_body %}
{{ block.super }}
- <li><a href="{% url 'vim:list' %}">VIMS</a></li>
+ <li><a href="{% url "projects:vims:list" project_id=project_id %}">VIMS</a></li>
{% endblock %}
{% block content_body %}
<div class="box-header with-border">
<h3 class="box-title">Registered VIM</h3>
<div class="box-tools">
- <a href='{% url "vim:create" %}' class="btn btn-block btn-primary btn-sm"><i
+ <a href='{% url "projects:vims:create" project_id=project_id %}' class="btn btn-block btn-primary btn-sm"><i
class="fa fa-plus"></i><span> New VIM</span></a>
</div>
</div>
<td>
<div class="btn-group">
<button type="button" class="btn btn-default"
- onclick="location.href='{% url "vim:show" vim_id=p|get:"_id" %}'" data-toggle="tooltip" data-placement="top" data-container="body" title="Show Info"><i
+ onclick="location.href='{% url "projects:vims:show" project_id=project_id vim_id=p|get:"_id" %}'" data-toggle="tooltip" data-placement="top" data-container="body" title="Show Info"><i
class="fa fa-info"></i></button>
<button type="button" class="btn btn-default"
- onclick="javascript:deleteVim('{{ p|get:"_id" }}')" data-toggle="tooltip" data-placement="top" data-container="body" title="Delete"><i
+ onclick="javascript:deleteVim('{% url "projects:vims:delete" project_id=project_id vim_id=p|get:"_id" %}')" data-toggle="tooltip" data-placement="top" data-container="body" title="Delete"><i
class="fa fa-trash-o" ></i></button>
</div>
</td>
<script>
- function deleteVim(vim_uuid) {
+ function deleteVim(url) {
bootbox.confirm("Are you sure want to delete?", function (result) {
if (result) {
- location.href = '/vims/' + vim_uuid + '/delete'
+ location.href = url//'/vims/' + vim_uuid + '/delete'
}
})
}
{% extends "base.html" %}
{% load get %}
{% load staticfiles %}
-{% block head_base %}
- {% with skin_css="AdminLTE/dist/css/skins/skin-purple.min.css"%}
- {{ block.super }}
- {% endwith %}
-{% endblock %}
-
-{% block body %}
- {% with skin="purple"%}
- {{ block.super }}
- {% endwith %}
-{% endblock %}
-{% block logo_sidebar %}
- {% with logo_mini="assets/img/osm_small_logo.png" logo="assets/img/OSM-logo.png" %}
- {{ block.super }}
- {% endwith %}
-{% endblock %}
-
-
{% block head_block %}
{{ block.super }}
{% endblock %}
{% block left_sidebar %}
- {% include 'left_sidebar_base.html' %}
+ {% include 'osm/osm_project_left_sidebar.html' %}
{% endblock %}
{% block breadcrumb_body %}
{{ block.super }}
- <li><a href="{% url 'vim:list' %}">VIMS</a></li>
+ <li><a href="{% url 'projects:vims:list' project_id=project_id%}">VIMS</a></li>
{% endblock %}
{% block content_body %}
</div>
<div class="box-footer">
<div class="">
- <button onclick="location.href='{% url 'vim:list' %}'" class="btn btn-primary">Back to VIM Accounts</button>
+ <button onclick="location.href='{% url 'projects:vims:list' project_id=project_id%}'" class="btn btn-primary">Back to VIM Accounts</button>
</div>
</div>
</div>
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger('view.py')
+
@login_required
-def list(request):
+def list(request, project_id):
client = Client()
result = client.vim_list()
print result
result = {
+ "project_id": project_id,
"datacenters": result
}
return __response_handler(request, result, 'vim_list.html')
+
@login_required
-def create(request):
- result = {}
+def create(request, project_id):
+ result = {'project_id': project_id}
if request.method == 'GET':
return __response_handler(request, result, 'vim_create.html')
else:
print e
result = client.vim_create(vim_data)
# TODO 'vim:show', to_redirect=True, vim_id=vim_id
- return __response_handler(request, result, 'vim:list', to_redirect=True)
+ return __response_handler(request, result, 'projects:vims:list', to_redirect=True, project_id=project_id)
@login_required
-def delete(request, vim_id=None):
+def delete(request, project_id, vim_id=None):
try:
client = Client()
del_res = client.vim_delete(vim_id)
except Exception as e:
log.exception(e)
- return __response_handler(request, {}, 'vim:list', to_redirect=True)
+ return __response_handler(request, {}, 'projects:vims:list', to_redirect=True, project_id=project_id)
@login_required
-def show(request, vim_id=None):
+def show(request, project_id, vim_id=None):
client = Client()
datacenter = client.vim_get(vim_id)
print datacenter
return __response_handler(request, {
- "datacenter": datacenter
+ "datacenter": datacenter,
+ "project_id": project_id
}, 'vim_show.html')