{% load split %}
<div class="under-construction card-header" style="padding-bottom: 0; border-bottom: 0;">
    <div class="panel-body">
	  	<div class="row"  style="position: relative; background-color: rgba(255,255,255,0.7)">
	  		<div  class="col-sm-2">
				<div style="line-height:1; padding-left:0; display: inline-block;">
					<a href="//staff.yandex-team.ru/{{ job.person }}" class="auto-person-card" title="{{ job.person }}"><img class="img-circle" src="//center.yandex-team.ru/user/avatar/{{job.person}}/140/square" height="70" width="70"/></a>
				</div>
				<div style="position:absolute; padding-left:10px; display: inline-block;">
					<span style="font-size: 28px; font-weight: bold; white-space: nowrap; line-height: 1;">{{ job.id }}</span>
                    <br>
				</div>
				<button type="button" class="btn btn-secondary" id="online_stop" style="margin-top: 35px; margin-left: 10px;">
			          Остановить
				</button>
				<div class="input-group" id="online_stop__dialog" style="display: none; margin-top: 35px; margin-left: 10px;">
			  		<span class="input-group-addon" id="basic-addon3">
			           Остановить?
			        </span>
			        <span class="input-group-btn">
				        <button type="button" class="btn btn-danger" id="online_stop__ok" data-job="{{ job.n }}">
				                     Да
				        </button>
				        <button type="button" class="btn btn-secondary" id="online_stop__cancel">
				                     Нет
						</button>
					</span>
				</div>
			</div>
			<div class="col-sm-2" id="codesIndicators">
				<span>{{ job.data_started|date:"d M 'y H:i:s" }} ({{ job.duration }})</span>
				<div style="padding:5px 0;">
                    <b class="{% if net_errors == 0 %} tag tag-success {% else %} tag tag-danger {% endif %}" id="netIndicator">NET</b>

                    {% if http_codes.2 %}<b class="tag tag-success" title="http" id="http200Indicator">2xx</b>{% endif %}
					{% if http_codes.3 %}<b class="tag tag-info" title="http" id="http300Indicator">3xx</b>{% endif %}
					{% if http_codes.4 %}<b class="tag tag-warning" title="http" id="http400Indicator">4xx</b>{% endif %}
					{% if http_codes.5 %}<b class="tag tag-danger" title="http" id="http500Indicator">5xx</b>{% endif %}
					&nbsp;
				</div>
			</div>
			<div class="col-sm-5">
				<dl>
					<dd style="font-weight: bold; white-space: normal;">
						<span class="b-overload-offline-meta__title b-editable" id="name" data-action="edit-name">{% if job.name %}{{ job.name }}{% else %}<span style="color: gray;">Имя стрельбы</span>{% endif %}</span>
						<span class="fa fa-pencil text-warning" id="name_pencil" style="display: none;"></span>
						<div class="b_editname_block" style="display: none;">
							<table>
								<tr>
									<td width="100%">
										<input type="text" id="b_editname_block__firename__" class="form-control">
									</td>
									<td>
									<div id="b_editname_block__okey__">
										<span class="fa fa-check text-success b-editable" style="font-size: 12px; cursor: pointer;"></span>
									</div></td>
									<td>
									<div id="b_editname_block__cancel__">
										<span class="fa fa-ban text-danger b-editable" style="font-size: 12px; cursor: pointer;"></span>
									</div></td>
									<td>
									<div id="b_editname_block__ajax__"style="display:none;">
										<i class="krutilka fa fa-circle-o-notch fa-spin" aria-hidden="true"></i>
									</div></td>
								</tr>
							</table>
						</div>
					</dd>
					<dd style="white-space: normal; max-height: 108px; overflow: auto;">
						<span class="b-overload-offline-meta__description b-editable" id="dsc" data-action="edit-dsc" style="font-size: 80%; white-space: pre-line">{% if job.dsc %}{{ job.dsc }}{% else %}<span style="color: gray;">Описание</span>{% endif %}</span>
						<span class="fa fa-pencil text-warning" id="dsc_pencil" style="display: none;"></span>
						<div class="b_editdsc_block" style="display: none;">
							<table>
								<tr>
									<td width="100%">
										<textarea id="b_editdsc_block__dsc__" class="form-control"></textarea></td>
									<td>
									<div id="b_editdsc_block__okey__">
										<span class="fa fa-check text-success" style="font-size: 12px; cursor: pointer;"></span>
									</div>
									<div id="b_editdsc_block__cancel__">
										<span class="fa fa-ban text-danger" style="font-size: 12px; cursor: pointer;"></span>
									</div>
									<div id="b_editdsc_block__ajax__" style="display:none;">
										<i class="krutilka fa fa-circle-o-notch fa-spin" aria-hidden="true"></i>
									</div></td>
								</tr>
							</table>
						</div>
					</dd>
				</dl>
			</div>
			<div class="col-sm-3">
				<div style="float: right; padding-right: 10px;">
			  		<span>
			           Участок
			        </span>
			        <div class="btn-group">
						<button type="button" class="btn btn-secondary btn-sm onlinepage__show active" data-limit="60">
							1 мин.
						</button>
						<button type="button" class="btn btn-secondary btn-sm onlinepage__show" data-limit="300">
							5 мин.
						</button>
						<button type="button" class="btn btn-secondary btn-sm onlinepage__show" data-limit="600">
							10 мин.
						</button>
						<button type="button" class="btn btn-secondary btn-sm onlinepage__show" data-limit="3600">
							1 час.
						</button>
					</div>
				</div>
				<br>
				<br>
				<div style="float: right; padding-right: 10px;">
			  		<span>
						Обновлять через
			        </span>
			        <div class="btn-group">
						<button type="button" class="btn btn-secondary btn-sm onlinepage__refresh" data-refresh="2">
							2 сек.
						</button>
						<button type="button" class="btn btn-secondary btn-sm onlinepage__refresh active" data-refresh="3">
							3 сек.
						</button>
						<button type="button" class="btn btn-secondary btn-sm onlinepage__refresh" data-refresh="5">
							5 сек.
						</button>
						<button type="button" class="btn btn-secondary btn-sm onlinepage__refresh" data-refresh="10">
							10 сек.
						</button>
					</div>
				</div>
			</div>
			<div style="float:right; position: relative;">
				<a class="job-meta__more clickable no-link-deco text-info" data-toggle="collapse" href="#collapseJobMeta">
					<span class="fa fa-plus" style="font-size: 14px;"></span>
				</a>
			</div>
		</div>
		<div class="panel-collapse collapse" id="collapseJobMeta">
        <div class="panel-body" >
			<hr style="border: none; border-top: 1px solid #EEE; margin: 1em 0.5em;">
			<div class="row">
				<div class="col-md-3" style="font-weight: 500;">
					Танк/мишень:
				</div>
				<div class="col-md-9">
					{{ job.tank_reduced }} &rarr; {{ job.srv_reduced }}:{{ job.srv_port }}
				</div>
			</div>
            <div class="row">
				<div class="col-md-3" style="font-weight: 500;">
					UserAgent танка:
				</div>
				<div class="col-md-9">
					{{ user_agent }}
				</div>
			</div>
			<div class="row">
				<div class="col-md-3" style="font-weight: 500;">
					Патроны:
				</div>
				<div class="col-md-9">
					{{ job.ammo_path }} (loop={{ job.loop_cnt }})
				</div>
			</div>
			{% if multitag %}
				<div class="row">
					<div class="col-md-3" style="font-weight: 500;">
						Мультитэги:
					</div>
					<div class="col-md-9">
						Да &nbsp;
					</div>
				</div>
			{% endif %}
			<div class="row">
				<div class="col-md-3" style="font-weight: 500;">
					Схема нагрузки:
				</div>
				<div class="col-md-9">
					{{ schema }} &nbsp;
				</div>
			</div>
			<div class="row">
				<div class="col-md-3" style="font-weight: 500;">
					Версия:
				</div>
				<div class="col-md-9">
					{{ job.ver }} &nbsp;
				</div>
			</div>
				{% if job.component %}
				<div class="row">
					<div class="col-md-3" style="font-weight: 500;">
						Регрессия:
					</div>
					<div class="col-md-9">
						<a href="/regress/{{ task.project }}/{{ component.n }}"> {{ component.name }}</a>
					</div>
				</div>
				{% endif %}
			<div class="row">
				<div class="col-md-3" style="font-weight: 500;">
					Инстансов phantom:
				</div>
				<div class="col-md-9">
					{{ job.instances }}
				</div>
			</div>
			<div class="row">
				<div class="col-md-3" style="font-weight: 500;">
					Команда запуска:
				</div>
				<div class="col-md-9">
					{{ job.command_line }}
				</div>
			</div>
			{% if jenkinsbuild %}
				<div class="row">
					<div class="col-md-3" style="font-weight: 500;">
						Jenkins build:
					</div>
					<div class="col-md-9">
						<a href="{{ jenkinsbuild }}">{{ jenkinsbuild }}</a>
					</div>
				</div>
			{% endif %}
			{% if jenkinsjob %}
				<div class="row">
					<div class="col-md-3" style="font-weight: 500;">
						Задача в Jenkins:
					</div>
					<div class="col-md-9">
						<a href="{{ jenkinsjob }}">{{ jenkinsjob }}</a>
					</div>
				</div>
			{% endif %}
			<div class="row">
				<div class="col-md-3" style="font-weight: 500;">
					Снимок опций танка:
				</div>
				<div class="col-md-9">
					<a target="_blank" href="/api/job/{{ job.n }}/configinfo.txt">configinfo.txt</a>
				</div>
			</div>
            {% if configinitial %}
                <div class="row">
                    <div class="col-md-3" style="font-weight: 500;">
                        Исходный конфиг:
                    </div>
                    <div class="col-md-8">
                        <a target="_blank" href="/api/job/{{ job.n }}/configinitial.txt">configinitial.txt</a>
                    </div>
                    <div class="col-md-1"></div>
                </div>
            {% endif %}
            {% if has_monitoring %}
                <div class="row">
                    <div class="col-md-3" style="font-weight: 500;">
                        Конфиг мониторинга:
                    </div>
                    <div class="col-md-8">
                        <a target="_blank" href="/api/job/{{ job.n }}/jobmonitoringconfig.txt">monitoring_config.txt</a>
                    </div>
                    <div class="col-md-1"></div>
                </div>
            {% endif %}
			{% if artifacts %}
				<div class="row">
					<div class="col-md-3" style="font-weight: 500;">
						Артефакты стрельбы:
					</div>
					<div class="col-md-9">
					&nbsp;
					</div>
				</div>
			{% endif %}
			{% for art in artifacts %}
				<div class="row">
					<div class="col-md-3" style="font-weight: 500;">
					&nbsp;
					</div>
					<div class="col-md-9">
						<a target="_blank" href="{{ art.1 }}" class="b_link">{{ art.0 }}</a>&ensp;<a target="_blank" href="{{ art.1 }}&download=1" class="b_link"><span class="fa fa-download text-info"></span></a>
					</div>
				</div>
			{% endfor %}
		</div>
	</div>
	</div>
    <ul style="margin-top: 10px;" class="nav nav-tabs card-header-tabs pull-xs-left job-tabpanel__tabs" id="job-tabpanel__tabs">
    </ul>
</div>
<link href="/media/css/onlinepage.css?version=43.4" type="text/css" rel="stylesheet" />
<script nonce='{{ common.CSP_SCRIPT_NONCE }}' type='text/javascript' src='/media/js/onlinepage/meta.js?version=43.4'></script>
