From 7b7bb468440bfcf3c2a784d2ee90df7cf9820537 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Tue, 18 Jun 2013 16:21:27 -0900 Subject: [PATCH] Add Dockerfile view builder --- css/app.css | 4 +--- index.html | 2 ++ js/app.js | 1 - js/controllers.js | 17 +++++++++++------ partials/builder.html | 36 +++++++++++++++++++----------------- partials/images.html | 11 +++++++---- partials/startcontainer.html | 2 -- 7 files changed, 40 insertions(+), 33 deletions(-) diff --git a/css/app.css b/css/app.css index a7311bf20..183e4b127 100644 --- a/css/app.css +++ b/css/app.css @@ -104,9 +104,7 @@ #editor { height: 300px; - width: 475px; + width: 100%; border: 1px solid #DDD; - border-radius: 4px; - border-bottom-right-radius: 0px; margin-top: 5px; } diff --git a/index.html b/index.html index e8da9503b..6f8537ccb 100644 --- a/index.html +++ b/index.html @@ -50,6 +50,8 @@ + + diff --git a/js/app.js b/js/app.js index 94a2a0885..386179a67 100644 --- a/js/app.js +++ b/js/app.js @@ -8,7 +8,6 @@ angular.module('dockerui', ['dockerui.services', 'dockerui.filters']) $routeProvider.when('/images/', {templateUrl: 'partials/images.html', controller: 'ImagesController'}); $routeProvider.when('/images/:id/', {templateUrl: 'partials/image.html', controller: 'ImageController'}); $routeProvider.when('/settings', {templateUrl: 'partials/settings.html', controller: 'SettingsController'}); - $routeProvider.when('/build', {templateUrl: 'partials/builder.html', controller: 'BuilderController'}); $routeProvider.otherwise({redirectTo: '/'}); }]) // This is your docker url that the api will use to make requests diff --git a/js/controllers.js b/js/controllers.js index 7053e2a5a..57c2ff222 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -165,12 +165,16 @@ function ImagesController($scope, Image) { $('#response').hide(); $scope.alertClass = 'block'; + $scope.showBuilder = function() { + $('#build-modal').modal('show'); + }; + Image.query({}, function(d) { $scope.images = d; }, function (e) { console.log(e); setFailedResponse($scope, e.data, '#response'); - }); + }); } // Controller for a single image and actions on that image @@ -238,10 +242,6 @@ function StartContainerController($scope, $routeParams, $location, Container) { }; $scope.commandPlaceholder = '["/bin/echo", "Hello world"]'; - $scope.close = function() { - $('#create-modal').modal('hide'); - }; - $scope.create = function() { $scope.response = ''; var cmds = null; @@ -279,7 +279,12 @@ function StartContainerController($scope, $routeParams, $location, Container) { } function BuilderController($scope, Image) { - $('#response').hide(); + $scope.template = '/partials/builder.html'; + + ace.config.set('basePath', '/lib/ace-builds/src-noconflict/'); + + $scope.build = function() { + }; } function setSuccessfulResponse($scope, msg, msgId) { diff --git a/partials/builder.html b/partials/builder.html index 2ef65e04b..a572322c3 100644 --- a/partials/builder.html +++ b/partials/builder.html @@ -1,20 +1,22 @@ - -

Build image:

- -
-
+ + diff --git a/partials/images.html b/partials/images.html index 161ce2d16..7dafb8a4a 100644 --- a/partials/images.html +++ b/partials/images.html @@ -1,10 +1,13 @@ +
+

Images:

-
- {{ response }} -
-Build Image +
+ {{ response }} +
+ +Build Image diff --git a/partials/startcontainer.html b/partials/startcontainer.html index c4e74f502..41293a952 100644 --- a/partials/startcontainer.html +++ b/partials/startcontainer.html @@ -1,4 +1,3 @@ -