Add initial support to add applinks
This commit is contained in:
@@ -89,6 +89,32 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
|
||||
}
|
||||
};
|
||||
|
||||
$scope.applinksAdd = {
|
||||
error: {},
|
||||
busy: false,
|
||||
upstreamUri: '',
|
||||
|
||||
show: function () {
|
||||
$scope.applinksAdd.error = {};
|
||||
$scope.applinksAdd.busy = false;
|
||||
$scope.applinksAdd.upstreamUri = '';
|
||||
|
||||
$('#applinksAddModal').modal('show');
|
||||
|
||||
return false; // prevent propagation and default
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
if (!$scope.applinksAdd.upstreamUri) return;
|
||||
|
||||
Client.addApplink({ upstreamUri: $scope.applinksAdd.upstreamUri }, function (error, result) {
|
||||
if (error) return console.error('Failed to add applink', error);
|
||||
|
||||
$('#applinksAddModal').modal('hide');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.showAppConfigure = function (app, view) {
|
||||
$location.path('/app/' + app.id + '/' + view);
|
||||
};
|
||||
@@ -136,6 +162,13 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
|
||||
});
|
||||
});
|
||||
|
||||
// setup all the dialog focus handling
|
||||
['applinksAddModal'].forEach(function (id) {
|
||||
$('#' + id).on('shown.bs.modal', function () {
|
||||
$(this).find("[autofocus]:first").focus();
|
||||
});
|
||||
});
|
||||
|
||||
$('.collapse').on('shown.bs.collapse', function(){
|
||||
$(this).parent().find('.fa-angle-right').removeClass('fa-angle-right').addClass('fa-angle-down');
|
||||
}).on('hidden.bs.collapse', function(){
|
||||
|
||||
Reference in New Issue
Block a user