From 604fd1de3b4fa2764f7fc4517c09c7a98a9a653b Mon Sep 17 00:00:00 2001 From: Kevan Ahlquist Date: Fri, 28 Nov 2014 22:11:56 -0600 Subject: [PATCH] Moved sidebar to its own submodule --- app/app.js | 2 +- {partials => app/components/sidebar}/sidebar.html | 0 app/components/sidebar/sidebarController.js | 11 +++++++++++ app/controllers.js | 10 ---------- index.html | 1 + 5 files changed, 13 insertions(+), 11 deletions(-) rename {partials => app/components/sidebar}/sidebar.html (100%) create mode 100644 app/components/sidebar/sidebarController.js diff --git a/app/app.js b/app/app.js index 89d45788a..5f3eb366e 100644 --- a/app/app.js +++ b/app/app.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('dockerui', ['ngRoute', 'dockerui.services', 'dockerui.filters', 'masthead', 'footer', 'dashboard', 'container', 'containers', 'images', 'image', 'startContainer']) +angular.module('dockerui', ['ngRoute', 'dockerui.services', 'dockerui.filters', 'masthead', 'footer', 'dashboard', 'container', 'containers', 'images', 'image', 'startContainer', 'sidebar']) .config(['$routeProvider', function ($routeProvider) { $routeProvider.when('/', {templateUrl: 'app/components/dashboard/dashboard.html', controller: 'DashboardController'}); $routeProvider.when('/containers/', {templateUrl: 'app/components/containers/containers.html', controller: 'ContainersController'}); diff --git a/partials/sidebar.html b/app/components/sidebar/sidebar.html similarity index 100% rename from partials/sidebar.html rename to app/components/sidebar/sidebar.html diff --git a/app/components/sidebar/sidebarController.js b/app/components/sidebar/sidebarController.js new file mode 100644 index 000000000..f182a3481 --- /dev/null +++ b/app/components/sidebar/sidebarController.js @@ -0,0 +1,11 @@ +angular.module('sidebar', []) +.controller('SideBarController', ['$scope', 'Container', 'Settings', +function($scope, Container, Settings) { + $scope.template = 'partials/sidebar.html'; + $scope.containers = []; + $scope.endpoint = Settings.endpoint; + + Container.query({all: 0}, function(d) { + $scope.containers = d; + }); +}]); diff --git a/app/controllers.js b/app/controllers.js index 4bfcb466b..e9cfd42bc 100644 --- a/app/controllers.js +++ b/app/controllers.js @@ -47,16 +47,6 @@ function getChart(id) { return new Chart(ctx); } -function SideBarController($scope, Container, Settings) { - $scope.template = 'partials/sidebar.html'; - $scope.containers = []; - $scope.endpoint = Settings.endpoint; - - Container.query({all: 0}, function(d) { - $scope.containers = d; - }); -} - function SettingsController($scope, System, Docker, Settings, Messages) { $scope.info = {}; $scope.docker = {}; diff --git a/index.html b/index.html index adac9bfbf..83c1ebf84 100644 --- a/index.html +++ b/index.html @@ -45,6 +45,7 @@ +