diff --git a/dashboard/windc/forms.py b/dashboard/windc/forms.py index 7c1329f..d2ce98a 100644 --- a/dashboard/windc/forms.py +++ b/dashboard/windc/forms.py @@ -20,19 +20,30 @@ import logging +from django import forms from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from openstack_dashboard import api -from horizon import exceptions from horizon import forms +from horizon import exceptions from horizon import messages +import pdb LOG = logging.getLogger(__name__) +class WizardForm1(forms.Form): + _type = forms.ChoiceField(label=_("Service Type")) + + +class WizardForm2(forms.Form): + subject = forms.CharField(max_length=100) + sender = forms.CharField(max_length=1) + + class UpdateWinDC(forms.SelfHandlingForm): tenant_id = forms.CharField(widget=forms.HiddenInput) data_center = forms.CharField(widget=forms.HiddenInput) diff --git a/dashboard/windc/tables.py b/dashboard/windc/tables.py index bf34d4b..ead8c21 100644 --- a/dashboard/windc/tables.py +++ b/dashboard/windc/tables.py @@ -116,6 +116,16 @@ class EditService(tables.LinkAction): return True +class Wizard(tables.LinkAction): + name = "wizard" + verbose_name = _("Wizard") + url = "horizon:project:windc:update" + classes = ("ajax-modal", "btn-edit") + + def allowed(self, request, instance): + return True + + class ShowDataCenterServices(tables.LinkAction): name = "edit" verbose_name = _("Services") @@ -144,18 +154,36 @@ class WinDCTable(tables.DataTable): name = "windc" verbose_name = _("Windows Data Centers") row_class = UpdateRow - table_actions = (CreateDataCenter,) + table_actions = (CreateDataCenter, Wizard) row_actions = (ShowDataCenterServices,DeleteDataCenter) +STATUS_DISPLAY_CHOICES = ( + ("create", "Deploy"), +) + + class WinServicesTable(tables.DataTable): - name = tables.Column('dc_name', verbose_name=_('Name')) + + STATUS_CHOICES = ( + (None, True), + ("deployed", True), + ("active", True), + ("error", False), + ) + + name = tables.Column('dc_name', verbose_name=_('Name'), + link=("horizon:project:windc:service_details"),) _type = tables.Column('type', verbose_name=_('Type')) - status = tables.Column('status', verbose_name=_('Status')) + status = tables.Column('status', verbose_name=_('Status'), + status=True, + status_choices=STATUS_CHOICES, + display_choices=STATUS_DISPLAY_CHOICES) class Meta: name = "services" verbose_name = _("Services") row_class = UpdateRow + status_columns = ['status'] table_actions = (CreateService,) row_actions = (EditService, DeleteService) diff --git a/dashboard/windc/templates/windc/_dc_help.html b/dashboard/windc/templates/windc/_dc_help.html index 1cb4efc..5e29e2d 100644 --- a/dashboard/windc/templates/windc/_dc_help.html +++ b/dashboard/windc/templates/windc/_dc_help.html @@ -1,2 +1,3 @@ {% load i18n %} -
{% blocktrans %}You can deploy few domain controllers with one name.{% endblocktrans %}
\ No newline at end of file +{% blocktrans %}You can deploy few Active Directory services with one domain name.{% endblocktrans %}
+{% blocktrans %}The DNS service will automatically created for each Active Directory.{% endblocktrans %}
\ No newline at end of file diff --git a/dashboard/windc/templates/windc/_services_tabs.html b/dashboard/windc/templates/windc/_services_tabs.html new file mode 100644 index 0000000..9839711 --- /dev/null +++ b/dashboard/windc/templates/windc/_services_tabs.html @@ -0,0 +1,28 @@ +{% extends "horizon/common/_modal_form.html" %} +{% load i18n %} +{% block modal-header %}{% trans "Create Service" %}{% endblock %} + +{% block modal-body %} +Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}
+ +{% endblock %} \ No newline at end of file diff --git a/dashboard/windc/urls.py b/dashboard/windc/urls.py index 6654ed2..a62393e 100644 --- a/dashboard/windc/urls.py +++ b/dashboard/windc/urls.py @@ -21,7 +21,8 @@ from django.conf.urls.defaults import patterns, url from .views import IndexView, CreateWinDCView, WinServices, CreateWinServiceView - +from .views import Wizard +from .forms import WizardForm1, WizardForm2 VIEW_MOD = 'openstack_dashboard.dashboards.project.windc.views' @@ -29,6 +30,10 @@ urlpatterns = patterns(VIEW_MOD, url(r'^$', IndexView.as_view(), name='index'), url(r'^create$', CreateWinServiceView.as_view(), name='create'), url(r'^create_dc$', CreateWinDCView.as_view(), name='create_dc'), - url(r'^(?P