From 627b7bc78cbf827719bbff427af8a295bdf19386 Mon Sep 17 00:00:00 2001 From: rsercano Date: Wed, 23 Aug 2017 10:14:31 +0300 Subject: [PATCH] Merge branches 'demo' and 'master' of https://github.com/rsercano/mongoclient into demo --- .../database_dump_restore.js | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/client/imports/views/pages/database_dump_restore/database_dump_restore.js b/client/imports/views/pages/database_dump_restore/database_dump_restore.js index d221ec1..b796f50 100644 --- a/client/imports/views/pages/database_dump_restore/database_dump_restore.js +++ b/client/imports/views/pages/database_dump_restore/database_dump_restore.js @@ -73,19 +73,7 @@ const clearLogs = function (binary) { }; const callBinaryMethod = function (button, binary, argsMethod) { - Ladda.create(document.querySelector(button)).start(); - const args = argsMethod(); - if (args === null) { - Ladda.stopAll(); - return; - } - - Meteor.call(binary, args, Meteor.default_connection._lastSessionId, function (err) { - if (err) { - Ladda.stopAll(); - Helper.showMeteorFuncError(err, null, "Couldn't proceed"); - } - }); + Helper.warnDemoApp(); }; Template.databaseDumpRestore.onDestroyed(function () { @@ -131,35 +119,35 @@ Template.databaseDumpRestore.onRendered(function () { }); Template.databaseDumpRestore.events({ - 'click #btnExecuteMongodump'(){ + 'click #btnExecuteMongodump'() { callBinaryMethod('#btnExecuteMongodump', 'mongodump', getMongodumpArgs); }, - 'click #btnExecuteMongorestore'(){ + 'click #btnExecuteMongorestore'() { callBinaryMethod('#btnExecuteMongorestore', 'mongorestore', getMongorestoreArgs); }, - 'click #btnExecuteMongoexport'(){ + 'click #btnExecuteMongoexport'() { callBinaryMethod('#btnExecuteMongoexport', 'mongoexport', getMongoexportOptions); }, - 'click #btnExecuteMongoimport'(){ + 'click #btnExecuteMongoimport'() { callBinaryMethod('#btnExecuteMongoimport', 'mongoimport', getMongoimportOptions); }, - 'click #btnClearMongoimportLogs'(){ + 'click #btnClearMongoimportLogs'() { clearLogs('mongoimport'); }, - 'click #btnClearMongoexportLogs'(){ + 'click #btnClearMongoexportLogs'() { clearLogs('mongoexport'); }, - 'click #btnClearMongodumpLogs'(){ + 'click #btnClearMongodumpLogs'() { clearLogs('mongodump'); }, - 'click #btnClearMongorestoreLogs'(){ + 'click #btnClearMongorestoreLogs'() { clearLogs('mongorestore'); } }); \ No newline at end of file -- GitLab