make H2 database console available
This commit is contained in:
@@ -17,7 +17,8 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
|||||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||||
auth.inMemoryAuthentication()
|
auth.inMemoryAuthentication()
|
||||||
.withUser("adam@mail.com").password("test").roles("USER", "ADMIN").and()
|
.withUser("adam@mail.com").password("test").roles("USER", "ADMIN").and()
|
||||||
.withUser("betty@mail.com").password("test").roles("USER");
|
.withUser("tilman").password("test").roles("USER", "ADMIN").and()
|
||||||
|
.withUser("anica").password("test").roles("USER");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -25,11 +26,13 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
|||||||
// Basis-Schutz: Nur autorisierte Zugriffe (feingranulare Steuerung über Assertions)
|
// Basis-Schutz: Nur autorisierte Zugriffe (feingranulare Steuerung über Assertions)
|
||||||
http.authorizeRequests()
|
http.authorizeRequests()
|
||||||
.antMatchers(HttpMethod.GET, "/public/**").permitAll()
|
.antMatchers(HttpMethod.GET, "/public/**").permitAll()
|
||||||
|
.antMatchers("/console/**").permitAll()
|
||||||
.anyRequest().authenticated();
|
.anyRequest().authenticated();
|
||||||
|
|
||||||
http.httpBasic(); // XXX mit HTTP Basic Auth funktioniert der Logout nicht richtig
|
http.httpBasic(); // XXX mit HTTP Basic Auth funktioniert der Logout nicht richtig
|
||||||
// http.formLogin();
|
// http.formLogin();
|
||||||
|
|
||||||
http.csrf().disable(); // XXX später wieder aktivieren
|
http.csrf().disable(); // XXX später wieder aktivieren
|
||||||
|
http.headers().frameOptions().disable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ INSERT INTO Transaction (id, amount, account_id, category_id, date, description,
|
|||||||
(NULL, -4.81, 1, 3, '2016-04-18', 'Currywurst (Auslage Adam)', 1),
|
(NULL, -4.81, 1, 3, '2016-04-18', 'Currywurst (Auslage Adam)', 1),
|
||||||
(NULL, -4.50, 1, 3, '2016-04-19', 'Currywurst', null),
|
(NULL, -4.50, 1, 3, '2016-04-19', 'Currywurst', null),
|
||||||
(NULL, -4.50, 1, 3, '2016-04-20', 'Currywurst', null),
|
(NULL, -4.50, 1, 3, '2016-04-20', 'Currywurst', null),
|
||||||
(NULL, -4.50, 2, 3, '2016-04-20', 'Currywurst', null),
|
|
||||||
(NULL, -4.09, 1, 3, '2016-04-18', 'Currywurst-Frühstück', null),
|
(NULL, -4.09, 1, 3, '2016-04-18', 'Currywurst-Frühstück', null),
|
||||||
(NULL, -4.90, 1, 3, '2016-04-18', 'Currywurst (Auslage Betty)', 2),
|
(NULL, -4.90, 1, 3, '2016-04-18', 'Currywurst (Auslage Betty)', 2),
|
||||||
(NULL, -8.90, 1, 3, '2016-04-18', 'Curry beim Inder (Auslage Adam)', 1),
|
(NULL, -8.90, 1, 3, '2016-04-18', 'Curry beim Inder (Auslage Adam)', 1),
|
||||||
@@ -28,6 +27,7 @@ INSERT INTO Transaction (id, amount, account_id, category_id, date, description,
|
|||||||
(NULL, -10, 1, 4, '2016-04-14 10:03:00', 'Entnahme Adam', 1),
|
(NULL, -10, 1, 4, '2016-04-14 10:03:00', 'Entnahme Adam', 1),
|
||||||
|
|
||||||
(NULL, 1340.22, 2, 5, '2016-04-02', 'Gehalt Adam', null),
|
(NULL, 1340.22, 2, 5, '2016-04-02', 'Gehalt Adam', null),
|
||||||
|
(NULL, -4.50, 2, 6, '2016-04-20', 'WebPack', null),
|
||||||
(NULL, -12.90, 2, 6, '2016-04-16', 'Host Europe', null);
|
(NULL, -12.90, 2, 6, '2016-04-16', 'Host Europe', null);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get recent transactions
|
// get recent transactions
|
||||||
var transactions = $resource('http://localhost:8080/transactions/search/forAccount', { accountId: $scope.account.id, size: $scope.pageSize, sort: 'date,desc' }).get();
|
var transactions = $resource('/transactions/search/forAccount', { accountId: $scope.account.id, size: $scope.pageSize, sort: 'date,desc' }).get();
|
||||||
transactions.$promise.then(function(data) {
|
transactions.$promise.then(function(data) {
|
||||||
$scope.transactions = transactions._embedded.transactions;
|
$scope.transactions = transactions._embedded.transactions;
|
||||||
$scope.nextPageAvailable = (transactions.page.totalPages !== transactions.page.number + 1);
|
$scope.nextPageAvailable = (transactions.page.totalPages !== transactions.page.number + 1);
|
||||||
@@ -172,7 +172,7 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
|||||||
$scope.moreTransactions = function() {
|
$scope.moreTransactions = function() {
|
||||||
if ($scope.nextPageAvailable) {
|
if ($scope.nextPageAvailable) {
|
||||||
$scope.pageNumber++;
|
$scope.pageNumber++;
|
||||||
var transactions = $resource('http://localhost:8080/transactions/search/forAccount', { accountId: $scope.account.id, size: $scope.pageSize, sort: 'date,desc', page: $scope.pageNumber }).get();
|
var transactions = $resource('/transactions/search/forAccount', { accountId: $scope.account.id, size: $scope.pageSize, sort: 'date,desc', page: $scope.pageNumber }).get();
|
||||||
transactions.$promise.then(function(data) {
|
transactions.$promise.then(function(data) {
|
||||||
for (i = 0; i < transactions._embedded.transactions.length; i++) {
|
for (i = 0; i < transactions._embedded.transactions.length; i++) {
|
||||||
transactions._embedded.transactions[i].amount = numberToAmount(transactions._embedded.transactions[i].amount);
|
transactions._embedded.transactions[i].amount = numberToAmount(transactions._embedded.transactions[i].amount);
|
||||||
@@ -187,7 +187,7 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.updateSuggestions = function(val) {
|
$scope.updateSuggestions = function(val) {
|
||||||
var suggestions = $resource('http://localhost:8080/transactions/search/descriptions', { accountId: $scope.account.id, prefix: val.toLowerCase() }).get();
|
var suggestions = $resource('/transactions/search/descriptions', { accountId: $scope.account.id, prefix: val.toLowerCase() }).get();
|
||||||
return suggestions.$promise.then(function(data) {
|
return suggestions.$promise.then(function(data) {
|
||||||
var newSuggestions = new Array(suggestions._embedded.transactions.length);
|
var newSuggestions = new Array(suggestions._embedded.transactions.length);
|
||||||
for (i = 0; i < suggestions._embedded.transactions.length; i++) {
|
for (i = 0; i < suggestions._embedded.transactions.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user