relative urls

This commit is contained in:
Michele Artini 2021-02-10 12:34:21 +01:00
parent 5a485666cc
commit fbd8f30e05
2 changed files with 10 additions and 10 deletions

View File

@ -24,7 +24,7 @@
<h1>Metadata Store Manager</h1>
<hr />
<a href="/doc" target="_blank">API documentation</a>
<a href="./swagger-ui.html" target="_blank">API documentation</a>
<hr />
<a href="javascript:void(0)" data-toggle="modal" data-target="#newMdstoreModal">create a new mdstore</a>
<hr />

View File

@ -9,7 +9,7 @@ app.controller('mdstoreManagerController', function($scope, $http) {
$scope.forceVersionDelete = false;
$scope.reload = function() {
$http.get('/mdstores/?' + $.now()).success(function(data) {
$http.get('./mdstores/?' + $.now()).success(function(data) {
$scope.mdstores = data;
}).error(function(err) {
alert('ERROR: ' + err.message);
@ -17,7 +17,7 @@ app.controller('mdstoreManagerController', function($scope, $http) {
};
$scope.newMdstore = function(format, layout, interpretation, dsName, dsId, apiId) {
var url = '/mdstores/new/' + encodeURIComponent(format) + '/' + encodeURIComponent(layout) + '/' + encodeURIComponent(interpretation);
var url = './mdstores/new/' + encodeURIComponent(format) + '/' + encodeURIComponent(layout) + '/' + encodeURIComponent(interpretation);
if (dsName || dsId || apiId) {
url += '?dsName=' + encodeURIComponent(dsName) + '&dsId=' + encodeURIComponent(dsId) + '&apiId=' + encodeURIComponent(apiId);
}
@ -30,7 +30,7 @@ app.controller('mdstoreManagerController', function($scope, $http) {
$scope.deleteMdstore = function(mdId) {
if (confirm("Are you sure ?")) {
$http.delete('/mdstores/mdstore/' + mdId).success(function(data) {
$http.delete('./mdstores/mdstore/' + mdId).success(function(data) {
$scope.reload();
}).error(function(err) {
alert('ERROR: ' + err.message);
@ -40,7 +40,7 @@ app.controller('mdstoreManagerController', function($scope, $http) {
$scope.prepareVersion = function(mdId, currentVersion) {
$scope.versions = [];
$http.get('/mdstores/mdstore/' + mdId + '/newVersion?' + $.now()).success(function(data) {
$http.get('./mdstores/mdstore/' + mdId + '/newVersion?' + $.now()).success(function(data) {
$scope.reload();
$scope.listVersions(mdId, currentVersion);
}).error(function(err) {
@ -51,7 +51,7 @@ app.controller('mdstoreManagerController', function($scope, $http) {
$scope.commitVersion = function(versionId) {
var size = parseInt(prompt("New Size", "0"));
if (size >= 0) {
$http.get("/mdstores/version/" + versionId + "/commit/" + size + '?' + $.now()).success(function(data) {
$http.get("./mdstores/version/" + versionId + "/commit/" + size + '?' + $.now()).success(function(data) {
$scope.reload();
$scope.openCurrentVersion = versionId;
$scope.refreshVersions();
@ -62,7 +62,7 @@ app.controller('mdstoreManagerController', function($scope, $http) {
};
$scope.abortVersion = function(versionId) {
$http.get("/mdstores/version/" + versionId + "/abort?" + $.now()).success(function(data) {
$http.get("./mdstores/version/" + versionId + "/abort?" + $.now()).success(function(data) {
$scope.reload();
$scope.refreshVersions();
}).error(function(err) {
@ -71,7 +71,7 @@ app.controller('mdstoreManagerController', function($scope, $http) {
};
$scope.resetReading = function(versionId) {
$http.get("/mdstores/version/" + versionId + "/resetReading" + '?' + $.now()).success(function(data) {
$http.get("./mdstores/version/" + versionId + "/resetReading" + '?' + $.now()).success(function(data) {
$scope.reload();
$scope.refreshVersions();
}).error(function(err) {
@ -87,7 +87,7 @@ app.controller('mdstoreManagerController', function($scope, $http) {
};
$scope.refreshVersions = function() {
$http.get('/mdstores/mdstore/' + $scope.openMdstore + '/versions?' + $.now()).success(function(data) {
$http.get('./mdstores/mdstore/' + $scope.openMdstore + '/versions?' + $.now()).success(function(data) {
angular.forEach(data, function(value, key) {
value.current = (value.id == $scope.openCurrentVersion);
});
@ -99,7 +99,7 @@ app.controller('mdstoreManagerController', function($scope, $http) {
$scope.deleteVersion = function(versionId, force) {
if (confirm("Are you sure ?")) {
var url = '/mdstores/version/' + versionId;
var url = './mdstores/version/' + versionId;
if (force) { url += '?force=true'; }
$http.delete(url).success(function(data) {