1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

Add Dockerfile view builder

This commit is contained in:
Michael Crosby 2013-06-18 16:21:27 -09:00
parent a7e92093c2
commit 7b7bb46844
7 changed files with 40 additions and 33 deletions

View file

@ -104,9 +104,7 @@
#editor { #editor {
height: 300px; height: 300px;
width: 475px; width: 100%;
border: 1px solid #DDD; border: 1px solid #DDD;
border-radius: 4px;
border-bottom-right-radius: 0px;
margin-top: 5px; margin-top: 5px;
} }

View file

@ -50,6 +50,8 @@
<script src="../assets/js/bootstrap-carousel.js"></script> <script src="../assets/js/bootstrap-carousel.js"></script>
<script src="../assets/js/bootstrap-typeahead.js"></script> <script src="../assets/js/bootstrap-typeahead.js"></script>
<script src="/lib/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="lib/angular/angular.js"></script> <script src="lib/angular/angular.js"></script>
<script src="lib/angular/angular-resource.js"></script> <script src="lib/angular/angular-resource.js"></script>
<script src="js/app.js"></script> <script src="js/app.js"></script>

View file

@ -8,7 +8,6 @@ angular.module('dockerui', ['dockerui.services', 'dockerui.filters'])
$routeProvider.when('/images/', {templateUrl: 'partials/images.html', controller: 'ImagesController'}); $routeProvider.when('/images/', {templateUrl: 'partials/images.html', controller: 'ImagesController'});
$routeProvider.when('/images/:id/', {templateUrl: 'partials/image.html', controller: 'ImageController'}); $routeProvider.when('/images/:id/', {templateUrl: 'partials/image.html', controller: 'ImageController'});
$routeProvider.when('/settings', {templateUrl: 'partials/settings.html', controller: 'SettingsController'}); $routeProvider.when('/settings', {templateUrl: 'partials/settings.html', controller: 'SettingsController'});
$routeProvider.when('/build', {templateUrl: 'partials/builder.html', controller: 'BuilderController'});
$routeProvider.otherwise({redirectTo: '/'}); $routeProvider.otherwise({redirectTo: '/'});
}]) }])
// This is your docker url that the api will use to make requests // This is your docker url that the api will use to make requests

View file

@ -165,12 +165,16 @@ function ImagesController($scope, Image) {
$('#response').hide(); $('#response').hide();
$scope.alertClass = 'block'; $scope.alertClass = 'block';
$scope.showBuilder = function() {
$('#build-modal').modal('show');
};
Image.query({}, function(d) { Image.query({}, function(d) {
$scope.images = d; $scope.images = d;
}, function (e) { }, function (e) {
console.log(e); console.log(e);
setFailedResponse($scope, e.data, '#response'); setFailedResponse($scope, e.data, '#response');
}); });
} }
// Controller for a single image and actions on that image // 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.commandPlaceholder = '["/bin/echo", "Hello world"]';
$scope.close = function() {
$('#create-modal').modal('hide');
};
$scope.create = function() { $scope.create = function() {
$scope.response = ''; $scope.response = '';
var cmds = null; var cmds = null;
@ -279,7 +279,12 @@ function StartContainerController($scope, $routeParams, $location, Container) {
} }
function BuilderController($scope, Image) { 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) { function setSuccessfulResponse($scope, msg, msgId) {

View file

@ -1,20 +1,22 @@
<script src="/lib/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> <div id="build-modal" class="modal hide fade">
<h2>Build image:</h2> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<div class="detail"> <h3>Build Image</h3>
<div id="response" class="alert alert-{{ alertClass }}"> </div>
<div class="modal-body">
<div>
{{ response }} {{ response }}
</div> </div>
<div id="editor"></div>
<div id="editor"> </div>
<div class="modal-footer">
</div> <a href="" class="btn btn-primary" ng-click="build()">Build</a>
</div>
<script>
ace.config.set('basePath', '/lib/ace-builds/src-noconflict/');
var editor = ace.edit("editor");
editor.setTheme("ace/theme/clouds");
editor.getSession().setMode("ace/mode/batchfile");
</script>
</div> </div>
<script type="text/javascript">
var editor = ace.edit("editor");
editor.setValue('');
editor.setTheme("ace/theme/clouds");
editor.getSession().setMode("ace/mode/batchfile");
</script>

View file

@ -1,10 +1,13 @@
<div ng-include="template" ng-controller="BuilderController"></div>
<h2>Images:</h2> <h2>Images:</h2>
<div id="response" class="alert alert-{{ alertClass }}"> <div id="response" class="alert alert-{{ alertClass }}">
{{ response }} {{ response }}
</div> </div>
<a href="/#/build/">Build Image</a>
<a href="" ng-click="showBuilder()">Build Image</a>
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>

View file

@ -1,4 +1,3 @@
<div id="create-modal" class="modal hide fade"> <div id="create-modal" class="modal hide fade">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
@ -27,7 +26,6 @@
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a href="" class="btn" ng-click="close()">Close</a>
<a href="" class="btn btn-primary" ng-click="create()">Create</a> <a href="" class="btn btn-primary" ng-click="create()">Create</a>
</div> </div>
</div> </div>