This commit is contained in:
Manuel Hude 2021-05-04 20:22:23 +02:00
commit f42fbfcb59
8 changed files with 13 additions and 12 deletions

View File

@ -53,7 +53,7 @@ export class EditierenComponent implements OnInit {
} }
public loadFeed(id) { public loadFeed(id) {
this.http.get('http://' + environment.location + ':' + environment.port + '/feeds/' + id + '/').subscribe( this.http.get('http://' + environment.location + ':' + environment.port_be + '/feeds/' + id + '/').subscribe(
(data: any) => { (data: any) => {
this.url = data.url; this.url = data.url;
this.active = data.active; this.active = data.active;
@ -86,7 +86,7 @@ export class EditierenComponent implements OnInit {
form.append('icon', feedData.icon._files['0']); form.append('icon', feedData.icon._files['0']);
} }
if (this.id == null) { if (this.id == null) {
this.http.post('http://' + environment.location + ':' + environment.port + '/feeds/', form).subscribe( this.http.post('http://' + environment.location + ':' + environment.port_be + '/feeds/', form).subscribe(
() => { () => {
this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000}); this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000});
}, },
@ -97,7 +97,7 @@ export class EditierenComponent implements OnInit {
} }
); );
} else { } else {
this.http.put('http://' + environment.location + ':' + environment.port + '/feeds/' + this.id + '/', form).subscribe( this.http.put('http://' + environment.location + ':' + environment.port_be + '/feeds/' + this.id + '/', form).subscribe(
() => { () => {
this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000}); this._snackbar.open('Feed erfolgreich gespeichert!', 'Schließen', {duration: 3000});
}, },

View File

@ -35,7 +35,7 @@ export class EinstellungenComponent implements OnInit {
} }
deleteFeed(id: number) { deleteFeed(id: number) {
this.http.delete('http://' + environment.location + ':' + environment.port + '/feeds/' + id + '/').subscribe( this.http.delete('http://' + environment.location + ':' + environment.port_be + '/feeds/' + id + '/').subscribe(
() => { () => {
this._snackbar.open('Feed erfolgreich gelöscht!', 'Schließen', {duration: 3000}); this._snackbar.open('Feed erfolgreich gelöscht!', 'Schließen', {duration: 3000});
this.feeds = this.feeds.filter(feed => feed.id !== id); this.feeds = this.feeds.filter(feed => feed.id !== id);

View File

@ -62,7 +62,7 @@ export class LoginComponent implements OnInit {
'client_id=waecm' + 'client_id=waecm' +
'&response_type=id_token' + '&response_type=id_token' +
'&prompt=consent' + '&prompt=consent' +
'&redirect_uri=http://' + environment.location + ':' + environment.port + '&redirect_uri=http://' + environment.location + ':' + environment.port_fe +
'&scope=openid%20profile' + '&scope=openid%20profile' +
'&nonce=' + nonce; '&nonce=' + nonce;
window.location.replace(url); window.location.replace(url);

View File

@ -53,7 +53,7 @@ export class TweetsComponent implements OnInit {
console.log(this.tweets); console.log(this.tweets);
this.http.get<Tweet[]>( this.http.get<Tweet[]>(
'http://' + environment.location + ':' + environment.port + '/getMoreTweets/' + this.tweets[this.tweets.length - 1].tweet_id + '/' 'http://' + environment.location + ':' + environment.port_be + '/getMoreTweets/' + this.tweets[this.tweets.length - 1].tweet_id + '/'
).subscribe(data => { ).subscribe(data => {
console.log(data); console.log(data);
@ -78,7 +78,7 @@ export class TweetsComponent implements OnInit {
fillTweets() { fillTweets() {
this.http.get<Tweet[]>('http://' + environment.location + ':' + environment.port + '/getSixTweets/').subscribe(data => { this.http.get<Tweet[]>('http://' + environment.location + ':' + environment.port_be + '/getSixTweets/').subscribe(data => {
console.log(data); console.log(data);
for (const tweet of data) { for (const tweet of data) {
const position = tweet.text.search(': http'); const position = tweet.text.search(': http');

View File

@ -9,7 +9,7 @@ import {environment} from '../../environments/environment';
providedIn: 'root' providedIn: 'root'
}) })
export class FeedService { export class FeedService {
private url = 'http://' + environment.location + ':' + environment.port + '/feeds/'; private url = 'http://' + environment.location + ':' + environment.port_be + '/feeds/';
constructor(private http: HttpClient) {} constructor(private http: HttpClient) {}

View File

@ -6,7 +6,7 @@ import {Observable} from 'rxjs';
@Injectable() @Injectable()
export class RestService { export class RestService {
private currentLocation = 'http://' + environment.location + ':' + environment.port + '/'; private currentLocation = 'http://' + environment.location + ':' + environment.port_be + '/';
constructor( constructor(
private logger: NGXLogger, private logger: NGXLogger,

View File

@ -3,11 +3,11 @@ import {Injectable} from '@angular/core';
import {NGXLogger} from 'ngx-logger'; import {NGXLogger} from 'ngx-logger';
import {environment} from '../../environments/environment'; import {environment} from '../../environments/environment';
import {Observable} from 'rxjs'; import {Observable} from 'rxjs';
import {Tweet} from "../interfaces/interface"; import {Tweet} from '../interfaces/interface';
@Injectable() @Injectable()
export class TwitterService { export class TwitterService {
private currentLocation = 'http://' + environment.location + ':' + environment.port + '/'; private currentLocation = 'http://' + environment.location + ':' + environment.port_be + '/';
constructor( constructor(
private logger: NGXLogger, private logger: NGXLogger,

View File

@ -5,7 +5,8 @@ export const environment = {
openid_endpoint: 'https://waecm-sso.inso.tuwien.ac.at/auth/realms/waecm/protocol/openid-connect', openid_endpoint: 'https://waecm-sso.inso.tuwien.ac.at/auth/realms/waecm/protocol/openid-connect',
production: true, production: true,
location: window.location.hostname, location: window.location.hostname,
port: 8000, port_be: 8000,
port_fe: 4200,
log_level: NgxLoggerLevel.WARN, log_level: NgxLoggerLevel.WARN,
}; };