提交 233ca0bc 编写于 作者: R rsercano

#352

上级 75e649fe
......@@ -339,31 +339,6 @@ Template.navigation.onRendered(function () {
toastr.warning('No collection selected !');
}
}
},
drop_collection: {
name: "Drop Collection",
icon: "fa-trash",
callback: function () {
if ($(this) && $(this).context && $(this).context.innerText) {
const collectionName = $(this).context.innerText.substring(1).split(' ')[0];
swal({
title: "Are you sure?",
text: collectionName + " collection will be dropped, are you sure ?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, drop it!",
closeOnConfirm: true
}, function (isConfirm) {
if (isConfirm) {
dropCollection(collectionName);
}
});
} else {
toastr.warning('No collection selected !');
}
}
}
}
},
......@@ -401,6 +376,30 @@ Template.navigation.onRendered(function () {
connect(true);
}
},
drop_collection: {
name: "Drop Collection",
icon: "fa-trash",
callback: function () {
if ($(this) && $(this).context && $(this).context.innerText) {
const collectionName = $(this).context.innerText.substring(1).split(' ')[0];
swal({
title: "Are you sure?",
text: collectionName + " collection will be dropped, are you sure ?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, drop it!",
closeOnConfirm: true
}, function (isConfirm) {
if (isConfirm) {
dropCollection(collectionName);
}
});
} else {
toastr.warning('No collection selected !');
}
}
},
drop_collections: {
name: "Drop All Collections",
icon: "fa-ban",
......
......@@ -196,7 +196,10 @@ Template.mcShell.onRendered(function () {
Helper.initializeCodeMirror(divResult, 'txtShellResult', false, 600);
divResult.data('editor').setOption("readOnly", true);
ShellCommands.find({connectionId: Session.get(Helper.strSessionConnection)}, {sort: {date: -1}}).observeChanges({
ShellCommands.find({
connectionId: Session.get(Helper.strSessionConnection),
sessionId: Meteor.default_connection._lastSessionId
}, {sort: {date: -1}}).observeChanges({
added: function (id, fields) {
let previousValue = Helper.getCodeMirrorValue(divResult);
if (previousValue && !previousValue.endsWith('\n')) {
......
......@@ -134,7 +134,10 @@ Template.schemaAnalyzer.onRendered(function () {
if (connections.ready() && settings.ready() && schemaAnalyzeResult.ready()) {
Helper.initializeCollectionsCombobox();
SchemaAnalyzeResult.find({connectionId: Session.get(Helper.strSessionConnection)}, {sort: {date: -1}}).observeChanges({
SchemaAnalyzeResult.find({
connectionId: Session.get(Helper.strSessionConnection),
sessionId: Meteor.default_connection._lastSessionId
}, {sort: {date: -1}}).observeChanges({
added: function (id, fields) {
let jsonData = Helper.convertAndCheckJSON(fields.message);
if (jsonData['ERROR']) {
......@@ -173,7 +176,7 @@ Template.schemaAnalyzer.events({
Ladda.create(document.querySelector('#btnAnalyzeNow')).start();
Meteor.call("analyzeSchema", Session.get(Helper.strSessionConnection), Meteor.default_connection._lastSessionId, collection, (err) => {
Meteor.call("analyzeSchema", Session.get(Helper.strSessionConnection), collection, Meteor.default_connection._lastSessionId, (err) => {
if (err) {
Helper.showMeteorFuncError(err, null, "Couldn't analyze collection");
}
......
/**
* Created by RSercan on 10.1.2016.
*/
import {Meteor} from 'meteor/meteor';
import {Actions} from '/lib/imports/collections/actions';
import {Meteor} from "meteor/meteor";
import {Actions} from "/lib/imports/collections/actions";
import LOGGER from "../internal/logger";
const cheerio = require('cheerio');
......@@ -60,7 +60,7 @@ Meteor.methods({
let loadedUrl = load(url);
fixHrefs(url, loadedUrl);
return loadedUrl("dt[id='authr." + action + "']").parent('dl[class=authaction]').children('dd').html();
return loadedUrl("dt[id='" + action + "']").parent('dl[class=authaction]').children('dd').html();
},
getRoleInfo(roleName) {
......
......@@ -11,11 +11,11 @@ import ShellCommands from "/lib/imports/collections/shell";
import SchemaAnalyzeResult from "/lib/imports/collections/schema_analyze_result";
Meteor.publish('schema_analyze_result', function () {
return SchemaAnalyzeResult.find({sessionId: Meteor.default_connection._lastSessionId});
return SchemaAnalyzeResult.find({});
});
Meteor.publish('shell_commands', function () {
return ShellCommands.find({sessionId: Meteor.default_connection._lastSessionId});
return ShellCommands.find({});
});
Meteor.publish('connections', function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册