Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
fix compose registry
Browse files Browse the repository at this point in the history
  • Loading branch information
francescou committed Sep 26, 2017
1 parent a0a31b1 commit 15280f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions main.py
Expand Up @@ -21,7 +21,7 @@
# Flask Application
API_V1 = '/api/v1/'
YML_PATH = os.getenv('DOCKER_COMPOSE_UI_YML_PATH') or '.'
COMPOSE_REGISTRY = os.getenv('DOCKER_COMPOSE_REGISTRY') or 'https://www.composeregistry.com'
COMPOSE_REGISTRY = os.getenv('DOCKER_COMPOSE_REGISTRY')

logging.basicConfig(level=logging.INFO)
app = Flask(__name__, static_url_path='')
Expand Down Expand Up @@ -285,7 +285,7 @@ def remove_project(name):
@app.route(API_V1 + "search", methods=['POST'])
def search():
"""
search for a project on a docker-compose registry (e.g. www.composeregistry.com)
search for a project on a docker-compose registry
"""
query = loads(request.data)['query']
response = requests.get(COMPOSE_REGISTRY + '/api/v1/search', \
Expand All @@ -299,7 +299,7 @@ def search():
@app.route(API_V1 + "yml", methods=['POST'])
def yml():
"""
get yml content from a docker-compose registry (e.g. www.composeregistry.com)
get yml content from a docker-compose registry
"""
item_id = loads(request.data)['id']
response = requests.get(COMPOSE_REGISTRY + '/api/v1/yml', \
Expand Down
8 changes: 6 additions & 2 deletions static/scripts/controllers/create.js
Expand Up @@ -27,7 +27,11 @@ angular.module('composeUiApp')
var ComposeRegistry = $resource('api/v1/compose-registry');

ComposeRegistry.get(function (data) {
$scope.composeRegistry = data.url;
var url = data.url;
$scope.composeRegistry = url;
if (url) {
$scope.search('yml');
}
});

$scope.createProject = function (name, yml, env) {
Expand Down Expand Up @@ -82,7 +86,7 @@ angular.module('composeUiApp')

};

$scope.search('yml');


$scope.load = function (name, id) {

Expand Down
2 changes: 1 addition & 1 deletion static/views/create.html
Expand Up @@ -4,7 +4,7 @@ <h3>Create new project</h3>
<div class="row">
<div class="col-md-8 col-md-offset-2">

<div class="panel panel-default">
<div class="panel panel-default" ng-show="composeRegistry">
<div class="panel-heading">create project from template</div>
<div class="panel-body">
<form class="form-inline" ng-submit="search(query)">
Expand Down

0 comments on commit 15280f7

Please sign in to comment.