Add progress bar to other parts of the config app
Hardcode active classes to modal step bars
This commit is contained in:
parent
100d7eae81
commit
ab4bfee019
18 changed files with 131 additions and 32 deletions
|
@ -5,6 +5,9 @@ import re
|
||||||
from flask import make_response, render_template
|
from flask import make_response, render_template
|
||||||
from flask_restful import reqparse
|
from flask_restful import reqparse
|
||||||
|
|
||||||
|
from config import frontend_visible_config
|
||||||
|
|
||||||
|
from config_app.c_app import app
|
||||||
from config_app._init_config import ROOT_DIR
|
from config_app._init_config import ROOT_DIR
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,6 +48,7 @@ def render_page_template(name, route_data=None, js_bundle_name=DEFAULT_JS_BUNDLE
|
||||||
contents = render_template(name,
|
contents = render_template(name,
|
||||||
route_data=route_data,
|
route_data=route_data,
|
||||||
main_scripts=main_scripts,
|
main_scripts=main_scripts,
|
||||||
|
config_set=frontend_visible_config(app.config),
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
resp = make_response(contents)
|
resp = make_response(contents)
|
||||||
|
|
|
@ -16,6 +16,10 @@ class TransientDirectoryProvider(FileConfigProvider):
|
||||||
self.temp_dir = temp_dir
|
self.temp_dir = temp_dir
|
||||||
super(TransientDirectoryProvider, self).__init__(temp_dir.name, yaml_filename, py_filename)
|
super(TransientDirectoryProvider, self).__init__(temp_dir.name, yaml_filename, py_filename)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def provider_id(self):
|
||||||
|
return 'transient'
|
||||||
|
|
||||||
def new_config_dir(self):
|
def new_config_dir(self):
|
||||||
"""
|
"""
|
||||||
Update the path with a new temporary directory, deleting the old one in the process
|
Update the path with a new temporary directory, deleting the old one in the process
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<div class="co-floating-bottom-bar">
|
||||||
|
<span ng-transclude/>
|
||||||
|
</div>
|
|
@ -0,0 +1,44 @@
|
||||||
|
const templateUrl = require('./cor-floating-bottom-bar.html');
|
||||||
|
|
||||||
|
angular.module('quay-config')
|
||||||
|
.directive('corFloatingBottomBar', function() {
|
||||||
|
var directiveDefinitionObject = {
|
||||||
|
priority: 3,
|
||||||
|
templateUrl,
|
||||||
|
replace: true,
|
||||||
|
transclude: true,
|
||||||
|
restrict: 'C',
|
||||||
|
scope: {},
|
||||||
|
controller: function($rootScope, $scope, $element, $timeout, $interval) {
|
||||||
|
var handler = function() {
|
||||||
|
$element.removeClass('floating');
|
||||||
|
$element.css('width', $element[0].parentNode.clientWidth + 'px');
|
||||||
|
|
||||||
|
var windowHeight = $(window).height();
|
||||||
|
var rect = $element[0].getBoundingClientRect();
|
||||||
|
if (rect.bottom > windowHeight) {
|
||||||
|
$element.addClass('floating');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$(window).on("scroll", handler);
|
||||||
|
$(window).on("resize", handler);
|
||||||
|
|
||||||
|
var previousHeight = $element[0].parentNode.clientHeight;
|
||||||
|
var stop = $interval(function() {
|
||||||
|
var currentHeight = $element[0].parentNode.clientWidth;
|
||||||
|
if (previousHeight != currentHeight) {
|
||||||
|
currentHeight = previousHeight;
|
||||||
|
handler();
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
$scope.$on('$destroy', function() {
|
||||||
|
$(window).off("resize", handler);
|
||||||
|
$(window).off("scroll", handler);
|
||||||
|
$interval.cancel(stop);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return directiveDefinitionObject;
|
||||||
|
});
|
|
@ -13,7 +13,7 @@ angular.module('quay-config')
|
||||||
transclude: true,
|
transclude: true,
|
||||||
restrict: 'C',
|
restrict: 'C',
|
||||||
scope: {
|
scope: {
|
||||||
'progress': '=progress'
|
'progress': '=?progress'
|
||||||
},
|
},
|
||||||
controller: function($rootScope, $scope, $element) {
|
controller: function($rootScope, $scope, $element) {
|
||||||
$scope.$watch('progress', function(progress) {
|
$scope.$watch('progress', function(progress) {
|
||||||
|
|
|
@ -5,6 +5,14 @@
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
<span class="cor-step-bar">
|
||||||
|
<span class="cor-step active" title="Configure Database" text="1"></span>
|
||||||
|
<span class="cor-step active" title="Setup Database" icon="database"></span>
|
||||||
|
<span class="cor-step active" title="Create Superuser" text="2"></span>
|
||||||
|
<span class="cor-step active" title="Configure Registry" text="3"></span>
|
||||||
|
<span class="cor-step active" title="Validate Configuration" text="4"></span>
|
||||||
|
<span class="cor-step active" title="Setup Complete" icon="download"></span>
|
||||||
|
</span>
|
||||||
<h4 class="modal-title"><span>Download Configuration</span></h4>
|
<h4 class="modal-title"><span>Download Configuration</span></h4>
|
||||||
</div>
|
</div>
|
||||||
<!-- Body -->
|
<!-- Body -->
|
||||||
|
|
|
@ -5,7 +5,3 @@
|
||||||
.modal__warning-box {
|
.modal__warning-box {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal__warning-box .co-alert.co-alert-warning::before {
|
|
||||||
font-family:Font Awesome\ 5 Free;
|
|
||||||
}
|
|
||||||
|
|
|
@ -5,6 +5,14 @@
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
<span class="cor-step-bar">
|
||||||
|
<span class="cor-step active" title="Configure Database" text="1"></span>
|
||||||
|
<span class="cor-step" title="Setup Database" icon="database"></span>
|
||||||
|
<span class="cor-step" title="Create Superuser" text="2"></span>
|
||||||
|
<span class="cor-step" title="Configure Registry" text="3"></span>
|
||||||
|
<span class="cor-step" title="Validate Configuration" text="4"></span>
|
||||||
|
<span class="cor-step" title="Setup Complete" icon="download"></span>
|
||||||
|
</span>
|
||||||
<h4 class="modal-title"><span>Load Config</span></h4>
|
<h4 class="modal-title"><span>Load Config</span></h4>
|
||||||
</div>
|
</div>
|
||||||
<!-- Body -->
|
<!-- Body -->
|
|
@ -1,22 +1,22 @@
|
||||||
import {Component, EventEmitter, Inject, Output} from 'ng-metadata/core';
|
import {
|
||||||
const templateUrl = require('./load-config.html');
|
Component,
|
||||||
const styleUrl = require('./load-config.css');
|
EventEmitter,
|
||||||
|
Inject,
|
||||||
|
Output,
|
||||||
|
} from 'ng-metadata/core';
|
||||||
|
const templateUrl = require('./load-config.component.html');
|
||||||
|
|
||||||
declare var bootbox: any;
|
declare var bootbox: any;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'load-config',
|
selector: 'load-config',
|
||||||
templateUrl,
|
templateUrl,
|
||||||
styleUrls: [ styleUrl ],
|
|
||||||
})
|
})
|
||||||
export class LoadConfigComponent {
|
export class LoadConfigComponent {
|
||||||
private readyToSubmit: boolean = false;
|
private readyToSubmit: boolean = false;
|
||||||
private uploadFunc: Function;
|
private uploadFunc: Function;
|
||||||
@Output() public configLoaded: EventEmitter<any> = new EventEmitter();
|
@Output() public configLoaded: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
private constructor(@Inject('ApiService') private apiService: any) {
|
|
||||||
}
|
|
||||||
|
|
||||||
private handleTarballSelected(files: File[], callback: Function) {
|
private handleTarballSelected(files: File[], callback: Function) {
|
||||||
this.readyToSubmit = true;
|
this.readyToSubmit = true;
|
||||||
callback(true)
|
callback(true)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<span class="registry-name-element">{{ name }}</span>
|
22
config_app/js/components/registry-name/registry-name.js
Normal file
22
config_app/js/components/registry-name/registry-name.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
const templateUrl = require('./registry-name.html');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An element which displays the name of the registry (optionally the short name).
|
||||||
|
*/
|
||||||
|
angular.module('quay-config').directive('registryName', function () {
|
||||||
|
var directiveDefinitionObject = {
|
||||||
|
priority: 0,
|
||||||
|
templateUrl,
|
||||||
|
replace: false,
|
||||||
|
transclude: true,
|
||||||
|
restrict: 'C',
|
||||||
|
scope: {
|
||||||
|
'isShort': '=isShort'
|
||||||
|
},
|
||||||
|
controller: function($scope, $element, Config) {
|
||||||
|
$scope.name = $scope.isShort ? Config.REGISTRY_TITLE_SHORT : Config.REGISTRY_TITLE;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return directiveDefinitionObject;
|
||||||
|
});
|
||||||
|
|
|
@ -932,7 +932,7 @@
|
||||||
<span class="config-file-field" filename="ldap.crt" has-file="hasfile.LDAPTLSCert"></span>
|
<span class="config-file-field" filename="ldap.crt" has-file="hasfile.LDAPTLSCert"></span>
|
||||||
<div class="help-text">
|
<div class="help-text">
|
||||||
If specified, the certificate (in PEM format) for the LDAP TLS connection.
|
If specified, the certificate (in PEM format) for the LDAP TLS connection.
|
||||||
</div
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr ng-if="config.LDAP_URI.indexOf('ldaps://') == 0">
|
<tr ng-if="config.LDAP_URI.indexOf('ldaps://') == 0">
|
||||||
|
@ -1578,6 +1578,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- /GitLab Trigger -->
|
</div> <!-- /GitLab Trigger -->
|
||||||
|
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- Save Bar -->
|
<!-- Save Bar -->
|
||||||
|
@ -1605,6 +1606,14 @@
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
<span class="cor-step-bar">
|
||||||
|
<span class="cor-step active" title="Configure Database" text="1"></span>
|
||||||
|
<span class="cor-step active" title="Setup Database" icon="database"></span>
|
||||||
|
<span class="cor-step active" title="Create Superuser" text="2"></span>
|
||||||
|
<span class="cor-step active" title="Configure Registry" text="3"></span>
|
||||||
|
<span class="cor-step active" title="Validate Configuration" text="4"></span>
|
||||||
|
<span class="cor-step" title="Setup Complete" icon="download"></span>
|
||||||
|
</span>
|
||||||
<h4 class="modal-title">
|
<h4 class="modal-title">
|
||||||
Checking your settings
|
Checking your settings
|
||||||
</h4>
|
</h4>
|
||||||
|
|
|
@ -69,9 +69,6 @@ const templateUrl = require('./setup.html');
|
||||||
// An error occurred when setting up the database.
|
// An error occurred when setting up the database.
|
||||||
'DB_SETUP_ERROR': 'setup-db-error',
|
'DB_SETUP_ERROR': 'setup-db-error',
|
||||||
|
|
||||||
// The container is being restarted for the database changes.
|
|
||||||
'DB_RESTARTING': 'setup-db-restarting',
|
|
||||||
|
|
||||||
// A superuser is being configured.
|
// A superuser is being configured.
|
||||||
'CREATE_SUPERUSER': 'create-superuser',
|
'CREATE_SUPERUSER': 'create-superuser',
|
||||||
|
|
||||||
|
@ -90,9 +87,6 @@ const templateUrl = require('./setup.html');
|
||||||
// The configuration is fully valid.
|
// The configuration is fully valid.
|
||||||
'VALID_CONFIG': 'valid-config',
|
'VALID_CONFIG': 'valid-config',
|
||||||
|
|
||||||
// The container is being restarted for the configuration changes.
|
|
||||||
'CONFIG_RESTARTING': 'config-restarting',
|
|
||||||
|
|
||||||
// The product is ready for use.
|
// The product is ready for use.
|
||||||
'READY': 'ready'
|
'READY': 'ready'
|
||||||
}
|
}
|
||||||
|
@ -130,7 +124,6 @@ const templateUrl = require('./setup.html');
|
||||||
// Fall-through.
|
// Fall-through.
|
||||||
|
|
||||||
case $scope.States.CREATE_SUPERUSER:
|
case $scope.States.CREATE_SUPERUSER:
|
||||||
case $scope.States.DB_RESTARTING:
|
|
||||||
case $scope.States.CONFIG_DB:
|
case $scope.States.CONFIG_DB:
|
||||||
case $scope.States.VALID_CONFIG:
|
case $scope.States.VALID_CONFIG:
|
||||||
case $scope.States.READY:
|
case $scope.States.READY:
|
||||||
|
@ -179,11 +172,9 @@ const templateUrl = require('./setup.html');
|
||||||
return [
|
return [
|
||||||
isStepFamily(step, States.CONFIG_DB),
|
isStepFamily(step, States.CONFIG_DB),
|
||||||
isStepFamily(step, States.DB_SETUP),
|
isStepFamily(step, States.DB_SETUP),
|
||||||
isStep(step, States.DB_RESTARTING),
|
|
||||||
isStepFamily(step, States.CREATE_SUPERUSER),
|
isStepFamily(step, States.CREATE_SUPERUSER),
|
||||||
isStep(step, States.CONFIG),
|
isStep(step, States.CONFIG),
|
||||||
isStep(step, States.VALID_CONFIG),
|
isStep(step, States.VALID_CONFIG),
|
||||||
isStep(step, States.CONFIG_RESTARTING),
|
|
||||||
isStep(step, States.READY)
|
isStep(step, States.READY)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,12 +12,10 @@
|
||||||
<span class="cor-step-bar" progress="stepProgress">
|
<span class="cor-step-bar" progress="stepProgress">
|
||||||
<span class="cor-step" title="Configure Database" text="1"></span>
|
<span class="cor-step" title="Configure Database" text="1"></span>
|
||||||
<span class="cor-step" title="Setup Database" icon="database"></span>
|
<span class="cor-step" title="Setup Database" icon="database"></span>
|
||||||
<span class="cor-step" title="Container Restart" icon="sync"></span>
|
|
||||||
<span class="cor-step" title="Create Superuser" text="2"></span>
|
<span class="cor-step" title="Create Superuser" text="2"></span>
|
||||||
<span class="cor-step" title="Configure Registry" text="3"></span>
|
<span class="cor-step" title="Configure Registry" text="3"></span>
|
||||||
<span class="cor-step" title="Validate Configuration" text="4"></span>
|
<span class="cor-step" title="Validate Configuration" text="4"></span>
|
||||||
<span class="cor-step" title="Container Restart" icon="sync"></span>
|
<span class="cor-step" title="Setup Complete" icon="download"></span>
|
||||||
<span class="cor-step" title="Setup Complete" icon="check"></span>
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div><strong>Almost done!</strong></div>
|
<div><strong>Almost done!</strong></div>
|
||||||
|
@ -41,12 +39,10 @@
|
||||||
<span class="cor-step-bar" progress="stepProgress">
|
<span class="cor-step-bar" progress="stepProgress">
|
||||||
<span class="cor-step" title="Configure Database" text="1"></span>
|
<span class="cor-step" title="Configure Database" text="1"></span>
|
||||||
<span class="cor-step" title="Setup Database" icon="database"></span>
|
<span class="cor-step" title="Setup Database" icon="database"></span>
|
||||||
<span class="cor-step" title="Container Restart" icon="sync"></span>
|
|
||||||
<span class="cor-step" title="Create Superuser" text="2"></span>
|
<span class="cor-step" title="Create Superuser" text="2"></span>
|
||||||
<span class="cor-step" title="Configure Registry" text="3"></span>
|
<span class="cor-step" title="Configure Registry" text="3"></span>
|
||||||
<span class="cor-step" title="Validate Configuration" text="4"></span>
|
<span class="cor-step" title="Validate Configuration" text="4"></span>
|
||||||
<span class="cor-step" title="Container Restart" icon="sync"></span>
|
<span class="cor-step" title="Setup Complete" icon="download"></span>
|
||||||
<span class="cor-step" title="Setup Complete" icon="check"></span>
|
|
||||||
</span>
|
</span>
|
||||||
<h4 class="modal-title">Setup</h4>
|
<h4 class="modal-title">Setup</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,3 +22,15 @@
|
||||||
background-color: #dddddd;
|
background-color: #dddddd;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Overrides for fixing old quay styles*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Fixes the transition to font awesome 5 */
|
||||||
|
.quay-config-app .co-alert.co-alert-warning::before {
|
||||||
|
font-family: Font Awesome\ 5 Free;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quay-config-app .co-alert.co-alert-info::before {
|
||||||
|
font-family: Font Awesome\ 5 Free;
|
||||||
|
}
|
||||||
|
|
BIN
config_app/static/img/quay-logo.png
Normal file
BIN
config_app/static/img/quay-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
|
@ -3,6 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.__endpoints = {{ route_data|tojson|safe }}.paths;
|
window.__endpoints = {{ route_data|tojson|safe }}.paths;
|
||||||
|
window.__config = {{ config_set|tojson|safe }};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +29,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<title>Config app</title>
|
<title>Config app</title>
|
||||||
</head>
|
</head>
|
||||||
<body class="co-img-bg-network">
|
<body class="co-img-bg-network quay-config-app">
|
||||||
<config-setup-app></config-setup-app>
|
<config-setup-app></config-setup-app>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Reference in a new issue