src/Platform/ControlPanelBundle/Resources/views/Dashboard/Tenant/onerosterLanding.html.twig line 1

Open in your IDE?
  1. {% extends '@PlatformControlPanel/base.html.twig' %}
  2. {% block header %}
  3.     {% embed '@ui/common/headers/new.html.twig' with {
  4.         subtitle: 'One Roster',
  5.         title: tenant.name
  6.     } %}
  7.         {% block actions %}
  8.             {% include '@ui/common/buttons/default.html.twig' with {
  9.                 text: 'Back to List',
  10.                 link: path(routes.one_roster_syncs),
  11.                 icon: 'arrow'
  12.             } %}
  13.             {% if cms.tenant.id == tenant.id and sync %}
  14.                 {% include '@ui/common/buttons/default.html.twig' with {
  15.                     text: 'Delete',
  16.                     link: path('platform.control_panel.dashboard.tenant.one_roster_delete', {
  17.                         tenant: tenant.id,
  18.                     }),
  19.                     icon: 'remove',
  20.                     helper: 'danger'
  21.                 } %}
  22.             {% endif %}
  23.             {% if sync %}
  24.                 {% include '@ui/common/buttons/default.html.twig' with {
  25.                     text: 'Logs',
  26.                     link: 'https://' ~ tenant.slug ~ '.' ~ cms.contextManager.globalContext.dashboard(true) ~ '/_dashboard/logs/oneroster',
  27.                     icon: 'flag'
  28.                 } %}
  29.                 {% include '@ui/common/buttons/default.html.twig' with {
  30.                     text: 'Explorer',
  31.                     link: path('platform.control_panel.dashboard.tenant.one_roster_explorer', {
  32.                         tenant: tenant.id,
  33.                     }),
  34.                     icon: 'rocket'
  35.                 } %}
  36.                 {% include '@ui/common/buttons/default.html.twig' with {
  37.                     text: sync.active ? 'Pause' : 'Activate',
  38.                     link: path('platform.control_panel.dashboard.tenant.one_roster_toggle_sync', {
  39.                         tenant: tenant.id,
  40.                     }),
  41.                     icon: sync.active ? 'pause' : 'play',
  42.                     helper: 'warning'
  43.                 } %}
  44.             {% endif %}
  45.             {% include '@ui/common/buttons/default.html.twig' with {
  46.                 text: 'Setup',
  47.                 link: path('platform.control_panel.dashboard.tenant.one_roster_setup', {
  48.                     tenant: tenant.id,
  49.                 }),
  50.                 icon: 'gear',
  51.                 helper: 'info'
  52.             } %}
  53.         {% endblock %}
  54.     {% endembed %}
  55. {% endblock %}
  56. {% block content %}
  57.     {% if sync is not empty %}
  58.         {% include '@ui/common/buttons/default.html.twig' with {
  59.             text: 'Trigger Init',
  60.             link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
  61.                 tenant: tenant.id,
  62.                 action: 'init',
  63.             }),
  64.         } %}
  65.         {% include '@ui/common/buttons/default.html.twig' with {
  66.             text: 'Trigger Stash',
  67.             link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
  68.                 tenant: tenant.id,
  69.                 action: 'stash',
  70.             }),
  71.         } %}
  72.         {% include '@ui/common/buttons/default.html.twig' with {
  73.             text: 'Trigger Fix',
  74.             link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
  75.                 tenant: tenant.id,
  76.                 action: 'fix',
  77.             }),
  78.         } %}
  79.         {% include '@ui/common/buttons/default.html.twig' with {
  80.             text: 'Trigger Prepare',
  81.             link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
  82.                 tenant: tenant.id,
  83.                 action: 'prepare',
  84.             }),
  85.         } %}
  86.         {% include '@ui/common/buttons/default.html.twig' with {
  87.             text: 'Trigger Process',
  88.             link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
  89.                 tenant: tenant.id,
  90.                 action: 'process',
  91.             }),
  92.         } %}
  93.         {% include '@ui/common/buttons/default.html.twig' with {
  94.             text: 'Trigger Link',
  95.             link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
  96.                 tenant: tenant.id,
  97.                 action: 'link',
  98.             }),
  99.         } %}
  100.         {% include '@ui/common/buttons/default.html.twig' with {
  101.             text: 'Trigger Tweak',
  102.             link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
  103.                 tenant: tenant.id,
  104.                 action: 'tweak',
  105.             }),
  106.         } %}
  107.         {% include '@ui/common/buttons/default.html.twig' with {
  108.             text: 'Trigger Tidy',
  109.             link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
  110.                 tenant: tenant.id,
  111.                 action: 'tidy',
  112.             }),
  113.         } %}
  114.         <div class="row mt-2">
  115.             <div class="col-lg-6">
  116.                 <h2>Information</h2>
  117.                 <dl class="dl-horizontal">
  118.                     <dt>Tenant ID</dt>
  119.                     <dd>{{ sync.tenant.id }} [{{ sync.tenant.uid }}]</dd>
  120.                     <dt>Sync ID</dt>
  121.                     <dd>{{ sync.id }} [{{ sync.uid }}]</dd>
  122.                     <dt>Vendor</dt>
  123.                     <dd>{{ sync.vendor }}</dd>
  124.                     <dt>Schedule</dt>
  125.                     <dd>{{- sync.schedule ? sync.scheduleRuleHumanReadable|capitalize : '—' -}}</dd>
  126.                     <dt>Next Run</dt>
  127.                     <dd>{{- sync.schedule ? sync.nextRunAt|ui_datetime : '—' -}}</dd>
  128.                     <dt>Api Client ID</dt>
  129.                     <dd>{{ sync.apiClientId }}</dd>
  130.                     <dt>Api Secret</dt>
  131.                     <dd>{{ sync.apiClientSecret }}</dd>
  132.                     <dt>Api Token</dt>
  133.                     <dd><pre>{{ sync.apiToken|json_encode(constant('JSON_PRETTY_PRINT')) }}</pre></dd>
  134.                 </dl>
  135.             </div>
  136.             <div class="col-lg-6">
  137.                 <h2>Sync Strategies</h2>
  138.                 <dl class="dl-horizontal">
  139.                     {% for key,value in constant('STRATEGIES', sync) %}
  140.                         <dt style="width: 380px;">{{ key }}</dt>
  141.                         {% if sync.hasStrategy(value) %}
  142.                             <dd style="margin-left: 400px;"><i class="fa fa-check text-success"></i></dd>
  143.                         {% else %}
  144.                             <dd style="margin-left: 400px;"><i class="fa fa-times text-danger"></i></dd>
  145.                         {% endif %}
  146.                     {% endfor %}
  147.                 </dl>
  148.                 <h2>Sync Flags</h2>
  149.                 <dl class="dl-horizontal">
  150.                     {% for key,value in constant('FLAGS', sync) %}
  151.                         <dt style="width: 380px;">{{ key }}</dt>
  152.                         {% if sync.hasFlag(value) %}
  153.                             <dd style="margin-left: 400px;"><i class="fa fa-check text-success"></i></dd>
  154.                         {% else %}
  155.                             <dd style="margin-left: 400px;"><i class="fa fa-times text-danger"></i></dd>
  156.                         {% endif %}
  157.                     {% endfor %}
  158.                 </dl>
  159.             </div>
  160.         </div>
  161.         {% if sync.jobs.count %}
  162.             {% with {
  163.                 job: sync.lastJob
  164.             } %}
  165.                 <h2>Last Job</h2>
  166.                 <div class="row">
  167.                     <div class="col-lg-6">
  168.                         <dl class="dl-horizontal">
  169.                             <dt>Job ID</dt>
  170.                             <dd>{{ job.id }}</dd>
  171.                             <dt>Job Start Phase</dt>
  172.                             <dd>{{ job.startPhaseName ?: '—' }} [{{ job.startPhase }}]</dd>
  173.                             <dt>Job Status</dt>
  174.                             <dd>{{ job.status }}</dd>
  175.                             <dt>Job Created</dt>
  176.                             <dd>{{ job.createdAt|ui_datetime }}</dd>
  177.                             <dt>Job First Activity</dt>
  178.                             <dd>{{ (job.firstActivityAt) ? job.firstActivityAt|ui_datetime : '—' }}</dd>
  179.                             <dt>Job Last Activity</dt>
  180.                             <dd>{{ (job.lastActivityAt) ? job.lastActivityAt|ui_datetime : '—' }}</dd>
  181.                             <dt>Job Runtime</dt>
  182.                             <dd>{{ (job.firstActivityAt and job.lastActivityAt) ? job.lastActivityAt.diff(job.firstActivityAt)|ui_dtspan : '—' }}</dd>
  183.                             <dt>Semaphore</dt>
  184.                             <dd>{{ job.semaphore }}</dd>
  185.                             <dt>Phases Ready</dt>
  186.                             <dd style="font-family: monospace;">{{ job.phasesReady|decbin|lpad(8, '0') }}</dd>
  187.                             <dt>Phases Running</dt>
  188.                             <dd style="font-family: monospace;">{{ job.phasesRunning|decbin|lpad(8, '0') }}</dd>
  189.                             <dt>Phases Complete</dt>
  190.                             <dd style="font-family: monospace;">{{ job.phasesComplete|decbin|lpad(8, '0') }}</dd>
  191.                             <dt>Syncing Errors</dt>
  192.                             <dd>{{ job.countLogs() }}</dd>
  193.                         </dl>
  194.                     </div>
  195.                     <div class="col-lg-6">
  196.                         <dd class="dl-horizontal">
  197.                             <dt>Job Error</dt>
  198.                             <dd><pre>{{ job.error|json_encode(constant('JSON_PRETTY_PRINT')) }}</pre></dd>
  199.                         </dd>
  200.                     </div>
  201.                 </div>
  202.             {% endwith %}
  203.             {% if sync.jobs.count > 1 %}
  204.                 <div class="row">
  205.                     <div class="col-lg-12">
  206.                         <h2>Recent Jobs</h2>
  207.                         <table class="table table-striped">
  208.                             <thead>
  209.                                 <tr>
  210.                                     <th>Job ID</th>
  211.                                     <th>Started At</th>
  212.                                 </tr>
  213.                             </thead>
  214.                             <tbody>
  215.                             {% for job in sync.lastJobs %}
  216.                                 <tr>
  217.                                     <td>{{ job.id }}</td>
  218.                                     <td>{{ job.createdAt|ui_datetime }}</td>
  219.                                 </tr>
  220.                             {% endfor %}
  221.                             </tbody>
  222.                         </table>
  223.                     </div>
  224.                 </div>
  225.             {% endif %}
  226.         {% endif %}
  227.     {% else %}
  228.         {% include '@ui/common/buttons/default.html.twig' with {
  229.             text: 'Setup',
  230.             link: path('platform.control_panel.dashboard.tenant.one_roster_setup', {
  231.                 tenant: tenant.id
  232.             }),
  233.             helper: 'primary',
  234.         } %}
  235.     {% endif %}
  236. {% endblock %}