Modify config field to use base api endpoint
allow streaming from gzipped tarball config
This commit is contained in:
parent
aff1a08a83
commit
d6d0bb640a
7 changed files with 40 additions and 33 deletions
|
@ -33,9 +33,9 @@ angular.module('quay-config').directive('fileUploadBox', function () {
|
|||
$scope.state = 'clear';
|
||||
$scope.selectedFiles = [];
|
||||
|
||||
var conductUpload = function(file, url, fileId, mimeType, progressCb, doneCb) {
|
||||
var conductUpload = function(file, apiEndpoint, fileId, mimeType, progressCb, doneCb) {
|
||||
var request = new XMLHttpRequest();
|
||||
request.open('POST', url, true);
|
||||
request.open('PUT', '/api/v1/' + apiEndpoint, true);
|
||||
request.setRequestHeader('Content-Type', mimeType);
|
||||
request.onprogress = function(e) {
|
||||
$scope.$apply(function() {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<div class="modal-body">
|
||||
<span>Please upload the previous configuration</span>
|
||||
<div class="file-upload-box"
|
||||
api-endpoint="/api/v1/configapp/tarconfig"
|
||||
api-endpoint="configapp/tarconfig"
|
||||
select-message="Select a previous configuration to modify. Must be in tar.gz format"
|
||||
files-selected="$ctrl.handleTarballSelected(files, callback)"
|
||||
files-cleared="$ctrl.handleFilesCleared()"
|
||||
|
|
|
@ -19,9 +19,8 @@
|
|||
<tr>
|
||||
<td>Upload certificates:</td>
|
||||
<td>
|
||||
<!--TODO(sam): fix this upload box to pass in the url it needs for custom certs (file-upload-box hardcodes right now)-->
|
||||
<div class="file-upload-box"
|
||||
api-endpoint="/api/v1/superuser/customcerts"
|
||||
api-endpoint="superuser/customcerts"
|
||||
select-message="Select custom certificate to add to configuration. Must be in PEM format and end extension '.crt'"
|
||||
files-selected="handleCertsSelected(files, callback)"
|
||||
reset="resetUpload"
|
||||
|
|
|
@ -191,10 +191,9 @@ angular.module("quay-config")
|
|||
};
|
||||
|
||||
$scope.validateHostname = function(hostname) {
|
||||
// TODO(sam): maybe revert?
|
||||
// if (hostname.indexOf('127.0.0.1') == 0 || hostname.indexOf('localhost') == 0) {
|
||||
// return 'Please specify a non-localhost hostname. "localhost" will refer to the container, not your machine.'
|
||||
// }
|
||||
if (hostname.indexOf('127.0.0.1') == 0 || hostname.indexOf('localhost') == 0) {
|
||||
return 'Please specify a non-localhost hostname. "localhost" will refer to the container, not your machine.'
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
|
Reference in a new issue