diff --git a/app/__init__.py b/app/__init__.py index 91de74f79..e62b69f26 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -85,7 +85,10 @@ def inject_settings(): 'FEATURE_PORTS_REQUEST') else "no", enable_s3creds=app.config.get('FEATURE_S3CREDS_MENU') if app.config.get( 'FEATURE_S3CREDS_MENU') else "no", - s3_allowed_groups=app.config.get("S3_IAM_GROUPS") if app.config.get("S3_IAM_GROUPS") else [] + s3_allowed_groups=app.config.get("S3_IAM_GROUPS") if app.config.get("S3_IAM_GROUPS") else [], + enable_access_request=app.config.get("FEATURE_ACCESS_REQUEST") if app.config.get( + 'FEATURE_ACCESS_REQUEST') else "no", + access_request_tag=app.config.get("ACCESS_REQUEST_TAG") ) @@ -134,6 +137,9 @@ def inject_settings(): from app.swift.routes import swift_bp app.register_blueprint(swift_bp, url_prefix="/swift") +from app.services.routes import services_bp +app.register_blueprint(services_bp, url_prefix="/services") + if app.config.get("FEATURE_VAULT_INTEGRATION") == "yes": from app.vault.routes import vault_bp app.register_blueprint(vault_bp, url_prefix="/vault") diff --git a/app/deployments/templates/createdep.html b/app/deployments/templates/createdep.html index 3320b3c99..d85996916 100644 --- a/app/deployments/templates/createdep.html +++ b/app/deployments/templates/createdep.html @@ -220,7 +220,6 @@

//console.log("ok"); port.removeClass("is-invalid"); } - } function validateCidr(input){ @@ -235,7 +234,20 @@

//console.log("ok"); cidr.removeClass("is-invalid"); } +} +function validateHostname(input){ + var hostname = $(input) + //console.log("val: \"" + hostname.val() + "\""); + let val = hostname.val(); + let re = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/; + if (!re.test(val)){ + hostname.addClass("is-invalid"); + } + else { + //console.log("ok"); + hostname.removeClass("is-invalid"); + } } function __attachValidationHandler(input) { diff --git a/app/deployments/templates/input_types.html b/app/deployments/templates/input_types.html index 3bd3647ea..c23c0aeb4 100644 --- a/app/deployments/templates/input_types.html +++ b/app/deployments/templates/input_types.html @@ -71,6 +71,12 @@ + + {% elif value.type == "hostname" %} + +
Please provide a valid hostname
+ + {% elif value.type == "email" %} diff --git a/app/home/routes.py b/app/home/routes.py index 6e14ab0b2..388ed7745 100644 --- a/app/home/routes.py +++ b/app/home/routes.py @@ -141,19 +141,11 @@ def home(): session['userrole'] = user.role # role - # templates_info = {} - # tg = False - # - # if tosca.tosca_gmetadata: - # templates_info = {k: v for (k, v) in tosca.tosca_gmetadata.items() if - # check_template_access(v.get("metadata").get("allowed_groups"), user_groups)} - # tg = True - # else: - # templates_info = {k: v for (k, v) in toscaInfo.items() if - # check_template_access(v.get("metadata").get("allowed_groups"), user_groups)} + services = dbhelpers.get_services(visibility='public') + services.extend(dbhelpers.get_services(visibility='private', groups=[session['active_usergroup']])) templates_info, enable_template_groups = check_template_access(user_groups, session['active_usergroup']) - return render_template(app.config.get('PORTFOLIO_TEMPLATE'), templates_info=templates_info, + return render_template(app.config.get('PORTFOLIO_TEMPLATE'), services=services, templates_info=templates_info, enable_template_groups=enable_template_groups) diff --git a/app/home/templates/base.html b/app/home/templates/base.html index e2fef5c80..6a8be9ee2 100644 --- a/app/home/templates/base.html +++ b/app/home/templates/base.html @@ -28,6 +28,9 @@ + + + @@ -95,7 +98,7 @@ {% if session['username'] %}