{#- A data plugin's Connection (spec/plugin-pages-follow-their-role): notices, then "Key", "Limits and use", "Stream" and, from 0.32.0, "Sessions" (each session's latency), then, for a plugin holding connectivity too (457), connectivity's sections of `data.trading` beside them where the screen is wide enough, its key said once, then the vendor's sections. `data` is a meridian.roles.data.ConnectionRead, or the plugin's record extending it. -#} {% extends "meridian/base.html" %} {% import "meridian/roles/_rows.html" as om %} {% block content %} {% if data.mode == "No key" %} {{ om.next_step("No key yet", "Enter it in", "settings", "Settings") }} {% elif data.mode == "Sample data" %}
Sample data: the plugin answers from recorded responses; the vendor is not called.
{% endif %} {% if data.last_error %}{% endif %} {% if notice is defined and notice %}
{{ notice }}
{% endif %} {% if data.trading and data.trading.environment_to_save %}
Environment holds "{{ data.trading.environment_to_save }}", no longer offered: save it again in Settings.
{% endif %} {% if data.trading and data.trading.badge %}{% import "meridian/kit.html" as kit %}

Connection {% if data.trading.badge == "Demo" %}{{ kit.badge("Demo", "good") }}{% elif data.trading.badge == "Live" %}{{ kit.badge("Live", "warn") }}{% else %}{{ kit.badge(data.trading.badge, "bad") }}{% endif %} The session reached {{ venue|default("the venue") }}'s {{ data.trading.reached_environment }} host; agents may place orders only on a Demo connection.

{% endif %} {% block vendor_notices %}{% endblock %} {% if data.trading %}
{% endif %} {% for section in ["Key", "Limits and use", "Stream", "Sessions"] %}

{{ section }}

{% if section == "Key" %} {{ om.row("Mode", data.mode, {"Live": "The vendor's live service.", "Sandbox": "The vendor's sandbox.", "Sample data": "Recorded responses; the vendor is not called.", "No key": "Nothing is read until a key is entered in Settings."}.get(data.mode, "")) }} {% set key %}{% for each in data.credentials %}{{ each.label }}: {{ "set" if each.set else "not set" }}{% if not loop.last %}; {% endif %}{% endfor %}{% endset %} {{ om.row("Key", key|trim or "No key needed") }} {{ om.row("Entitled at the vendor", data.entitled_at_vendor or "Not reported") }} {% elif section == "Limits and use" %} {{ om.row("Limit", data.limit or "Not reported") }} {{ om.row("Calls", data.calls, (data.rate_limited ~ " rate-limited and waited out") if data.rate_limited else "") }} {{ om.row("Last call", data.last_call_at or "None yet") }} {{ om.row("Last error", data.last_error or "None") }} {% elif section == "Sessions" %} {{ om.session_rows(data.session_latency or (data.trading.session_latency if data.trading else [])) }} {% else %} {% if data.sessions is none %} {{ om.row("Streaming", "Does not stream") }} {% else %} {{ om.row("Streaming", data.sessions ~ (" session" if data.sessions == 1 else " sessions") if data.sessions else "Off") }} {% endif %} {% endif %} {% block vendor_rows scoped %}{% endblock %}
{% endfor %} {% if data.trading %}
{% set trading = data.trading %} {% set merged = true %} {% include "meridian/roles/connectivity/_sections.html" %}
{% endif %} {% block vendor_sections %}{% endblock %} {% endblock %}