<commit_before>## -*- coding: utf-8 -*-
## Licensed to Cloudera, Inc. under one
## or more contributor license agreements.  See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership.  Cloudera, Inc. licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License.  You may obtain a copy of the License at
##
##     http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.

<%!
  from desktop.views import commonheader, commonfooter, _ko
  from django.utils.translation import ugettext as _
  
  from oozie.conf import ENABLE_V2
%>

<%namespace name="layout" file="../navigation-bar.mako" />
<%namespace name="utils" file="../utils.inc.mako" />

${ commonheader(_("Coordinator Dashboard"), "oozie", user) | n,unicode }
${ layout.menubar(section='coordinators', dashboard=True) }

<link rel="stylesheet" href="${ static('oozie/css/coordinator.css') }" type="text/css" />

<div class="container-fluid">
  <div class="card card-small">
    <div class="card-body">

      <div class="row-fluid">
        <div class="span2">
          <div class="sidebar-nav">
            <ul class="nav nav-list" style="border:none">
              <li class="nav-header">${ _('Coordinator') }</li>
              % if coordinator is not None:
              <li><a href="${ coordinator.get_absolute_url() }">${ oozie_coordinator.appName }</a></li>
              % else:
              <li class="white">${ oozie_coordinator.appName }</li>
              % endif

              <li class="nav-header">${ _('Submitter') }</li>
              <li class="white">${ oozie_coordinator.user }</li>

              <li class="nav-header">${ _('Status') }</li>
              <li class="white" id="status"><span class="label ${ utils.get_status(oozie_coordinator.status) }">${ oozie_coordinator.status }</span></li>

              <li class="nav-header">${ _('Progress') }</li>
              <li class="white" id="progress">
                <div class="progress">
                  <div class="bar" style="width: 0">${ oozie_coordinator.get_progress() }%</div>
                </div>
              </li>

              <li class="nav-header">${ _('Frequency') }</li>
              % if enable_cron_scheduling:
                <li class="white cron-frequency">${ oozie_coordinator.human_frequency }</li>
              % else:
                <li class="white">${ oozie_coordinator.frequency } ${ oozie_coordinator.timeUnit }</li>
              % endif

              <li class="nav-header">${ _('Next Materialized Time') }</li>
              <li class="white" id="nextTime">${ utils.format_time(oozie_coordinator.nextMaterializedTime) }</li>

              <li class="nav-header">${ _('Id') }</li>
              <li class="white">${ oozie_coordinator.id }</li>

              % if coordinator:
              % if ENABLE_V2.get():
                  <li class="nav-header">${ _('Datasets') }</li>
                % for dataset in coordinator.datasets:
                  <li rel="tooltip" title="${ dataset.data['dataset_variable'] }" class="white">
                    <i class="fa fa-eye"></i> <span class="dataset">${ dataset.data['workflow_variable'][:20] }</span>
                  </li>
                % endfor
                % if not coordinator.datasets:
                  <li class="white">${ _('No available datasets') }</li>
                % endif
              % else:
                  <li class="nav-header">${ _('Datasets') }</li>
                % for dataset in coordinator.dataset_set.all():
                  <li rel="tooltip" title="${ dataset.name } : ${ dataset.uri }" class="white"><i class="fa fa-eye"></i> <span class="dataset">${ dataset.name }</span></li>
                % endfor
                % if not coordinator.dataset_set.all():
                  <li class="white">${ _('No available datasets') }</li>
                % endif
              % endif
              % endif

              % if oozie_coordinator.status not in ('KILLED', 'SUCCEEDED'):
              <li class="nav-header">${ _('Manage') }</li>
              <li class="white">
                % if has_job_edition_permission(oozie_coordinator, user):
                <div id="rerun-coord-modal" class="modal hide"></div>
                <div class="btn-group action-button-group" style="display: block; margin-bottom: 10px">
                  <button title="${ _('Resume the coordinator') }" id="resume-btn"
                      data-url="${ url('oozie:manage_oozie_jobs', job_id=oozie_coordinator.id, action='resume') }"
                      data-confirmation-header="${ _('Are you sure you want to resume this job?') }"
                      data-confirmation-footer="normal"
                      class="btn btn-small confirmationModal
                      % if oozie_coordinator.is_running():
                      hide
                      % endif
                      ">${ _('Resume') }</button>
                  <button title="${ _('Suspend the coordinator after finishing the current running actions') }" id="suspend-btn"
                      data-url="${ url('oozie:manage_oozie_jobs', job_id=oozie_coordinator.id, action='suspend') }"
                      data-confirmation-header="${ _('Are you sure you want to suspend this job?') }"
                      data-confirmation-footer="normal"
                      class="btn btn-small confirmationModal
                      % if not oozie_coordinator.is_running():
                      hide
                      % endif
                      " rel="tooltip" data-placement="right">${ _('Suspend') }</button>
                  <button title="${_('Kill %(coordinator)s') % dict(coordinator=oozie_coordinator.id)}" id="kill-btn"
                      alt="${ _('Are you sure you want to kill coordinator %s?') % oozie_coordinator.id }"
                      href="javascript:void(0)"
                      data-url="${ url('oozie:manage_oozie_jobs', job_id=oozie_coordinator.id, action='kill') }"
                      data-message="${ _('The coordinator was killed!') }"
                      data-confirmation-footer="danger"
                      data-confirmation-header="${ _('Are you sure you want to kill this job?') }"
                      class="btn btn-small btn-danger disable-feedback confirmationModal
                      % if not oozie_coordinator.is_running():
                      hide
                      % endif
                      ">${_('Kill')}</button>
                </div>
                % endif
                <div class="btn-group" style="margin-left: 0; margin-bottom: 5px">
                  % if has_job_edition_permission(oozie_coordinator, user):
                  <button title="${ _('Update Coordinator Job properties') }" id="edit-coord-btn"
                     data-url="${ url('oozie:manage_oozie_jobs', job_id=oozie_coordinator.id, action='change') }"
                     data-message="${ _('Successfully updated Coordinator Job Properties') }"
                     data-confirmation-header="${ _('Update Coordinator Job Properties') }"
                     data-confirmation-footer="update"
                     class="btn btn-small confirmationModal
                     % if not oozie_coordinator.is_running():
                     hide
                     % endif
                     ">${ _('Edit') }</button>
                  % endif
                  <button title="${ _('Sync Workflow') }" id="sync-wf-btn"
                     data-sync-url="${ url('oozie:sync_coord_workflow', job_id=oozie_coordinator.id) }"
                     class="btn btn-small sync-wf-btn">${ _('Sync Workflow') }</button>
                </div>
              </li>
              % endif
            </ul>
          </div><commit_msg>HUE-4991 [oozie] Group Coordinator dashboard action buttons<commit_after>## -*- coding: utf-8 -*-
## Licensed to Cloudera, Inc. under one
## or more contributor license agreements.  See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership.  Cloudera, Inc. licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License.  You may obtain a copy of the License at
##
##     http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.

<%!
  from desktop.views import commonheader, commonfooter, _ko
  from django.utils.translation import ugettext as _
  
  from oozie.conf import ENABLE_V2
%>

<%namespace name="layout" file="../navigation-bar.mako" />
<%namespace name="utils" file="../utils.inc.mako" />

${ commonheader(_("Coordinator Dashboard"), "oozie", user) | n,unicode }
${ layout.menubar(section='coordinators', dashboard=True) }

<link rel="stylesheet" href="${ static('oozie/css/coordinator.css') }" type="text/css" />

<div class="container-fluid">
  <div class="card card-small">
    <div class="card-body">

      <div class="row-fluid">
        <div class="span2">
          <div class="sidebar-nav">
            <ul class="nav nav-list" style="border:none">
              <li class="nav-header">${ _('Coordinator') }</li>
              % if coordinator is not None:
              <li><a href="${ coordinator.get_absolute_url() }">${ oozie_coordinator.appName }</a></li>
              % else:
              <li class="white">${ oozie_coordinator.appName }</li>
              % endif

              <li class="nav-header">${ _('Submitter') }</li>
              <li class="white">${ oozie_coordinator.user }</li>

              <li class="nav-header">${ _('Status') }</li>
              <li class="white" id="status"><span class="label ${ utils.get_status(oozie_coordinator.status) }">${ oozie_coordinator.status }</span></li>

              <li class="nav-header">${ _('Progress') }</li>
              <li class="white" id="progress">
                <div class="progress">
                  <div class="bar" style="width: 0">${ oozie_coordinator.get_progress() }%</div>
                </div>
              </li>

              <li class="nav-header">${ _('Frequency') }</li>
              % if enable_cron_scheduling:
                <li class="white cron-frequency">${ oozie_coordinator.human_frequency }</li>
              % else:
                <li class="white">${ oozie_coordinator.frequency } ${ oozie_coordinator.timeUnit }</li>
              % endif

              <li class="nav-header">${ _('Next Materialized Time') }</li>
              <li class="white" id="nextTime">${ utils.format_time(oozie_coordinator.nextMaterializedTime) }</li>

              <li class="nav-header">${ _('Id') }</li>
              <li class="white">${ oozie_coordinator.id }</li>

              % if coordinator:
              % if ENABLE_V2.get():
                  <li class="nav-header">${ _('Datasets') }</li>
                % for dataset in coordinator.datasets:
                  <li rel="tooltip" title="${ dataset.data['dataset_variable'] }" class="white">
                    <i class="fa fa-eye"></i> <span class="dataset">${ dataset.data['workflow_variable'][:20] }</span>
                  </li>
                % endfor
                % if not coordinator.datasets:
                  <li class="white">${ _('No available datasets') }</li>
                % endif
              % else:
                  <li class="nav-header">${ _('Datasets') }</li>
                % for dataset in coordinator.dataset_set.all():
                  <li rel="tooltip" title="${ dataset.name } : ${ dataset.uri }" class="white"><i class="fa fa-eye"></i> <span class="dataset">${ dataset.name }</span></li>
                % endfor
                % if not coordinator.dataset_set.all():
                  <li class="white">${ _('No available datasets') }</li>
                % endif
              % endif
              % endif

              % if oozie_coordinator.status not in ('KILLED', 'SUCCEEDED'):
              <li class="nav-header">${ _('Manage') }</li>
              <li class="white">
                % if has_job_edition_permission(oozie_coordinator, user):
                <div id="rerun-coord-modal" class="modal hide"></div>
                <div class="btn-group action-button-group" style="display: block; margin-bottom: 10px">
                  <button title="${_('Kill %(coordinator)s') % dict(coordinator=oozie_coordinator.id)}" id="kill-btn"
                      alt="${ _('Are you sure you want to kill coordinator %s?') % oozie_coordinator.id }"
                      href="javascript:void(0)"
                      data-url="${ url('oozie:manage_oozie_jobs', job_id=oozie_coordinator.id, action='kill') }"
                      data-message="${ _('The coordinator was killed!') }"
                      data-confirmation-footer="danger"
                      data-confirmation-header="${ _('Are you sure you want to kill this job?') }"
                      class="btn btn-small btn-danger disable-feedback confirmationModal
                      % if not oozie_coordinator.is_running():
                      hide
                      % endif
                      ">${_('Kill')}</button>
                  <button id="trash-btn-caret" class="btn toolbarBtn dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
                  <ul class="dropdown-menu">
                    <li><a title="${ _('Suspend the coordinator after finishing the current running actions') }" id="suspend-btn"
                      data-url="${ url('oozie:manage_oozie_jobs', job_id=oozie_coordinator.id, action='suspend') }"
                      data-confirmation-header="${ _('Are you sure you want to suspend this job?') }"
                      data-confirmation-footer="normal"
                      class="confirmationModal
                      % if not oozie_coordinator.is_running():
                      hide
                      % endif
                      " rel="tooltip" data-placement="right">${ _('Suspend') }</a></li>
                    <li><a title="${ _('Resume the coordinator') }" id="resume-btn"
                      data-url="${ url('oozie:manage_oozie_jobs', job_id=oozie_coordinator.id, action='resume') }"
                      data-confirmation-header="${ _('Are you sure you want to resume this job?') }"
                      data-confirmation-footer="normal"
                      class="confirmationModal
                      % if oozie_coordinator.is_running():
                      hide
                      % endif
                      ">${ _('Resume') }</a></li>
                  </ul
                </div>
                % endif
              </li>
              <li class="nav-header">${ _('Edit') }</li>
              <li class="white">
                <div class="btn-group" style="margin-left: 0; margin-bottom: 5px">
                  % if has_job_edition_permission(oozie_coordinator, user):
                  <button title="${ _('Update Coordinator Job properties') }" id="edit-coord-btn"
                     data-url="${ url('oozie:manage_oozie_jobs', job_id=oozie_coordinator.id, action='change') }"
                     data-message="${ _('Successfully updated Coordinator Job Properties') }"
                     data-confirmation-header="${ _('Update Coordinator Job Properties') }"
                     data-confirmation-footer="update"
                     class="btn btn-small confirmationModal
                     % if not oozie_coordinator.is_running():
                     hide
                     % endif
                     ">${ _('Coordinator') }</button>
                  % endif
                  <button id="trash-btn-caret" class="btn toolbarBtn dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
                  <ul class="dropdown-menu">
                    <li><a title="${ _('Sync Workflow') }" id="sync-wf-btn"
                      data-sync-url="${ url('oozie:sync_coord_workflow', job_id=oozie_coordinator.id) }"
                      class="sync-wf-btn"> ${ _('Workflow') }
                    </a></li>
                  </ul>
                </div>
              </li>
              % endif
            </ul>
          </div>
{'fraction_non_alphanumeric': 0.1480910599952573, 'fraction_numerical': 0.0021342186388427793, 'mean_word_length': 1.9322092821136798, 'pattern_counts': {'":': 0, '<': 211, '<?xml version=': 0, '>': 210, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1890954', 'n_tokens_mistral': 4753, 'n_tokens_neox': 4478, 'n_words': 1089}