提交 28de29c3 编写于 作者: S Sercan

under heavy development #62

上级 79c68950
/*! jQuery UI - v1.11.4 - 2015-05-11
* http://jqueryui.com
* Includes: core.css, draggable.css, resizable.css, selectable.css, sortable.css
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}
\ No newline at end of file
此差异已折叠。
......@@ -92,6 +92,13 @@
class="nav-label">Easy Edit</span>
</a>
</li>
<li class="{{isActiveRoute regex='aggregatePipeline'}}">
<a class="aNavigations" href="{{pathFor route='aggregatePipeline'}}"><i
class="fa fa-tasks"></i> <span
class="nav-label">Aggregate</span>
</a>
</li>
</ul>
</li>
......
......@@ -18,15 +18,7 @@ Template.adminQueries.onRendered(function () {
});
cmb.chosen();
$('#aConvertIsoDates').iCheck({
checkboxClass: 'icheckbox_square-green'
});
$('#aConvertObjectIds').iCheck({
checkboxClass: 'icheckbox_square-green'
});
$('#aRunOnAdminDB').iCheck({
$('#aConvertIsoDates, #aConvertObjectIds, #aRunOnAdminDB').iCheck({
checkboxClass: 'icheckbox_square-green'
});
......
<template name="aggregatePipeline">
{{#if isConnected}}
{{> pageHeading title='Aggregate' }}
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Collection
<small>Collection to execute this aggregation at
</small>
</h5>
<div class="ibox-tools">
<a id="aConvertIsoDates" class="i-checks"
style="display: none;"
data-toggle="tooltip"
title="Enable/Disable YYYY-MM-DD HH:MM:ss formatted strings to ISODate conversion">
<input id="inputConvertIsoDates" type="checkbox" value=""
class="form-control"
checked=""
style="position: absolute; opacity: 0;"/>
</a>
<a id="aConvertObjectIds" class="i-checks"
style="display: none;"
data-toggle="tooltip"
title="Enable/Disable valid ObjectID strings to ObjectID conversion">
<input id="inputConvertObjectIDs" type="checkbox" value=""
class="form-control"
checked=""
style="position: absolute; opacity: 0;"/>
</a>
</div>
</div>
<div class="ibox-content">
<form class="form-horizontal">
<div class="form-group">
<label class="col-lg-1 control-label">Collection</label>
<div class="col-lg-11">
<select id="cmbCollections"
data-placeholder="Choose a collection..."
class="chosen-select form-control"
tabindex="-1">
<option></option>
</select>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-content">
<h3>Stages</h3>
<p class="small"><i class="fa fa-hand-o-up"></i> Drag stages between list</p>
<div class="form-group">
<select id="cmbStageQueries"
data-placeholder="Choose a stage query.."
class="chosen-select form-control col-lg-10"
tabindex="-1">
<option></option>
<option>$project</option>
<option>$match</option>
<option>$redact</option>
<option>$limit</option>
<option>$skip</option>
<option>$unwind</option>
<option>$group</option>
<option>$sample</option>
<option>$sort</option>
<option>$geoNear</option>
<option>$lookup</option>
<option>$out</option>
<option>$indexStats</option>
</select>
</div>
<ul class="sortable-list agile-list" id="stages">
</ul>
</div>
</div>
</div>
</div>
</div>
{{/if}}
</template>
\ No newline at end of file
/**
* Created by RSercan on 14.5.2016.
*/
var stageNumbers;
Template.aggregatePipeline.onRendered(function () {
if (Session.get(Template.strSessionCollectionNames) == undefined) {
Router.go('databaseStats');
return;
}
$("#stages").sortable({
connectWith: ".connectList"
});
$('#cmbStageQueries').chosen();
$('#aConvertIsoDates, #aConvertObjectIds').iCheck({
checkboxClass: 'icheckbox_square-green'
});
stageNumbers = 0;
Template.aggregatePipeline.initializeCollectionsCombobox();
});
Template.aggregatePipeline.helpers({
'getStageTemplate': function () {
if (Session.get(Template.strSessionAggregateStageName)) {
switch (Session.get(Template.strSessionAggregateStageName)) {
case '$limit':
return 'numberStage';
case '$skip':
return 'numberStage';
case '$out':
return 'stringStage';
default:
return 'objectStage';
}
}
},
'getStageName': function () {
return {name: Session.get(Template.strSessionAggregateStageName)};
}
});
Template.aggregatePipeline.events({
'change #cmbStageQueries': function (e) {
var cmb = $("#cmbStageQueries");
var query = cmb.chosen().val();
if (query) {
var liElement = '<li class="success-element" id="stage' + stageNumbers + '">' + query + '<div class="agile-detail">' +
'<a id="remove-stage-element" href="#" data-number="' + stageNumbers + '" class="pull-right btn btn-xs btn-white"><i class="fa fa-remove"></i> Remove</a>' +
'<input id="inputNumberStage" min="0" type="number" class="form-control">' +
'</div> </li>';
$('#stages').append(liElement);
Session.set(Template.strSessionAggregateStageName, query);
cmb.val('').trigger('chosen:updated');
stageNumbers++;
}
},
'click #remove-stage-element': function (e) {
e.preventDefault();
var stageId = '#stage' + $(e.target).data('number');
$(stageId).remove();
}
});
Template.aggregatePipeline.initializeCollectionsCombobox = function () {
var cmb = $('#cmbCollections');
cmb.append($("<optgroup id='optGroupCollections' label='Collections'></optgroup>"));
var cmbOptGroupCollection = cmb.find('#optGroupCollections');
var collectionNames = Session.get(Template.strSessionCollectionNames);
$.each(collectionNames, function (index, value) {
cmbOptGroupCollection.append($("<option></option>")
.attr("value", value.name)
.text(value.name));
});
cmb.chosen();
cmb.on('change', function (evt, params) {
var selectedCollection = params.selected;
if (selectedCollection) {
Template.getDistinctKeysForAutoComplete(selectedCollection);
}
});
};
\ No newline at end of file
<template name="numberStage">
<div class="form-group">
<label class="col-lg-1 control-label">{{name}}</label>
<div class="col-lg-11">
<input id="inputNumberStage" min="0" type="number" class="form-control">
</div>
</div>
</template>
\ No newline at end of file
<template name="objectStage">
<div class="form-group">
<label class="col-lg-1 control-label">{{name}}</label>
<div id="divObjectStage" class="col-lg-11">
<textarea id="txtObjectStage" class="form-control"></textarea>
</div>
</div>
</template>
\ No newline at end of file
/**
* Created by RSercan on 15.5.2016.
*/
Template.objectStage.onRendered(function () {
var divSelector = $('#divObjectStage');
var codeMirror;
if (!divSelector.data('editor')) {
codeMirror = CodeMirror.fromTextArea(document.getElementById('txtObjectStage'), {
mode: "javascript",
theme: "neat",
styleActiveLine: true,
lineNumbers: true,
lineWrapping: false,
extraKeys: {
"Ctrl-Q": function (cm) {
cm.foldCode(cm.getCursor());
},
"Ctrl-Space": "autocomplete"
},
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
});
codeMirror.setSize('%100', 100);
divSelector.data('editor', codeMirror);
}
else {
codeMirror = divSelector.data('editor');
}
});
\ No newline at end of file
<template name="stringStage">
<div class="form-group">
<label class="col-lg-1 control-label">{{name}}</label>
<div class="col-lg-11">
<input type="text" class="form-control" id='txtStringStage'/>
</div>
</div>
</template>
\ No newline at end of file
......@@ -22,11 +22,7 @@ Template.browseCollection.onRendered(function () {
Template.queryHistories.initQueryHistories();
});
$('#aConvertIsoDates').iCheck({
checkboxClass: 'icheckbox_square-green'
});
$('#aConvertObjectIds').iCheck({
$('#aConvertIsoDates, #aConvertObjectIds').iCheck({
checkboxClass: 'icheckbox_square-green'
});
......
......@@ -10,11 +10,7 @@ Template.editDocument.onRendered(function () {
Template.editDocument.initializeCollectionsCombobox();
Session.set(Template.strSessionEasyEditID, undefined);
$('#aConvertIsoDates').iCheck({
checkboxClass: 'icheckbox_square-green'
});
$('#aConvertObjectIds').iCheck({
$('#aConvertIsoDates, #aConvertObjectIds').iCheck({
checkboxClass: 'icheckbox_square-green'
});
......
......@@ -2,16 +2,11 @@
* Created by RSercan on 9.1.2016.
*/
Template.settings.onRendered(function () {
$('#divAutoCompleteFields').iCheck({
$('#divAutoCompleteFields, #divShowDBStats').iCheck({
checkboxClass: 'icheckbox_square-green'
});
$('#divShowDBStats').iCheck({
checkboxClass: 'icheckbox_square-green'
});
$('#cmbScale').chosen();
$('#cmbResultView').chosen();
$('#cmbScale, #cmbResultView').chosen();
Template.settings.load();
});
......
/**
* Created by sercan on 16.02.2016.
*/
Router.route('/aggregatePipeline', {
waitOn: function () {
return [Meteor.subscribe('settings'), Meteor.subscribe('connections')];
}
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册