diff --git a/app/app.js b/app/app.js index 3f2e9a1fa..c94961bb2 100644 --- a/app/app.js +++ b/app/app.js @@ -71,5 +71,4 @@ angular.module('dockerui', [ // You need to set this to the api endpoint without the port i.e. http://192.168.1.9 .constant('DOCKER_ENDPOINT', 'dockerapi') .constant('DOCKER_PORT', '') // Docker port, leave as an empty string if no port is requred. If you have a port, prefix it with a ':' i.e. :4243 - .constant('UI_VERSION', 'v0.9.0-beta') - .constant('DOCKER_API_VERSION', 'v1.20'); + .constant('UI_VERSION', 'v0.9.0-beta'); diff --git a/app/components/builder/builderController.js b/app/components/builder/builderController.js index 5455aae4a..f89ce4e05 100644 --- a/app/components/builder/builderController.js +++ b/app/components/builder/builderController.js @@ -1,5 +1,5 @@ angular.module('builder', []) - .controller('BuilderController', ['$scope', 'Dockerfile', 'Messages', - function ($scope, Dockerfile, Messages) { + .controller('BuilderController', ['$scope', + function ($scope) { $scope.template = 'app/components/builder/builder.html'; }]); diff --git a/app/components/footer/footerController.js b/app/components/footer/footerController.js index 021ab5721..3e7cd2532 100644 --- a/app/components/footer/footerController.js +++ b/app/components/footer/footerController.js @@ -1,9 +1,9 @@ angular.module('footer', []) - .controller('FooterController', ['$scope', 'Settings', 'Docker', function ($scope, Settings, Docker) { + .controller('FooterController', ['$scope', 'Settings', 'Version', function ($scope, Settings, Version) { $scope.template = 'app/components/footer/statusbar.html'; $scope.uiVersion = Settings.uiVersion; - Docker.get({}, function (d) { + Version.get({}, function (d) { $scope.apiVersion = d.ApiVersion; }); }]); diff --git a/app/components/info/infoController.js b/app/components/info/infoController.js index 9cbf9fb07..794e03e13 100644 --- a/app/components/info/infoController.js +++ b/app/components/info/infoController.js @@ -1,15 +1,14 @@ angular.module('info', []) - .controller('InfoController', ['$scope', 'System', 'Docker', 'Settings', 'Messages', - function ($scope, System, Docker, Settings, Messages) { + .controller('InfoController', ['$scope', 'Info', 'Version', 'Settings', + function ($scope, Info, Version, Settings) { $scope.info = {}; $scope.docker = {}; $scope.endpoint = Settings.endpoint; - $scope.apiVersion = Settings.version; - Docker.get({}, function (d) { + Version.get({}, function (d) { $scope.docker = d; }); - System.get({}, function (d) { + Info.get({}, function (d) { $scope.info = d; }); }]); diff --git a/app/components/pullImage/pullImageController.js b/app/components/pullImage/pullImageController.js index 48e05f8c4..d53fe9c2c 100644 --- a/app/components/pullImage/pullImageController.js +++ b/app/components/pullImage/pullImageController.js @@ -1,6 +1,6 @@ angular.module('pullImage', []) - .controller('PullImageController', ['$scope', '$log', 'Dockerfile', 'Messages', 'Image', 'ViewSpinner', - function ($scope, $log, Dockerfile, Messages, Image, ViewSpinner) { + .controller('PullImageController', ['$scope', '$log', 'Messages', 'Image', 'ViewSpinner', + function ($scope, $log, Messages, Image, ViewSpinner) { $scope.template = 'app/components/pullImage/pullImage.html'; $scope.init = function () { diff --git a/app/shared/services.js b/app/shared/services.js index e758312ea..3f48132b5 100644 --- a/app/shared/services.js +++ b/app/shared/services.js @@ -95,7 +95,7 @@ angular.module('dockerui.services', ['ngResource']) remove: {method: 'DELETE', params: {id: '@id'}, isArray: true} }); }]) - .factory('Docker', ['$resource', 'Settings', function DockerFactory($resource, Settings) { + .factory('Version', ['$resource', 'Settings', function VersionFactory($resource, Settings) { 'use strict'; // http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#show-the-docker-version-information return $resource(Settings.url + '/version', {}, { @@ -110,7 +110,7 @@ angular.module('dockerui.services', ['ngResource']) update: {method: 'POST'} }); }]) - .factory('System', ['$resource', 'Settings', function SystemFactory($resource, Settings) { + .factory('Info', ['$resource', 'Settings', function InfoFactory($resource, Settings) { 'use strict'; // http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#display-system-wide-information return $resource(Settings.url + '/info', {}, { @@ -129,7 +129,7 @@ angular.module('dockerui.services', ['ngResource']) disconnect: {method: 'POST', params: {action: 'disconnect'}} }); }]) - .factory('Settings', ['DOCKER_ENDPOINT', 'DOCKER_PORT', 'DOCKER_API_VERSION', 'UI_VERSION', function SettingsFactory(DOCKER_ENDPOINT, DOCKER_PORT, DOCKER_API_VERSION, UI_VERSION) { + .factory('Settings', ['DOCKER_ENDPOINT', 'DOCKER_PORT', 'UI_VERSION', function SettingsFactory(DOCKER_ENDPOINT, DOCKER_PORT, UI_VERSION) { 'use strict'; var url = DOCKER_ENDPOINT; if (DOCKER_PORT) { @@ -138,8 +138,6 @@ angular.module('dockerui.services', ['ngResource']) return { displayAll: false, endpoint: DOCKER_ENDPOINT, - version: DOCKER_API_VERSION, - rawUrl: DOCKER_ENDPOINT + DOCKER_PORT + '/' + DOCKER_API_VERSION, uiVersion: UI_VERSION, url: url, firstLoad: true @@ -188,23 +186,6 @@ angular.module('dockerui.services', ['ngResource']) } }; }]) - .factory('Dockerfile', ['Settings', function DockerfileFactory(Settings) { - 'use strict'; - // http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#build-image-from-a-dockerfile - var url = Settings.rawUrl + '/build'; - return { - build: function (file, callback) { - var data = new FormData(); - var dockerfile = new Blob([file], {type: 'text/text'}); - data.append('Dockerfile', dockerfile); - - var request = new XMLHttpRequest(); - request.onload = callback; - request.open('POST', url); - request.send(data); - } - }; - }]) .factory('LineChart', ['Settings', function LineChartFactory(Settings) { 'use strict'; return {