-
Notifications
You must be signed in to change notification settings - Fork 4.8k
[DEVEXP-457] Create app from source #1221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,8 +120,11 @@ | |
| <script src="scripts/services/userstore.js"></script> | ||
| <script src="scripts/services/auth.js"></script> | ||
| <script src="scripts/services/data.js"></script> | ||
| <script src="scripts/services/applicationGenerator.js"></script> | ||
| <script src="scripts/services/login.js"></script> | ||
| <script src="scripts/services/logout.js"></script> | ||
| <script src="scripts/services/navigate.js"></script> | ||
| <script src="scripts/services/nameGenerator.js"></script> | ||
| <script src="scripts/services/tasks.js"></script> | ||
| <script src="scripts/services/notification.js"></script> | ||
| <script src="scripts/controllers/projects.js"></script> | ||
|
|
@@ -133,14 +136,23 @@ | |
| <script src="scripts/controllers/images.js"></script> | ||
| <script src="scripts/controllers/deployments.js"></script> | ||
| <script src="scripts/controllers/services.js"></script> | ||
| <script src="scripts/controllers/create/createFromImage.js"></script> | ||
| <script src="scripts/controllers/newfromtemplate.js"></script> | ||
| <script src="scripts/controllers/labels.js"></script> | ||
| <script src="scripts/controllers/tasks.js"></script> | ||
| <script src="scripts/controllers/util/oauth.js"></script> | ||
| <script src="scripts/controllers/util/error.js"></script> | ||
| <script src="scripts/controllers/util/logout.js"></script> | ||
| <script src="scripts/controllers/catalog.js"></script> | ||
| <script src="scripts/controllers/catalog/templates.js"></script> | ||
| <script src="scripts/controllers/catalog/images.js"></script> | ||
| <script src="scripts/controllers/create.js"></script> | ||
| <script src="scripts/directives/date.js"></script> | ||
| <script src="scripts/directives/oscFileInput.js"></script> | ||
| <script src="scripts/directives/oscFormSection.js"></script> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a reason to prefix these with 'osc' (I would think all directives are part of the openshift console)?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was the discussion we had the other day about prefixing our directives, its apparently a "best practice" to prefix them, so . It is debatable whether the file name really needs to have the prefix since in some of these files we are putting multiple directives.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we do decide to prefix the files, it'd make sense to eventually prefix all of them |
||
| <script src="scripts/directives/oscImageSummary.js"></script> | ||
| <script src="scripts/directives/oscKeyValues.js"></script> | ||
| <script src="scripts/directives/oscResourceNameValidator.js"></script> | ||
| <script src="scripts/directives/oscRouting.js"></script> | ||
| <script src="scripts/directives/resources.js"></script> | ||
| <script src="scripts/directives/nav.js"></script> | ||
| <script src="scripts/directives/alerts.js"></script> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| 'use strict'; | ||
|
|
||
| /** | ||
| * @ngdoc function | ||
| * @name openshiftConsole.controller:PodsController | ||
| * @description | ||
| * # ProjectController | ||
| * Controller of the openshiftConsole | ||
| */ | ||
| angular.module('openshiftConsole') | ||
| .controller('CatalogImagesController', function ($scope, DataService, $filter, LabelFilter, imageEnvFilter, $routeParams, Logger) { | ||
| $scope.projectImageRepos = {}; | ||
| $scope.openshiftImageRepos = {}; | ||
| $scope.builders = []; | ||
| $scope.images = []; | ||
| $scope.sourceURL = $routeParams.builderfor; | ||
|
|
||
| var imagesForRepos = function(imageRepos, scope) { | ||
| angular.forEach(imageRepos, function(imageRepo) { | ||
| if (imageRepo.status) { | ||
| angular.forEach(imageRepo.status.tags, function(tag) { | ||
| var imageRepoTag = tag.tag; | ||
| var image = { | ||
| imageRepo: imageRepo, | ||
| imageRepoTag: imageRepoTag, | ||
| name: imageRepo.metadata.name + ":" + imageRepoTag | ||
| }; | ||
| $scope.images.push(image); | ||
|
|
||
| var categoryTags = []; | ||
| if(imageRepo.spec.tags){ | ||
| angular.forEach(imageRepo.spec.tags, function(imageTags){ | ||
| if(imageTags.annotations && imageTags.annotations.tags){ | ||
| categoryTags = imageTags.annotations.tags.split(/\s*,\s*/); | ||
| } | ||
| if (categoryTags.indexOf("builder") >= 0) { | ||
| $scope.builders.push(image); | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
| Logger.info("builders", $scope.builders); | ||
| } | ||
| }); | ||
| }; | ||
|
|
||
| DataService.list("imageStreams", $scope, function(imageRepos) { | ||
| $scope.projectImageRepos = imageRepos.by("metadata.name"); | ||
| imagesForRepos($scope.projectImageRepos, $scope); | ||
|
|
||
| Logger.info("project image repos", $scope.projectImageRepos); | ||
| }); | ||
|
|
||
| DataService.list("imageStreams", {namespace: "openshift"}, function(imageRepos) { | ||
| $scope.openshiftImageRepos = imageRepos.by("metadata.name"); | ||
| imagesForRepos($scope.openshiftImageRepos, {namespace: "openshift"}); | ||
|
|
||
| Logger.info("openshift image repos", $scope.openshiftImageRepos); | ||
| }); | ||
|
|
||
|
|
||
| var templatesByTag = function() { | ||
| $scope.templatesByTag = {}; | ||
| angular.forEach($scope.templates, function(template) { | ||
| if (template.metadata.annotations && template.metadata.annotations.tags) { | ||
| var tags = template.metadata.annotations.tags.split(","); | ||
| angular.forEach(tags, function(tag){ | ||
| tag = $.trim(tag); | ||
| // not doing this as a map since we are dealing with things across namespaces that could have collisions on name | ||
| $scope.templatesByTag[tag] = $scope.templatesByTag[tag] || []; | ||
| $scope.templatesByTag[tag].push(template); | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| Logger.info("templatesByTag", $scope.templatesByTag); | ||
| }; | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| 'use strict'; | ||
|
|
||
| /** | ||
| * @ngdoc function | ||
| * @name openshiftConsole.controller:PodsController | ||
| * @description | ||
| * # ProjectController | ||
| * Controller of the openshiftConsole | ||
| */ | ||
| angular.module('openshiftConsole') | ||
| .controller('CreateController', function ($scope, DataService, $filter, LabelFilter, $location, Logger) { | ||
| $scope.projectTemplates = {}; | ||
| $scope.openshiftTemplates = {}; | ||
|
|
||
| $scope.templatesByTag = {}; | ||
|
|
||
| $scope.sourceURLPattern = /^(ftp|http|https|git):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/; | ||
|
|
||
| DataService.list("templates", $scope, function(templates) { | ||
| $scope.projectTemplates = templates.by("metadata.name"); | ||
| templatesByTag(); | ||
| Logger.info("project templates", $scope.projectTemplates); | ||
| }); | ||
|
|
||
| DataService.list("templates", {namespace: "openshift"}, function(templates) { | ||
| $scope.openshiftTemplates = templates.by("metadata.name"); | ||
| templatesByTag(); | ||
| Logger.info("openshift templates", $scope.openshiftTemplates); | ||
| }); | ||
|
|
||
| var templatesByTag = function() { | ||
| $scope.templatesByTag = {}; | ||
| var fn = function(template) { | ||
| if (template.metadata.annotations && template.metadata.annotations.tags) { | ||
| var tags = template.metadata.annotations.tags.split(","); | ||
| angular.forEach(tags, function(tag){ | ||
| tag = $.trim(tag); | ||
| // not doing this as a map since we are dealing with things across namespaces that could have collisions on name | ||
| $scope.templatesByTag[tag] = $scope.templatesByTag[tag] || []; | ||
| $scope.templatesByTag[tag].push(template); | ||
| }); | ||
| } | ||
| }; | ||
|
|
||
| angular.forEach($scope.projectTemplates, fn); | ||
| angular.forEach($scope.openshiftTemplates, fn); | ||
|
|
||
| Logger.info("templatesByTag", $scope.templatesByTag); | ||
| }; | ||
|
|
||
| $scope.createFromSource = function() { | ||
| if($scope.from_source_form.$valid) { | ||
| var createURI = URI.expand("/project/{project}/catalog/images{?q*}", { | ||
| project: $scope.projectName, | ||
| q: { | ||
| builderfor: $scope.from_source_url | ||
| } | ||
| }); | ||
| $location.url(createURI.toString()); | ||
| } | ||
| }; | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this for? if its something only you are going to have locally, then lets not check this in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its an artifact left by using the netbeans IDE. Isnt it easier to update the .gitignore file then having to exclude it everytime we make changes. presumably im the only one using the ide..but it doesnt cost us anything