|
|
@@ -0,0 +1,148 @@
|
|
|
+## 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
|
|
|
+from django.utils.translation import ugettext as _
|
|
|
+%>
|
|
|
+
|
|
|
+<%namespace name="dashboard" file="/common_dashboard.mako" />
|
|
|
+
|
|
|
+${ commonheader(_("Workflow Editor"), "Oozie", user) | n,unicode }
|
|
|
+
|
|
|
+
|
|
|
+<%dashboard:layout_toolbar>
|
|
|
+ <%def name="widgets()">
|
|
|
+ <div data-bind="css: { 'draggable-widget': true },
|
|
|
+ draggable: {data: draggableHiveAction(), isEnabled: true,
|
|
|
+ options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
|
+ 'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
|
+ title="${_('Hive Script')}" rel="tooltip" data-placement="top">
|
|
|
+ <a class="draggable-icon"><img src="/oozie/static/art/icon_beeswax_48.png" class="app-icon"></a>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div data-bind="css: { 'draggable-widget': true},
|
|
|
+ draggable: {data: draggablePigAction(), isEnabled: true,
|
|
|
+ options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
|
+ 'stop': function(event, ui){$('.card-body').slideDown('fast'); }}}"
|
|
|
+ title="${_('Pig Script')}" rel="tooltip" data-placement="top">
|
|
|
+ <a class="draggable-icon"><img src="/oozie/static/art/icon_pig_48.png" class="app-icon"></a>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div data-bind="css: { 'draggable-widget': true },
|
|
|
+ draggable: {data: draggableJavaAction(), isEnabled: true,
|
|
|
+ options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
|
+ 'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
|
+ title="${_('Java program')}" rel="tooltip" data-placement="top">
|
|
|
+ <a class="draggable-icon"><i class="fa fa-file-code-o"></i></a>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div data-bind="css: { 'draggable-widget': true },
|
|
|
+ draggable: {data: draggableMapReduceAction(), isEnabled: true,
|
|
|
+ options: {'start': function(event, ui){lastWindowScrollPosition = $(window).scrollTop();$('.card-body').slideUp('fast');},
|
|
|
+ 'stop': function(event, ui){$('.card-body').slideDown('fast', function(){$(window).scrollTop(lastWindowScrollPosition)});}}}"
|
|
|
+ title="${_('MapReduce job')}" rel="tooltip" data-placement="top">
|
|
|
+ <a class="draggable-icon"><i class="fa fa-file-code-o"></i></a>
|
|
|
+ </div>
|
|
|
+</%def>
|
|
|
+</%dashboard:layout_toolbar>
|
|
|
+
|
|
|
+
|
|
|
+<div class="search-bar">
|
|
|
+ <div class="pull-right" style="padding-right:50px">
|
|
|
+ % if user.is_superuser:
|
|
|
+ <a title="${ _('Edit') }" rel="tooltip" data-placement="bottom" data-bind="click: toggleEditing, css: {'btn': true, 'btn-inverse': isEditing}"><i class="fa fa-pencil"></i></a>
|
|
|
+
|
|
|
+ <button type="button" title="${ _('Save') }" rel="tooltip" data-placement="bottom" data-loading-text="${ _("Saving...") }" data-bind="click: $root.save, css: {'btn': true}"><i class="fa fa-save"></i></button>
|
|
|
+ <a class="btn" href="${ url('impala:new_search') }" title="${ _('New') }" rel="tooltip" data-placement="bottom" data-bind="css: {'btn': true}"><i class="fa fa-file-o"></i></a>
|
|
|
+ % endif
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
+${ dashboard.layout_skeleton() }
|
|
|
+
|
|
|
+
|
|
|
+<script type="text/html" id="pig-widget">
|
|
|
+ <!-- ko if: $root.workflow.getNodeById(id()) -->
|
|
|
+ <div class="row-fluid" data-bind="with: $root.workflow.getNodeById(id())">
|
|
|
+ <div data-bind="visible: $root.isEditing" style="margin-bottom: 20px">
|
|
|
+ <input type="text" data-bind="value: id" />
|
|
|
+ <input type="text" data-bind="value: name" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <ul class="nav nav-tabs">
|
|
|
+ <li class="active"><a href="#action" data-toggle="tab">${ _('Pig') }</a></li>
|
|
|
+ <li><a href="#files" data-toggle="tab">${ _('Files') }</a></li>
|
|
|
+ <li><a href="#sla" data-toggle="tab">${ _('SLA') }</a></li>
|
|
|
+ <li><a href="#credentials" data-toggle="tab">${ _('Credentials') }</a></li>
|
|
|
+ <li><a href="#transitions" data-toggle="tab">${ _('Transitions') }</a></li>
|
|
|
+ </ul>
|
|
|
+ <div class="tab-content">
|
|
|
+ <div class="tab-pane active" id="action">
|
|
|
+ <img src="/oozie/static/art/icon_pig_48.png" class="app-icon">
|
|
|
+ </div>
|
|
|
+ <div class="tab-pane" id="files">
|
|
|
+ </div>
|
|
|
+ <div class="tab-pane" id="sla">
|
|
|
+ </div>
|
|
|
+ <div class="tab-pane" id="credentials">
|
|
|
+ </div>
|
|
|
+ <div class="tab-pane" id="transitions">
|
|
|
+ OK --> []
|
|
|
+ KO --> []
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- /ko -->
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+<link rel="stylesheet" href="/oozie/static/css/workflow-editor.css">
|
|
|
+<link rel="stylesheet" href="/static/ext/css/hue-filetypes.css">
|
|
|
+<link rel="stylesheet" href="/static/ext/css/hue-charts.css">
|
|
|
+<link rel="stylesheet" href="/static/ext/chosen/chosen.min.css">
|
|
|
+
|
|
|
+
|
|
|
+${ dashboard.import_layout() }
|
|
|
+
|
|
|
+<script src="/static/ext/js/bootstrap-editable.min.js" type="text/javascript" charset="utf-8"></script>
|
|
|
+<script src="/static/js/hue.utils.js"></script>
|
|
|
+<script src="/static/js/ko.editable.js" type="text/javascript" charset="utf-8"></script>
|
|
|
+<script src="/static/ext/chosen/chosen.jquery.min.js" type="text/javascript" charset="utf-8"></script>
|
|
|
+
|
|
|
+${ dashboard.import_bindings() }
|
|
|
+
|
|
|
+<script src="/oozie/static/js/workflow-editor.ko.js" type="text/javascript" charset="utf-8"></script>
|
|
|
+
|
|
|
+
|
|
|
+<script type="text/javascript">
|
|
|
+ var viewModel = new WorkflowEditorViewModel(${ layout_json | n,unicode }, ${ workflow_json | n,unicode });
|
|
|
+ ko.applyBindings(viewModel);
|
|
|
+
|
|
|
+ viewModel.init();
|
|
|
+
|
|
|
+ function columnDropAdditionalHandler(widget) {
|
|
|
+ widgetDraggedAdditionalHandler(widget);
|
|
|
+ }
|
|
|
+
|
|
|
+ function widgetDraggedAdditionalHandler(widget) {
|
|
|
+ viewModel.workflow.addNode(widget);
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+${ commonfooter(messages) | n,unicode }
|