From 41021c9ce0dcc35aed0dedab2c7643b82b855ddf Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sun, 17 Dec 2017 14:15:00 -0800 Subject: [PATCH] Fixed issue with zero instance counts: https://github.com/githubsaturn/captainduckduck/issues/48 --- app-backend/dist/js/dashboard.min.js | 238 +++++++++++++-------------- app-backend/src/docker/DockerApi.js | 2 +- 2 files changed, 120 insertions(+), 120 deletions(-) diff --git a/app-backend/dist/js/dashboard.min.js b/app-backend/dist/js/dashboard.min.js index bfa8476..5579543 100644 --- a/app-backend/dist/js/dashboard.min.js +++ b/app-backend/dist/js/dashboard.min.js @@ -652,124 +652,6 @@ angular.module('RDash') } }); -/** - * File Upload Read Directive - */ - -angular - .module('RDash') - .directive("fileread", [function () { - return { - scope: { - fileread: "=" - }, - link: function (scope, element, attributes) { - element.bind("change", function (changeEvent) { - scope.$apply(function () { - scope.fileread = changeEvent.target.files[0]; - // or all selected files: - // scope.fileread = changeEvent.target.files; - }); - }); - } - } - }]); -/** - * Loading Directive - * @see http://tobiasahlin.com/spinkit/ - */ - -angular - .module('RDash') - .directive('rdLoading', rdLoading); - -function rdLoading() { - var directive = { - restrict: 'AE', - template: '
' - }; - return directive; -}; -/** - * Widget Body Directive - */ - -angular - .module('RDash') - .directive('rdWidgetBody', rdWidgetBody); - -function rdWidgetBody() { - var directive = { - requires: '^rdWidget', - scope: { - loading: '=?', - classes: '@?' - }, - transclude: true, - template: '
', - restrict: 'E' - }; - return directive; -}; - -/** - * Widget Footer Directive - */ - -angular - .module('RDash') - .directive('rdWidgetFooter', rdWidgetFooter); - -function rdWidgetFooter() { - var directive = { - requires: '^rdWidget', - transclude: true, - template: '', - restrict: 'E' - }; - return directive; -}; -/** - * Widget Header Directive - */ - -angular - .module('RDash') - .directive('rdWidgetHeader', rdWidgetTitle); - -function rdWidgetTitle() { - var directive = { - requires: '^rdWidget', - scope: { - title: '@', - icon: '@' - }, - transclude: true, - template: '
{{title}}
', - restrict: 'E' - }; - return directive; -}; -/** - * Widget Directive - */ - -angular - .module('RDash') - .directive('rdWidget', rdWidget); - -function rdWidget() { - var directive = { - transclude: true, - template: '
', - restrict: 'EA' - }; - return directive; - - function link(scope, element, attrs) { - /* */ - } -}; /** * Alerts Controller */ @@ -1649,4 +1531,122 @@ function SettingsCtrl($scope, $cookieStore, $rootScope, pageDefinitions, }()); -} \ No newline at end of file +} +/** + * File Upload Read Directive + */ + +angular + .module('RDash') + .directive("fileread", [function () { + return { + scope: { + fileread: "=" + }, + link: function (scope, element, attributes) { + element.bind("change", function (changeEvent) { + scope.$apply(function () { + scope.fileread = changeEvent.target.files[0]; + // or all selected files: + // scope.fileread = changeEvent.target.files; + }); + }); + } + } + }]); +/** + * Loading Directive + * @see http://tobiasahlin.com/spinkit/ + */ + +angular + .module('RDash') + .directive('rdLoading', rdLoading); + +function rdLoading() { + var directive = { + restrict: 'AE', + template: '
' + }; + return directive; +}; +/** + * Widget Body Directive + */ + +angular + .module('RDash') + .directive('rdWidgetBody', rdWidgetBody); + +function rdWidgetBody() { + var directive = { + requires: '^rdWidget', + scope: { + loading: '=?', + classes: '@?' + }, + transclude: true, + template: '
', + restrict: 'E' + }; + return directive; +}; + +/** + * Widget Footer Directive + */ + +angular + .module('RDash') + .directive('rdWidgetFooter', rdWidgetFooter); + +function rdWidgetFooter() { + var directive = { + requires: '^rdWidget', + transclude: true, + template: '', + restrict: 'E' + }; + return directive; +}; +/** + * Widget Header Directive + */ + +angular + .module('RDash') + .directive('rdWidgetHeader', rdWidgetTitle); + +function rdWidgetTitle() { + var directive = { + requires: '^rdWidget', + scope: { + title: '@', + icon: '@' + }, + transclude: true, + template: '
{{title}}
', + restrict: 'E' + }; + return directive; +}; +/** + * Widget Directive + */ + +angular + .module('RDash') + .directive('rdWidget', rdWidget); + +function rdWidget() { + var directive = { + transclude: true, + template: '
', + restrict: 'EA' + }; + return directive; + + function link(scope, element, attrs) { + /* */ + } +}; \ No newline at end of file diff --git a/app-backend/src/docker/DockerApi.js b/app-backend/src/docker/DockerApi.js index 24330b8..7f94c41 100644 --- a/app-backend/src/docker/DockerApi.js +++ b/app-backend/src/docker/DockerApi.js @@ -1050,7 +1050,7 @@ class DockerApi { instanceCount = Number(instanceCount); - if (instanceCount) { + if ((instanceCount && instanceCount > 0) || instanceCount === 0) { if (!updatedData.Mode.Replicated) { throw new Error('Non replicated services cannot be associated with instance count') }