|
|
@@ -29,27 +29,27 @@ ${ common.navbar('editor') }
|
|
|
<div class="row-fluid">
|
|
|
<div class="card card-small">
|
|
|
<div style="margin-bottom: 10px">
|
|
|
+ % if can_edit_name:
|
|
|
<h1 class="card-heading simple">
|
|
|
<a href="javascript:void(0);"
|
|
|
id="query-name"
|
|
|
data-type="text"
|
|
|
data-name="name"
|
|
|
data-value="${design.name}"
|
|
|
- data-original-title="${ _('App name') }"
|
|
|
+ data-original-title="${ _('Application name') }"
|
|
|
data-placement="right">
|
|
|
</a>
|
|
|
- </h1>
|
|
|
- % if can_edit_name:
|
|
|
- <p style="margin-left: 20px">
|
|
|
- <a href="javascript:void(0);"
|
|
|
+
|
|
|
+ <a href="javascript:void(0);"
|
|
|
id="query-description"
|
|
|
data-type="textarea"
|
|
|
data-name="description"
|
|
|
data-value="${design.desc}"
|
|
|
- data-original-title="${ _('App description') }"
|
|
|
- data-placement="right">
|
|
|
+ data-original-title="${ _('Application description') }"
|
|
|
+ data-placement="right" style="font-size: 14px; margin-left: 10px">
|
|
|
</a>
|
|
|
- </p>
|
|
|
+
|
|
|
+ </h1>
|
|
|
% endif
|
|
|
</div>
|
|
|
<div class="card-body">
|
|
|
@@ -66,8 +66,10 @@ ${ common.navbar('editor') }
|
|
|
${ _("Missing, add one?") }
|
|
|
</a>
|
|
|
<!-- /ko -->
|
|
|
- <a data-bind="if: $root.appName" data-toggle="dropdown" href="javascript:void(0);"><strong data-bind="text: $root.appName().nice_name"></strong>
|
|
|
- <i class="fa fa-caret-down"></i></a>
|
|
|
+ <a data-bind="if: $root.appName" data-toggle="dropdown" href="javascript:void(0);">
|
|
|
+ <strong data-bind="text: $root.appName().nice_name"></strong>
|
|
|
+ <i class="fa fa-caret-down"></i>
|
|
|
+ </a>
|
|
|
<ul data-bind="foreach: $root.appNames" class="dropdown-menu">
|
|
|
<li data-bind="click: $root.chooseAppName, text: nice_name" class="selectable"></li>
|
|
|
</ul>
|
|
|
@@ -79,9 +81,9 @@ ${ common.navbar('editor') }
|
|
|
</label>
|
|
|
|
|
|
${_('Context')}
|
|
|
- <label class="radio" style="margin-left: 5px;margin-top:-2px">
|
|
|
+ <label class="radio" style="margin-top:-2px">
|
|
|
+ <input type="radio" name="autoContext" value="true" data-bind="checked:$root.autoContext.forEditing" style="margin-right: 5px" />
|
|
|
${ _('Automatic') }
|
|
|
- <input type="radio" name="autoContext" value="true" data-bind="checked:$root.autoContext.forEditing" />
|
|
|
</label>
|
|
|
<label class="radio" style="margin-left: 5px;margin-top:-2px">
|
|
|
<span class="dropdown" style="padding-left: 5px">
|
|
|
@@ -108,17 +110,21 @@ ${ common.navbar('editor') }
|
|
|
|
|
|
<div class="row-fluid">
|
|
|
<div class="card card-small">
|
|
|
- <h1 class="card-heading simple">${_('Parameters')}</h1>
|
|
|
+ <h1 class="card-heading simple">
|
|
|
+ <a id="collapse-editor" href="javascript:void(0)" class="pull-right"><i class="fa fa-caret-up"></i></a>
|
|
|
+ ${_('Parameters')}
|
|
|
+ </h1>
|
|
|
<div class="card-body">
|
|
|
<p>
|
|
|
+ <div id="param-pane">
|
|
|
<div data-bind="css: {'hide': query.errors().length == 0}" class="hide alert alert-error">
|
|
|
- <p><strong>${_('Your app configuration has the following error(s):')}</strong></p>
|
|
|
+ <p><strong>${_('Your application has the following error(s):')}</strong></p>
|
|
|
<div data-bind="foreach: query.errors">
|
|
|
<p data-bind="text: $data" class="queryErrorMessage"></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div data-bind="visible: query.params().length == 0">${_('There currently no parameters defined.')}</div>
|
|
|
+ <div data-bind="visible: query.params().length == 0">${_('No parameters defined yet.')}</div>
|
|
|
|
|
|
<table class="table-condensed">
|
|
|
<thead data-bind="visible: query.params().length > 0">
|
|
|
@@ -130,33 +136,39 @@ ${ common.navbar('editor') }
|
|
|
</thead>
|
|
|
<tbody data-bind="foreach: query.params">
|
|
|
<tr>
|
|
|
- <td><input type="text" class="span6 required propKey" data-bind="value: name" /></td>
|
|
|
- <td><input type="text" class="span6 required pathChooserKo" data-bind="fileChooser: $data, value: value" /></td>
|
|
|
+ <td><input type="text" class="input-large required propKey" data-bind="value: name" /></td>
|
|
|
<td>
|
|
|
+ <div class="input-append">
|
|
|
+ <input type="text" data-bind="value: value" class="input-xxlarge" />
|
|
|
+ <button class="btn fileChooserBtn" data-bind="click: $root.showFileChooser">..</button>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td style="vertical-align: top">
|
|
|
<a class="btn" href="#" data-bind="click: $root.removeParam">${ _('Delete') }</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
+ <div style="margin-top: 10px">
|
|
|
+ <a class="btn" href="#" data-bind="click: $root.addParam">${ _('Add') }</a>
|
|
|
+ </div>
|
|
|
|
|
|
- <a class="btn" href="#" data-bind="click: $root.addParam">${ _('Add parameter') }</a>
|
|
|
-
|
|
|
- <div class="actions">
|
|
|
+ <div class="actions" style="margin-top: 50px; margin-bottom: 20px">
|
|
|
<button data-bind="click: tryExecuteQuery, enable: $root.appNames().length > 0 && $root.classPath()"
|
|
|
type="button" id="executeQuery" class="btn btn-primary disable-feedback"
|
|
|
tabindex="2" data-loading-text="${ _("Executing...") }">
|
|
|
${_('Execute')}
|
|
|
</button>
|
|
|
- <button data-bind="click: trySaveQuery, css: {'hide': !$root.query.id() || $root.query.id() == -1}" type="button" class="btn hide">${_('Save')}</button>
|
|
|
- <button data-bind="click: trySaveAsQuery" type="button" class="btn">${_('Save as...')}</button>
|
|
|
- ${_('or create a')} <a type="button" class="btn" href="${ url('spark:editor') }">${_('New app configuration')}</a>
|
|
|
+ <button data-bind="click: trySaveQuery, visible: ($root.query.id() && $root.query.id() != -1)" type="button" class="btn">${_('Save')}</button>
|
|
|
+ <button data-bind="click: trySaveAsQuery, visible: $root.appNames().length > 0" type="button" class="btn">${_('Save as...')}</button>
|
|
|
+ ${_('or create a')} <a type="button" class="btn" href="${ url('spark:editor') }">${_('New application')}</a>
|
|
|
<span class="pull-right">
|
|
|
<a type="button" class="btn" data-bind="visible: rows().length != 0, attr: {'href': '${ url('spark:download_result') }' + $root.query.jobId()}">${_('Download')}</a>
|
|
|
</span>
|
|
|
</div>
|
|
|
-
|
|
|
+ </div>
|
|
|
<div data-bind="css: {'hide': rows().length == 0}" class="hide">
|
|
|
- <div class="card card-small scrollable">
|
|
|
+ <div class="scrollable">
|
|
|
<table class="table table-striped table-condensed resultTable" cellpadding="0" cellspacing="0" data-tablescroller-min-height-disable="true" data-tablescroller-enforce-height="true">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
@@ -169,7 +181,7 @@ ${ common.navbar('editor') }
|
|
|
</div>
|
|
|
|
|
|
<div data-bind="css: {'hide': !resultsEmpty()}" class="hide">
|
|
|
- <div class="card card-small scrollable">
|
|
|
+ <div class="scrollable">
|
|
|
<div class="row-fluid">
|
|
|
<div class="span10 offset1 center empty-wrapper">
|
|
|
<i class="fa fa-frown-o"></i>
|
|
|
@@ -181,7 +193,7 @@ ${ common.navbar('editor') }
|
|
|
</div>
|
|
|
|
|
|
<div id="wait-info" class="hide">
|
|
|
- <div class="card card-small scrollable">
|
|
|
+ <div class="scrollable">
|
|
|
<div class="row-fluid">
|
|
|
<div class="span10 offset1 center" style="padding: 30px">
|
|
|
<!--[if !IE]><!--><i class="fa fa-spinner fa-spin" style="font-size: 60px; color: #DDD"></i><!--<![endif]-->
|
|
|
@@ -224,6 +236,20 @@ ${ common.navbar('editor') }
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+<div id="chooseFile" class="modal hide fade">
|
|
|
+ <div class="modal-header">
|
|
|
+ <a href="#" class="close" data-dismiss="modal">×</a>
|
|
|
+ <h3>${_('Choose a file')}</h3>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div id="filechooser">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+
|
|
|
${ common.uploadAppModal() }
|
|
|
${ common.createContextModal() }
|
|
|
|
|
|
@@ -376,10 +402,42 @@ ${ common.createContextModal() }
|
|
|
viewModel.openQuery("${ job_id }");
|
|
|
% endif
|
|
|
var hash = window.location.hash;
|
|
|
- if (hash != "" && hash.indexOf("=") > -1 && hash.split("=")[0] == '#jobId') {
|
|
|
- viewModel.openQuery(hash.split("=")[1]);
|
|
|
+ if (hash != "" && hash.indexOf("=") > -1) {
|
|
|
+ var hashKey = hash.split("=")[0].substr(1);
|
|
|
+ var hashValue = hash.split("=")[1];
|
|
|
+ if (hashKey == 'jobId') {
|
|
|
+ viewModel.openQuery(hashValue);
|
|
|
+ } else if (hashKey == 'applicationId') {
|
|
|
+ viewModel.query.appName(hashValue);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
ko.applyBindings(viewModel);
|
|
|
+
|
|
|
+ $("#collapse-editor").on("click", function () {
|
|
|
+ if ($("#param-pane").is(":visible")) {
|
|
|
+ $("#param-pane").slideUp(100, function () {
|
|
|
+ $(".dataTables_wrapper").jHueTableScroller();
|
|
|
+ $(".resultTable").jHueTableExtender({
|
|
|
+ hintElement: "#jumpToColumnAlert",
|
|
|
+ fixedHeader: true,
|
|
|
+ firstColumnTooltip: true
|
|
|
+ });
|
|
|
+ });
|
|
|
+ $("#collapse-editor i").removeClass("fa-caret-up").addClass("fa-caret-down");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $("#param-pane").slideDown(100, function () {
|
|
|
+ $(".dataTables_wrapper").jHueTableScroller();
|
|
|
+ $(".resultTable").jHueTableExtender({
|
|
|
+ hintElement: "#jumpToColumnAlert",
|
|
|
+ fixedHeader: true,
|
|
|
+ firstColumnTooltip: true
|
|
|
+ });
|
|
|
+ });
|
|
|
+ $("#collapse-editor i").removeClass("fa-caret-down").addClass("fa-caret-up");
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
|
|
|
@@ -401,7 +459,9 @@ ${ common.createContextModal() }
|
|
|
}
|
|
|
|
|
|
function trySaveAsQuery() {
|
|
|
- $('#saveAsQueryModal').modal('show');
|
|
|
+ if (viewModel.appName() != null && viewModel.appName() != ""){
|
|
|
+ $('#saveAsQueryModal').modal('show');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$('.uploadAppModalBtn').click(function(){
|
|
|
@@ -433,7 +493,7 @@ ${ common.createContextModal() }
|
|
|
success: function(response, newValue) {
|
|
|
viewModel.query.name(newValue);
|
|
|
},
|
|
|
- emptytext: "${ _('App configuration name') }"
|
|
|
+ emptytext: "${ _('Application name') }"
|
|
|
});
|
|
|
|
|
|
$("#query-description").editable({
|
|
|
@@ -446,7 +506,7 @@ ${ common.createContextModal() }
|
|
|
|
|
|
// Events and datatables
|
|
|
$(document).on('saved.query', function() {
|
|
|
- $.jHueNotify.info("${_('App saved successfully!')}")
|
|
|
+ $.jHueNotify.info("${_('Application saved successfully!')}")
|
|
|
});
|
|
|
|
|
|
var dataTable = null;
|