{% extends '@PlatformControlPanel/base.html.twig' %}
{% block header %}
{% embed '@ui/common/headers/new.html.twig' with {
subtitle: 'One Roster',
title: tenant.name
} %}
{% block actions %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Back to List',
link: path(routes.one_roster_syncs),
icon: 'arrow'
} %}
{% if cms.tenant.id == tenant.id and sync %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Delete',
link: path('platform.control_panel.dashboard.tenant.one_roster_delete', {
tenant: tenant.id,
}),
icon: 'remove',
helper: 'danger'
} %}
{% endif %}
{% if sync %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Logs',
link: 'https://' ~ tenant.slug ~ '.' ~ cms.contextManager.globalContext.dashboard(true) ~ '/_dashboard/logs/oneroster',
icon: 'flag'
} %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Explorer',
link: path('platform.control_panel.dashboard.tenant.one_roster_explorer', {
tenant: tenant.id,
}),
icon: 'rocket'
} %}
{% include '@ui/common/buttons/default.html.twig' with {
text: sync.active ? 'Pause' : 'Activate',
link: path('platform.control_panel.dashboard.tenant.one_roster_toggle_sync', {
tenant: tenant.id,
}),
icon: sync.active ? 'pause' : 'play',
helper: 'warning'
} %}
{% endif %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Setup',
link: path('platform.control_panel.dashboard.tenant.one_roster_setup', {
tenant: tenant.id,
}),
icon: 'gear',
helper: 'info'
} %}
{% endblock %}
{% endembed %}
{% endblock %}
{% block content %}
{% if sync is not empty %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Trigger Init',
link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
tenant: tenant.id,
action: 'init',
}),
} %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Trigger Stash',
link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
tenant: tenant.id,
action: 'stash',
}),
} %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Trigger Fix',
link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
tenant: tenant.id,
action: 'fix',
}),
} %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Trigger Prepare',
link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
tenant: tenant.id,
action: 'prepare',
}),
} %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Trigger Process',
link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
tenant: tenant.id,
action: 'process',
}),
} %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Trigger Link',
link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
tenant: tenant.id,
action: 'link',
}),
} %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Trigger Tweak',
link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
tenant: tenant.id,
action: 'tweak',
}),
} %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Trigger Tidy',
link: path('platform.control_panel.dashboard.tenant.one_roster_action', {
tenant: tenant.id,
action: 'tidy',
}),
} %}
<div class="row mt-2">
<div class="col-lg-6">
<h2>Information</h2>
<dl class="dl-horizontal">
<dt>Tenant ID</dt>
<dd>{{ sync.tenant.id }} [{{ sync.tenant.uid }}]</dd>
<dt>Sync ID</dt>
<dd>{{ sync.id }} [{{ sync.uid }}]</dd>
<dt>Vendor</dt>
<dd>{{ sync.vendor }}</dd>
<dt>Schedule</dt>
<dd>{{- sync.schedule ? sync.scheduleRuleHumanReadable|capitalize : '—' -}}</dd>
<dt>Next Run</dt>
<dd>{{- sync.schedule ? sync.nextRunAt|ui_datetime : '—' -}}</dd>
<dt>Api Client ID</dt>
<dd>{{ sync.apiClientId }}</dd>
<dt>Api Secret</dt>
<dd>{{ sync.apiClientSecret }}</dd>
<dt>Api Token</dt>
<dd><pre>{{ sync.apiToken|json_encode(constant('JSON_PRETTY_PRINT')) }}</pre></dd>
</dl>
</div>
<div class="col-lg-6">
<h2>Sync Strategies</h2>
<dl class="dl-horizontal">
{% for key,value in constant('STRATEGIES', sync) %}
<dt style="width: 380px;">{{ key }}</dt>
{% if sync.hasStrategy(value) %}
<dd style="margin-left: 400px;"><i class="fa fa-check text-success"></i></dd>
{% else %}
<dd style="margin-left: 400px;"><i class="fa fa-times text-danger"></i></dd>
{% endif %}
{% endfor %}
</dl>
<h2>Sync Flags</h2>
<dl class="dl-horizontal">
{% for key,value in constant('FLAGS', sync) %}
<dt style="width: 380px;">{{ key }}</dt>
{% if sync.hasFlag(value) %}
<dd style="margin-left: 400px;"><i class="fa fa-check text-success"></i></dd>
{% else %}
<dd style="margin-left: 400px;"><i class="fa fa-times text-danger"></i></dd>
{% endif %}
{% endfor %}
</dl>
</div>
</div>
{% if sync.jobs.count %}
{% with {
job: sync.lastJob
} %}
<h2>Last Job</h2>
<div class="row">
<div class="col-lg-6">
<dl class="dl-horizontal">
<dt>Job ID</dt>
<dd>{{ job.id }}</dd>
<dt>Job Start Phase</dt>
<dd>{{ job.startPhaseName ?: '—' }} [{{ job.startPhase }}]</dd>
<dt>Job Status</dt>
<dd>{{ job.status }}</dd>
<dt>Job Created</dt>
<dd>{{ job.createdAt|ui_datetime }}</dd>
<dt>Job First Activity</dt>
<dd>{{ (job.firstActivityAt) ? job.firstActivityAt|ui_datetime : '—' }}</dd>
<dt>Job Last Activity</dt>
<dd>{{ (job.lastActivityAt) ? job.lastActivityAt|ui_datetime : '—' }}</dd>
<dt>Job Runtime</dt>
<dd>{{ (job.firstActivityAt and job.lastActivityAt) ? job.lastActivityAt.diff(job.firstActivityAt)|ui_dtspan : '—' }}</dd>
<dt>Semaphore</dt>
<dd>{{ job.semaphore }}</dd>
<dt>Phases Ready</dt>
<dd style="font-family: monospace;">{{ job.phasesReady|decbin|lpad(8, '0') }}</dd>
<dt>Phases Running</dt>
<dd style="font-family: monospace;">{{ job.phasesRunning|decbin|lpad(8, '0') }}</dd>
<dt>Phases Complete</dt>
<dd style="font-family: monospace;">{{ job.phasesComplete|decbin|lpad(8, '0') }}</dd>
<dt>Syncing Errors</dt>
<dd>{{ job.countLogs() }}</dd>
</dl>
</div>
<div class="col-lg-6">
<dd class="dl-horizontal">
<dt>Job Error</dt>
<dd><pre>{{ job.error|json_encode(constant('JSON_PRETTY_PRINT')) }}</pre></dd>
</dd>
</div>
</div>
{% endwith %}
{% if sync.jobs.count > 1 %}
<div class="row">
<div class="col-lg-12">
<h2>Recent Jobs</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Job ID</th>
<th>Started At</th>
</tr>
</thead>
<tbody>
{% for job in sync.lastJobs %}
<tr>
<td>{{ job.id }}</td>
<td>{{ job.createdAt|ui_datetime }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% endif %}
{% else %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Setup',
link: path('platform.control_panel.dashboard.tenant.one_roster_setup', {
tenant: tenant.id
}),
helper: 'primary',
} %}
{% endif %}
{% endblock %}