Added WebUI for correct configuration of new service AD.
This commit is contained in:
parent
0aaa612465
commit
11514bca96
@ -49,7 +49,7 @@ def datacenters_list(request):
|
||||
return windcclient(request).datacenters.list()
|
||||
|
||||
def services_create(request, datacenter, parameters):
|
||||
name = parameters.get('name', '')
|
||||
name = parameters.get('dc_name', '')
|
||||
return windcclient(request).services.create(datacenter, name)
|
||||
|
||||
def services_list(request, datacenter):
|
||||
|
@ -87,7 +87,7 @@ class DeleteDataCenter(tables.BatchAction):
|
||||
|
||||
class EditService(tables.LinkAction):
|
||||
name = "edit"
|
||||
verbose_name = _("Edit Service")
|
||||
verbose_name = _("Edit")
|
||||
url = "horizon:project:windc:update"
|
||||
classes = ("ajax-modal", "btn-edit")
|
||||
|
||||
@ -95,6 +95,16 @@ class EditService(tables.LinkAction):
|
||||
return True
|
||||
|
||||
|
||||
class DeleteService(tables.LinkAction):
|
||||
name = "delete"
|
||||
verbose_name = _("Delete")
|
||||
url = "horizon:project:windc:delete"
|
||||
classes = ("ajax-modal", "btn-edit")
|
||||
|
||||
def allowed(self, request, instance):
|
||||
return True
|
||||
|
||||
|
||||
class ShowDataCenterServices(tables.LinkAction):
|
||||
name = "edit"
|
||||
verbose_name = _("Services")
|
||||
@ -128,13 +138,17 @@ class WinDCTable(tables.DataTable):
|
||||
|
||||
|
||||
class WinServicesTable(tables.DataTable):
|
||||
name = tables.Column("name",
|
||||
link=("horizon:project:windc"),
|
||||
verbose_name=_("Name"))
|
||||
name = tables.Column('name',
|
||||
link=('horizon:project:windc'),
|
||||
verbose_name=_('Name'))
|
||||
_type = tables.Column('type',
|
||||
verbose_name=_('Type'))
|
||||
status = tables.Column('status',
|
||||
verbose_name=_('Status'))
|
||||
|
||||
class Meta:
|
||||
name = "services"
|
||||
verbose_name = _("Services")
|
||||
row_class = UpdateRow
|
||||
table_actions = (CreateService,)
|
||||
row_actions = (EditService,)
|
||||
row_actions = (EditService, DeleteService)
|
||||
|
@ -72,11 +72,11 @@ class ConfigureDCAction(workflows.Action):
|
||||
|
||||
class ConfigureDC(workflows.Step):
|
||||
action_class = ConfigureDCAction
|
||||
contibutes = ("name",)
|
||||
contibutes = ('name',)
|
||||
|
||||
def contribute(self, data, context):
|
||||
if data:
|
||||
context['name'] = data.get("name", "")
|
||||
context['name'] = data.get('name', '')
|
||||
return context
|
||||
|
||||
|
||||
@ -84,9 +84,9 @@ class ConfigureWinDCAction(workflows.Action):
|
||||
dc_name = forms.CharField(label=_("Domain Name"),
|
||||
required=False)
|
||||
|
||||
dc_net_name = forms.CharField(label=_("Domain NetBIOS Name"),
|
||||
required=False,
|
||||
help_text=_("A NetBIOS name of new domain."))
|
||||
#dc_net_name = forms.CharField(label=_("Domain NetBIOS Name"),
|
||||
# required=False,
|
||||
# help_text=_("A NetBIOS name of new domain."))
|
||||
|
||||
dc_count = forms.IntegerField(label=_("Domain Controllers Count"),
|
||||
required=True,
|
||||
@ -114,6 +114,16 @@ class ConfigureWinDCAction(workflows.Action):
|
||||
|
||||
class ConfigureWinDC(workflows.Step):
|
||||
action_class = ConfigureWinDCAction
|
||||
contibutes = ('dc_name', 'dc_count', 'adm_password', 'recovery_password')
|
||||
|
||||
def contribute(self, data, context):
|
||||
if data:
|
||||
context['dc_name'] = data.get('dc_name', '')
|
||||
context['dc_count'] = data.get('dc_count', 1)
|
||||
context['adm_password'] = data.get('adm_password', '')
|
||||
context['recovery_password'] = data.get('recovery_password', '')
|
||||
context['type'] = 'active_directory_service'
|
||||
return context
|
||||
|
||||
|
||||
class ConfigureWinIISAction(workflows.Action):
|
||||
@ -139,6 +149,15 @@ class ConfigureWinIISAction(workflows.Action):
|
||||
class ConfigureWinIIS(workflows.Step):
|
||||
action_class = ConfigureWinIISAction
|
||||
|
||||
contibutes = ('iis_name', 'iis_count', 'iis_domain')
|
||||
|
||||
def contribute(self, data, context):
|
||||
if data:
|
||||
context['iis_name'] = data.get('iis_name', '')
|
||||
context['iis_count'] = data.get('iis_count', 1)
|
||||
context['iis_domain'] = data.get('iis_domain', '')
|
||||
return context
|
||||
|
||||
|
||||
class CreateWinService(workflows.Workflow):
|
||||
slug = "create"
|
||||
@ -152,7 +171,7 @@ class CreateWinService(workflows.Workflow):
|
||||
ConfigureWinIIS)
|
||||
|
||||
def format_status_message(self, message):
|
||||
name = self.context.get('name', 'noname')
|
||||
name = self.context.get('dc_name', 'noname')
|
||||
return message % name
|
||||
|
||||
def handle(self, request, context):
|
||||
|
Loading…
x
Reference in New Issue
Block a user