{% import "utils.jinja" as utils %} {% set ns = namespace(first_tab=None) -%} {% set quota_types = [ ('personal', 'Personal', user_quota.have_personal), ('service', 'Service', user_quota.have_service), ('jupyter', 'JupyterCloud', True), ] -%} {% macro get_active(tab_name) -%} {% if ns.first_tab == tab_name -%} active {%- endif %} {%- endmacro %} {% macro tab(name, label) -%} {% if not ns.first_tab -%} {% set ns.first_tab = name %} {%- endif %} {%- endmacro %} {% macro select_with_title(group, name, title, values, default) -%}
{{ caller() }}
{%- endmacro %} {% macro simple_select_with_title(group, name, title) -%} {% call select_with_title(group, name, title, ['null'], ['null']) -%} {%- endcall %} {%- endmacro %} {% macro tab_content(name, is_present) -%} {% if is_present -%}
{% if last_backup -%} {%- elif restoring_from_backup -%} {%- endif %} {{ caller() }}
{{ simple_select_with_title(name, 'cluster', 'Data Center') }} {{ simple_select_with_title(name, 'account', 'Account') }} {{ simple_select_with_title(name, 'segment', 'Segment') }} {{ simple_select_with_title(name, 'preset', 'VM Size') }} {% call select_with_title(name, 'network_id', 'Network Macro', available_networks, default_network) -%} {% if available_networks %} {% set level = 'info' %} {% else %} {% set level = 'danger' %} {% endif %} {%- endcall %} {{ utils.settings_panel(name, settings_registry) }}
{%- endif %} {%- endmacro %} {% macro oauth_message(quota_name, have_token) -%} {% if not have_token -%} {% else %}
{%- endif %} {%- endmacro %}
{% call tab_content('personal', user_quota.have_personal) -%} {{ oauth_message('personal', user_quota.have_oauth_token) }} {%- endcall %} {% call tab_content('service', user_quota.have_service) -%}
{%- endcall %} {% call tab_content('jupyter', True) -%} {% if not user_quota.have_any_idm_role -%} {% else %}
{%- endif %} {%- endcall %}