コード例 #1
0
class GenericFormTemplate(GatewayForm):
    """
    Generic form Template

    Note:
        When updating the form, remember to make the corresponding changes to the workflow pages
    """
    workflow_name = 'configure_service_requests'
    workflow_permission = 'configure_service_requests_page'
    servicenow_url = CustomStringField(
        label='ServiceNow URL',
        default=service_requests_config.servicenow_url,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True,
    )

    servicenow_username = CustomStringField(
        label='ServiceNow User',
        default=service_requests_config.servicenow_username,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True)

    servicenow_secret_file = CustomStringField(
        label='ServiceNow Secret file and path',
        default=service_requests_config.servicenow_secret_file,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True)

    submit = CustomSubmitField(label='Save',
                               is_disabled_on_start=False,
                               is_disabled_on_error=False)
コード例 #2
0
class GenericFormTemplate(GatewayForm):
    """
    Generic form Template

    Note:
        When updating the form, remember to make the corresponding changes to the workflow pages
    """
    workflow_name = 'edge_create_internal_ns'
    workflow_permission = 'edge_create_internal_ns_page'
    domainlist_name = CustomStringField(
        label='Domain List Name',
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True,
    )
    domainlist_desc = CustomStringField(
        label='Domain List Description',
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=False,
    )
    sourceType = CustomStringField(
        label='Domain List Type',
        default='user',
        is_disabled_on_start=True,
        is_disabled_on_error=True,
        required=True,
    )

    namespaces = EdgeNamespaces(label='Edge Namespaces',
                                is_disabled_on_start=False,
                                workflow_name=workflow_name,
                                permissions=workflow_permission)

    submit = CustomSubmitField(label='Submit', is_disabled_on_start=False)
コード例 #3
0
class GenericFormTemplate(GatewayForm):
    """
    Generic form Template

    Note:
        When updating the form, remember to make the corresponding changes to the workflow pages
    """
    workflow_name = 'vro_configuration'
    workflow_permission = 'vro_configuration_page'
    default_configuration = CustomStringField(
        label='Default Configuration',
        default=vro_config.default_configuration,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True)
    default_view = CustomStringField(label='vRO Default DNS View',
                                     default=vro_config.default_view,
                                     is_disabled_on_start=False,
                                     is_disabled_on_error=False,
                                     required=True)
    default_zone = CustomStringField(label='vRO Default Zone',
                                     default=vro_config.default_zone,
                                     is_disabled_on_start=False,
                                     is_disabled_on_error=False,
                                     required=True)
    default_reverse_flag = CustomStringField(
        label='vRO Create PTR Record',
        default=vro_config.default_reverse_flag,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True)

    submit = CustomSubmitField(label='Save',
                               is_disabled_on_start=False,
                               is_disabled_on_error=False)
コード例 #4
0
class GenericFormTemplate(GatewayForm):
    """
    Generic form Template

    Note:
        When updating the form, remember to make the corresponding changes to the workflow pages
    """
    workflow_name = 'gitlab_configuration'
    workflow_permission = 'gitlab_configuration_page'
    gitlab_url = CustomStringField(
        label='GitLab URL',
        default=gitlab_import_config.gitlab_url,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True,
    )

    default_group = CustomStringField(
        label='Default GitLab Group',
        default=gitlab_import_config.default_group,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True)

    gitlab_import_directory = CustomStringField(
        label='GitLab Workflow Directory',
        default=gitlab_import_config.gitlab_import_directory,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True)

    gitlab_import_utils_directory = CustomStringField(
        label='GitLab Util Directory',
        default=gitlab_import_config.gitlab_import_utils_directory,
        is_disabled_on_start=False,
        is_disabled_on_error=False)

    gw_utils_directory = CustomStringField(
        label='Gateway Util Directory',
        default=gitlab_import_config.gw_utils_directory,
        is_disabled_on_start=False,
        is_disabled_on_error=False)

    backups_folder = CustomStringField(
        label='Gateway Backup Folder',
        default=gitlab_import_config.backups_folder,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True)

    secret_file = CustomStringField(label='Gateway Secret file and path',
                                    default=gitlab_import_config.secret_file,
                                    is_disabled_on_start=False,
                                    is_disabled_on_error=False,
                                    required=True)

    submit = CustomSubmitField(label='Save',
                               is_disabled_on_start=False,
                               is_disabled_on_error=False)
コード例 #5
0
class GenericFormTemplate(GatewayForm):
    """
    Generic form Template

    Note:
        When updating the form, remember to make the corresponding changes to the workflow pages
    """
    workflow_name = 'move_to_bluecatgateway_udf'
    workflow_permission = 'move_to_bluecatgateway_udf_page'

    submit = CustomSubmitField(label='Submit', is_disabled_on_start=False)
class GenericFormTemplate(GatewayForm):
    """
    Generic form Template

    Note:
        When updating the form, remember to make the corresponding changes to the workflow pages
    """
    workflow_name = 'edge_create_internal_ns_config'
    workflow_permission = 'edge_umbrella_domain_list_config_page'
    default_configuration = CustomStringField(
        label='Default Configuration',
        default=edge_create_internal_ns_configuration.default_configuration,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True,
    )
    default_view = CustomStringField(
        label='Default DNS View',
        default=edge_create_internal_ns_configuration.default_view,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True,
    )
    edge_url = CustomStringField(
        label='Edge URL',
        default=edge_create_internal_ns_configuration.edge_url,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True,
    )
    domain_list_file = CustomStringField(
        label='Domain List File',
        default=edge_create_internal_ns_configuration.domain_list_file,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True,
    )
    client_id = CustomStringField(
        label='Edge Client ID',
        default=edge_create_internal_ns_configuration.client_id,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True,
    )
    clientSecret = CustomStringField(
        label='Edge Client Secret',
        default=edge_create_internal_ns_configuration.clientSecret,
        is_disabled_on_start=False,
        is_disabled_on_error=False,
        required=True,
    )
    submit = CustomSubmitField(label='Save',
                               is_disabled_on_start=False,
                               is_disabled_on_error=False)
コード例 #7
0
class GenericFormTemplate(GatewayForm):
    # When updating the form, remember to make the corresponding changes to the workflow pages
    workflow_name = 'acl_inventory'
    workflow_permission = 'acl_inventory_page'

    acls_list = ACL(workflow_name=workflow_name,
                    permissions=workflow_permission,
                    label='ACL List',
                    required=True,
                    coerce=int,
                    is_disabled_on_start=False,
                    clear_below_on_change=False)

    download = CustomSubmitField(label='Download', is_disabled_on_start=False)
コード例 #8
0
class GenericFormTemplate(GatewayForm):
    workflow_name = 'bulk_register_user'
    workflow_permission = 'bulk_register_user_page'

    text = get_resource_text()
    file = FileField(text['label_file'])

    user_list = TableField(workflow_name=workflow_name,
                           permissions=workflow_permission,
                           label=text['label_list'],
                           table_features=table_features(),
                           is_disabled_on_start=False)

    submit = CustomSubmitField(label=text['label_submit'],
                               is_disabled_on_start=True,
                               is_disabled_on_error=True)
コード例 #9
0
class GenericFormTemplate(GatewayForm):
    # When updating the form, remember to make the corresponding changes to the workflow pages
    workflow_name = 'register_mac_address'
    workflow_permission = 'register_mac_address_page'

    text = get_resource_text()
    require_message = text['require_message']

    mac_address = CustomStringField(
        label=text['label_mac_address'],
        default='FF:FF:FF:FF:FF:FF',
        is_disabled_on_start=False,
        validators=[DataRequired(message=require_message),
                    MacAddress()])

    device_group = CustomSelectField(label=text['label_device_group'],
                                     coerce=int,
                                     is_disabled_on_start=False,
                                     validators=[])

    asset_code = CustomStringField(
        label=text['label_asset_code'],
        is_disabled_on_start=False,
        validators=[DataRequired(message=require_message)])

    employee_code = CustomStringField(
        label=text['label_employee_code'],
        is_disabled_on_start=False,
        validators=[DataRequired(message=require_message)])

    location = CustomSelectField(label=text['label_location'],
                                 coerce=int,
                                 is_disabled_on_start=False)

    submit_date = DateTimeField(label=text['label_submit_date'],
                                default=datetime.datetime.now(),
                                format='%Y/%m/%d')

    expiry_date = DateTimeField(label=text['label_expiry_date'],
                                default=datetime.datetime.now() +
                                datetime.timedelta(days=365),
                                format='%Y/%m/%d')

    submit = CustomSubmitField(label=text['label_submit'],
                               is_disabled_on_start=False)
コード例 #10
0
class GenericFormTemplate(GatewayForm):
    # When updating the form, remember to make the corresponding changes to the workflow pages
    workflow_name = 'bulk_register_mac_address'
    workflow_permission = 'bulk_register_mac_address_page'
    
    text = get_resource_text()

    file = FileField(text['label_file'])

    mac_address_list = TableField(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label=text['label_list'],
        table_features=table_features(),
        is_disabled_on_start=False
    )
    
    submit = CustomSubmitField(
        label=text['label_submit'],
        is_disabled_on_start=True,
        is_disabled_on_error=True
    )
コード例 #11
0
class GenericFormTemplate(GatewayForm):
    """
    Generic form Template

    Note:
        When updating the form, remember to make the corresponding changes to the workflow pages
    """
    workflow_name = 'add_mac_address'
    workflow_permission = 'add_mac_address_page'

    configuration = Configuration(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label='Configuration',
        required=True,
        coerce=int,
        is_disabled_on_start=False,
    )

    mac_address = CustomStringField(label='MAC Address',
                                    is_disabled_on_start=False,
                                    validators=[MacAddress()],
                                    required=True)

    mac_address_name = CustomStringField(label='MAC Address Name',
                                         is_disabled_on_start=False,
                                         required=True)

    mac_pool_boolean = CustomBooleanField(label='Add to MAC Pool',
                                          is_disabled_on_start=False)

    mac_pool = MACPool(workflow_name=workflow_name,
                       permissions=workflow_permission,
                       label='MAC Pool',
                       is_disabled_on_start=False)

    submit = CustomSubmitField(label='Submit', is_disabled_on_start=False)
コード例 #12
0
class GenericFormTemplate(GatewayForm):
    # When updating the form, remember to make the corresponding changes to the workflow pages
    workflow_name = 'flip_normal_dr'
    workflow_permission = 'flip_normal_dr_page'

    text = get_resource_text()

    application = CustomSelectField(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label=text['label_application'],
        choices_function=get_applications,
        coerce=int,
        is_disabled_on_start=False,
        validators=[]
    )

    server_list = TableField(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label=text['label_list'],
        data_function=raw_table_data,
        table_features={
            'searching': False,
            'ordering': False,
            'info': False,
            'lengthChange': False
        },
        is_disabled_on_start=True,
        is_disabled_on_error=True
    )

    submit = CustomSubmitField(
        label=text['label_submit'],
        is_disabled_on_start=True,
        is_disabled_on_error=True
    )
コード例 #13
0
class GenericFormTemplate(GatewayForm):
    """ Form to generate HTML and Javascript for the update_text_record workflow

    Note:
        When updating the form, remember to make the corresponding changes to the workflow pages
    """
    workflow_name = 'update_text_record'
    workflow_permission = 'update_text_record_page'
    configuration = Configuration(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label='Configuration',
        required=True,
        coerce=int,
        clear_below_on_change=False,
        is_disabled_on_start=False,
        on_complete=['call_view'],
        enable_dependencies={'on_complete': ['view']},
        disable_dependencies={'on_change': ['view']},
        clear_dependencies={'on_change': ['view']})

    view = View(workflow_name=workflow_name,
                permissions=workflow_permission,
                label='View',
                required=True,
                one_off=True,
                clear_below_on_change=False,
                display_message=True,
                enable_dependencies={'on_complete': ['parent_zone']},
                disable_dependencies={'on_change': ['parent_zone']},
                clear_dependencies={'on_change': ['parent_zone']},
                should_cascade_disable_on_change=True,
                should_cascade_clear_on_change=True)

    parent_zone = Zone(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label='Zone',
        required=True,
        start_initialized=True,
        display_message=True,
        inputs={
            'zone': 'parent_zone',
            'configuration': 'configuration',
            'view': 'view'
        },
        clear_below_on_change=False,
        enable_dependencies={'on_complete': ['text_record', 'search']},
        disable_dependencies={'on_change': ['text_record', 'search']},
        clear_dependencies={'on_change': ['text_record', 'search']},
        should_cascade_disable_on_change=True,
        should_cascade_clear_on_change=True)

    text_record = CustomStringField(label='Text Record')

    search = CustomSearchButtonField(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        default='Search',
        inputs={
            'configuration': 'configuration',
            'view': 'view',
            'parent_zone': 'parent_zone',
            'name': 'text_record'
        },
        server_side_method=get_text_records_endpoint,
        display_message=True,
        on_complete=['call_txt_list'],
        enable_dependencies={'on_complete': ['txt_filter', 'txt_list']},
        disable_dependencies={
            'on_change': ['txt_filter', 'txt_list'],
            'on_click': ['txt_filter', 'txt_list']
        },
        clear_dependencies={
            'on_change': ['txt_filter', 'txt_list'],
            'on_click': ['txt_filter', 'txt_list']
        },
        should_cascade_disable_on_change=True,
        should_cascade_clear_on_change=True)

    txt_filter = CustomStringField(label='Filter', is_disabled_on_error=True)

    txt_list = FilteredSelectField(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label='Text',
        size=12,
        filter_field='txt_filter',
        choices=[(0, '')],
        coerce=int,
        is_disabled_on_error=True,
        on_complete=['call_name_js', 'call_text'],
        inputs={
            'configuration': 'configuration',
            'view': 'view',
            'parent_zone': 'parent_zone',
            'name': 'text_record'
        },
        clear_dependencies={'on_change': ['name', 'text']},
        server_side_method=get_text_records_endpoint,
        enable_dependencies={'on_complete': ['name', 'text', 'submit']},
        disable_dependencies={'on_change': ['name', 'text', 'submit']},
        should_cascade_disable_on_change=True,
        should_cascade_clear_on_change=True)

    plain_1 = PlainHTML('<hr>')

    name = CustomStringField(label='New Name', is_disabled_on_error=True)

    text = CustomStringField(label='New Text',
                             inputs={'text': 'txt_list'},
                             is_disabled_on_error=True)

    submit = CustomSubmitField(label='Update')
コード例 #14
0
class GenericFormTemplate(GatewayForm):
    """ Form to generate HTML and Javascript for the snow_add_host_record_example workflow

    Note:
        When updating the form, remember to make the corresponding changes to the workflow pages
    """
    workflow_name = 'service_request_host'
    workflow_permission = 'service_request_host_page'

    zone = CustomZone(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label='Zone',
        required=True,
        is_disabled_on_start=False
    )

    input_x1_button_x1_aligned_open_1 = PlainHTML('<div class="input_x1_button_x1_aligned">')

    input_x1_aligned_open_1 = PlainHTML('<div class="input_x1_aligned">')

    ip4_network = IP4Network(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label='Network (Optional)',
        required=False,
        one_off=False,
        is_disabled_on_start=False
    )

    input_x1_aligned_close_1 = PlainHTML('</div>')

    get_next_available_ip4 = CustomSearchButtonField(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label='Get Next IPv4',
        server_side_method=get_next_ip4_address_endpoint,
        on_complete=['populate_ip4_address'],
        is_disabled_on_start=False,
    )

    input_x1_button_x1_aligned_close_1 = PlainHTML('</div>')

    clearfix_2 = PlainHTML('<div class="clearfix"> </div>')

    ip4_address = CustomIP4Address(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label='IP Address',
        required=True,
        inputs={'address': 'ip4_address'},
        result_decorator=filter_reserved,
        should_cascade_disable_on_change=True,
        is_disabled_on_start=False
    )

    hostname = CustomStringField(
        label='Hostname',
        required=True,
        is_disabled_on_start=False
    )

    deploy_now = CustomBooleanField(
        label='Deploy Now',
        is_disabled_on_start=False
    )

    submit = CustomSubmitField(
        label='Submit',
        is_disabled_on_start=False
    )
コード例 #15
0
class GenericFormTemplate(GatewayForm):
    """Form to generate HTML and Javascript for the update_text_record workflow

    Note:
        When updating the form, remember to make the corresponding changes to the workflow pages
    """

    workflow_name = "update_text_record"
    workflow_permission = "update_text_record_page"
    configuration = Configuration(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label="Configuration",
        required=True,
        coerce=int,
        clear_below_on_change=False,
        is_disabled_on_start=False,
        on_complete=["call_view"],
        enable_dependencies={"on_complete": ["view"]},
        disable_dependencies={"on_change": ["view"]},
        clear_dependencies={"on_change": ["view"]},
    )

    view = View(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label="View",
        required=True,
        one_off=True,
        clear_below_on_change=False,
        display_message=True,
        enable_dependencies={"on_complete": ["parent_zone"]},
        disable_dependencies={"on_change": ["parent_zone"]},
        clear_dependencies={"on_change": ["parent_zone"]},
        should_cascade_disable_on_change=True,
        should_cascade_clear_on_change=True,
    )

    parent_zone = Zone(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label="Zone",
        required=True,
        start_initialized=True,
        display_message=True,
        inputs={"zone": "parent_zone", "configuration": "configuration", "view": "view"},
        clear_below_on_change=False,
        enable_dependencies={"on_complete": ["text_record", "search"]},
        disable_dependencies={"on_change": ["text_record", "search"]},
        clear_dependencies={"on_change": ["text_record", "search"]},
        should_cascade_disable_on_change=True,
        should_cascade_clear_on_change=True,
    )

    text_record = CustomStringField(label="Text Record")

    search = CustomSearchButtonField(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        default="Search",
        inputs={
            "configuration": "configuration",
            "view": "view",
            "parent_zone": "parent_zone",
            "name": "text_record",
        },
        server_side_method=get_text_records_endpoint,
        display_message=True,
        on_complete=["call_txt_list"],
        enable_dependencies={"on_complete": ["txt_filter", "txt_list"]},
        disable_dependencies={
            "on_change": ["txt_filter", "txt_list"],
            "on_click": ["txt_filter", "txt_list"],
        },
        clear_dependencies={
            "on_change": ["txt_filter", "txt_list"],
            "on_click": ["txt_filter", "txt_list"],
        },
        should_cascade_disable_on_change=True,
        should_cascade_clear_on_change=True,
    )

    txt_filter = CustomStringField(label="Filter", is_disabled_on_error=True)

    txt_list = FilteredSelectField(
        workflow_name=workflow_name,
        permissions=workflow_permission,
        label="Text",
        size=12,
        filter_field="txt_filter",
        choices=[(0, "")],
        coerce=int,
        is_disabled_on_error=True,
        on_complete=["call_name_js", "call_text"],
        inputs={
            "configuration": "configuration",
            "view": "view",
            "parent_zone": "parent_zone",
            "name": "text_record",
        },
        clear_dependencies={"on_change": ["name", "text"]},
        server_side_method=get_text_records_endpoint,
        enable_dependencies={"on_complete": ["name", "text", "submit"]},
        disable_dependencies={"on_change": ["name", "text", "submit"]},
        should_cascade_disable_on_change=True,
        should_cascade_clear_on_change=True,
    )

    plain_1 = PlainHTML("<hr>")

    name = CustomStringField(label="New Name", is_disabled_on_error=True)

    text = CustomStringField(
        label="New Text", inputs={"text": "txt_list"}, is_disabled_on_error=True
    )

    submit = CustomSubmitField(label="Update")