mirror of
https://github.com/fergalmoran/podnoms.git
synced 2026-01-06 16:45:20 +00:00
Player (almost) working
This commit is contained in:
@@ -23,13 +23,15 @@
|
||||
"styles": [
|
||||
"../node_modules/font-awesome/css/font-awesome.css",
|
||||
"../node_modules/simple-line-icons/css/simple-line-icons.css",
|
||||
"../node_modules/jplayer/dist/skin/blue.monday/css/jplayer.blue.monday.css",
|
||||
"styles.css"
|
||||
],
|
||||
"scripts": [
|
||||
"../node_modules/jquery/dist/jquery.js",
|
||||
"../node_modules/tether/dist/js/tether.js",
|
||||
"../node_modules/popper.js/dist/umd/popper.min.js",
|
||||
"../node_modules/bootstrap/dist/js/bootstrap.js"
|
||||
"../node_modules/bootstrap/dist/js/bootstrap.js",
|
||||
"../node_modules/howler/dist/howler.js"
|
||||
],
|
||||
"environmentSource": "environments/environment.ts",
|
||||
"environments": {
|
||||
|
||||
@@ -1,77 +1,78 @@
|
||||
{
|
||||
"name": "pod-noms.web",
|
||||
"version": "0.20.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve --aot",
|
||||
"build": "ng build",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint"
|
||||
},
|
||||
"ngrxGen": {
|
||||
"basePath": "./src/app",
|
||||
"seperateDirectory": true
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^5.2.7",
|
||||
"@angular/common": "^5.2.7",
|
||||
"@angular/compiler": "^5.2.7",
|
||||
"@angular/core": "^5.2.7",
|
||||
"@angular/forms": "^5.2.7",
|
||||
"@angular/http": "^5.2.7",
|
||||
"@angular/platform-browser": "^5.2.7",
|
||||
"@angular/platform-browser-dynamic": "^5.2.7",
|
||||
"@angular/router": "^5.2.7",
|
||||
"@aspnet/signalr": "^1.0.0-preview3-30392",
|
||||
"@ngrx/effects": "^5.1.0",
|
||||
"@ngrx/store": "^5.1.0",
|
||||
"@ngrx/store-devtools": "^5.1.0",
|
||||
"@qontu/ngx-inline-editor": "^0.2.0-alpha.12",
|
||||
"angular2-jwt": "^0.2.3",
|
||||
"angular2-moment": "^1.8.0",
|
||||
"angularfire2": "^5.0.0-rc.6",
|
||||
"applicationinsights-js": "^1.0.15",
|
||||
"auth0": "^2.9.1",
|
||||
"auth0-lock": "^11.4.0",
|
||||
"bootstrap": "4.0.0",
|
||||
"core-js": "^2.5.3",
|
||||
"dropzone": "^5.3.0",
|
||||
"firebase": "^4.12.0",
|
||||
"font-awesome": "^4.7.0",
|
||||
"jquery": "^3.3.1",
|
||||
"lodash": "^4.17.5",
|
||||
"ng2-toasty": "^4.0.3",
|
||||
"ngx-bootstrap": "^2.0.3",
|
||||
"ngx-clipboard": "^10.0.0",
|
||||
"popper.js": "^1.13.0",
|
||||
"rxjs": "5.5.6",
|
||||
"simple-line-icons": "^2.4.1",
|
||||
"tether": "^1.4.3",
|
||||
"uglify-es": "^3.3.10",
|
||||
"yarn": "^1.5.1",
|
||||
"zone.js": "^0.8.20"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/cli": "1.6.8",
|
||||
"@angular/compiler-cli": "^5.2.6",
|
||||
"@angular/language-service": "^5.2.6",
|
||||
"@types/applicationinsights-js": "^1.0.5",
|
||||
"@types/jasmine": "^2.8.6",
|
||||
"@types/node": "~9.4.6",
|
||||
"codelyzer": "^4.2.1",
|
||||
"jasmine-core": "~2.99.1",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"karma": "~2.0.0",
|
||||
"karma-chrome-launcher": "~2.2.0",
|
||||
"karma-cli": "~1.0.1",
|
||||
"karma-coverage-istanbul-reporter": "^1.4.1",
|
||||
"karma-jasmine": "^1.1.1",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"protractor": "~5.3.0",
|
||||
"ts-node": "^5.0.1",
|
||||
"tslint": "~5.9.1",
|
||||
"typescript": "~2.5.3"
|
||||
}
|
||||
"name": "pod-noms.web",
|
||||
"version": "0.20.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve --aot",
|
||||
"build": "ng build",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint"
|
||||
},
|
||||
"ngrxGen": {
|
||||
"basePath": "./src/app",
|
||||
"seperateDirectory": true
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^5.2.7",
|
||||
"@angular/common": "^5.2.7",
|
||||
"@angular/compiler": "^5.2.7",
|
||||
"@angular/core": "^5.2.7",
|
||||
"@angular/forms": "^5.2.7",
|
||||
"@angular/http": "^5.2.7",
|
||||
"@angular/platform-browser": "^5.2.7",
|
||||
"@angular/platform-browser-dynamic": "^5.2.7",
|
||||
"@angular/router": "^5.2.7",
|
||||
"@aspnet/signalr": "^1.0.0-preview3-30392",
|
||||
"@ngrx/effects": "^5.1.0",
|
||||
"@ngrx/store": "^5.1.0",
|
||||
"@ngrx/store-devtools": "^5.1.0",
|
||||
"@qontu/ngx-inline-editor": "^0.2.0-alpha.12",
|
||||
"angular2-jwt": "^0.2.3",
|
||||
"angular2-moment": "^1.8.0",
|
||||
"angularfire2": "^5.0.0-rc.6",
|
||||
"applicationinsights-js": "^1.0.15",
|
||||
"auth0": "^2.9.1",
|
||||
"auth0-lock": "^11.4.0",
|
||||
"bootstrap": "4.0.0",
|
||||
"core-js": "^2.5.3",
|
||||
"dropzone": "^5.3.0",
|
||||
"firebase": "^4.12.0",
|
||||
"font-awesome": "^4.7.0",
|
||||
"jquery": "^3.3.1",
|
||||
"lodash": "^4.17.5",
|
||||
"ng2-toasty": "^4.0.3",
|
||||
"ngx-bootstrap": "^2.0.3",
|
||||
"ngx-clipboard": "^10.0.0",
|
||||
"ngx-moment": "^2.0.0-rc.0",
|
||||
"popper.js": "^1.13.0",
|
||||
"rxjs": "5.5.6",
|
||||
"simple-line-icons": "^2.4.1",
|
||||
"tether": "^1.4.3",
|
||||
"uglify-es": "^3.3.10",
|
||||
"yarn": "^1.5.1",
|
||||
"zone.js": "^0.8.20"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/cli": "1.6.8",
|
||||
"@angular/compiler-cli": "^5.2.6",
|
||||
"@angular/language-service": "^5.2.6",
|
||||
"@types/applicationinsights-js": "^1.0.5",
|
||||
"@types/jasmine": "^2.8.6",
|
||||
"@types/node": "~9.4.6",
|
||||
"codelyzer": "^4.2.1",
|
||||
"jasmine-core": "~2.99.1",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"karma": "~2.0.0",
|
||||
"karma-chrome-launcher": "~2.2.0",
|
||||
"karma-cli": "~1.0.1",
|
||||
"karma-coverage-istanbul-reporter": "^1.4.1",
|
||||
"karma-jasmine": "^1.1.1",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"protractor": "~5.3.0",
|
||||
"ts-node": "^5.0.1",
|
||||
"tslint": "~5.9.1",
|
||||
"typescript": "~2.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,11 +41,6 @@ export class AppComponent implements OnInit {
|
||||
this._signalrService
|
||||
.init('chatter')
|
||||
.then(r => {
|
||||
console.log(
|
||||
'app.component',
|
||||
'Chatter Service ready to rock',
|
||||
r
|
||||
);
|
||||
this._signalrService.connection.on(
|
||||
chatterChannel,
|
||||
result => {
|
||||
|
||||
@@ -58,6 +58,9 @@ import { AppInsightsService } from 'app/services/app-insights.service';
|
||||
import { MessagingService } from './services/messaging.service';
|
||||
|
||||
import { environment } from 'environments/environment';
|
||||
import { FooterPlayerComponent } from 'app/components/footer-player/footer-player.component';
|
||||
import { AudioService } from 'app/services/audio.service';
|
||||
import { HumaniseTimePipe } from './pipes/humanise-time.pipe';
|
||||
|
||||
export function authHttpServiceFactory(http: Http, options: RequestOptions) {
|
||||
return new AuthHttp(
|
||||
@@ -93,7 +96,9 @@ export function authHttpServiceFactory(http: Http, options: RequestOptions) {
|
||||
ResetComponent,
|
||||
ProfileComponent,
|
||||
AboutComponent,
|
||||
FooterComponent
|
||||
FooterComponent,
|
||||
FooterPlayerComponent,
|
||||
HumaniseTimePipe
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
@@ -148,6 +153,7 @@ export function authHttpServiceFactory(http: Http, options: RequestOptions) {
|
||||
ChatterService,
|
||||
AppInsightsService,
|
||||
JobsService,
|
||||
AudioService,
|
||||
GlobalsService
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
|
||||
@@ -18,7 +18,6 @@ export class DebugComponent implements OnInit {
|
||||
|
||||
debugInfo$: Observable<string>;
|
||||
apiHost = environment.API_HOST;
|
||||
signalrHost = environment.SIGNALR_HOST;
|
||||
pingPong = '';
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
body {
|
||||
margin-bottom: 60px; /* Margin bottom by footer height */
|
||||
margin-bottom: 90px; /* Margin bottom by footer height */
|
||||
}
|
||||
.footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 60px; /* Set the fixed height of the footer here */
|
||||
line-height: 60px; /* Vertically center the text there */
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<!-- <div class="float-right">
|
||||
<share-button button="twitter" text="Tweet"></share-button>
|
||||
<share-button button="facebook" text="Share"></share-button>
|
||||
</div> -->
|
||||
<div class="float-left">
|
||||
Crafted with <i class="fa fa-heart text-pulse"></i> by
|
||||
<a class="font-w600"
|
||||
href="http://github.com/fergalmoran/podnoms"
|
||||
target="_blank">podnoms</a>
|
||||
</div>
|
||||
<div class="foooter-player-wrapper" *ngIf="showPlayer">
|
||||
<app-footer-player></app-footer-player>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AudioService } from 'app/services/audio.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-footer',
|
||||
templateUrl: './footer.component.html',
|
||||
styleUrls: ['./footer.component.css']
|
||||
selector: 'app-footer',
|
||||
templateUrl: './footer.component.html',
|
||||
styleUrls: ['./footer.component.css']
|
||||
})
|
||||
export class FooterComponent implements OnInit {
|
||||
showPlayer: boolean = false;
|
||||
constructor(private _audioService: AudioService) {}
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log('footer.component', 'ngOnInit');
|
||||
this._audioService.playStateChanged.subscribe((s) => {
|
||||
this.showPlayer = s != 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,99 +1,72 @@
|
||||
<td class="text-center"
|
||||
(click)="goto(entry)">
|
||||
<td class="text-center" (click)="goto(entry)">
|
||||
<div *ngIf="entry.processingStatus === 'Accepted'">
|
||||
<i class="fa fa-cog fa-spin fa-3x fa-fw"></i>
|
||||
</div>
|
||||
<div class="avatar"
|
||||
*ngIf="entry.processingStatus !== 'Accepted'">
|
||||
<img [src]="entry.imageUrl"
|
||||
class="img-avatar img-avatar48"
|
||||
alt="">
|
||||
<div class="avatar" *ngIf="entry.processingStatus !== 'Accepted'">
|
||||
<img [src]="entry.imageUrl" class="img-avatar img-avatar48" alt="">
|
||||
<span class="avatar-status badge-success"></span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<p class="font-w600 mb-10">
|
||||
<inline-editor type="text"
|
||||
[(ngModel)]="entry.title"
|
||||
(onSave)="updateTitle($event)"
|
||||
name="title"
|
||||
size="32"></inline-editor>
|
||||
<inline-editor type="text" [(ngModel)]="entry.title" (onSave)="updateTitle($event)" name="title" size="32"></inline-editor>
|
||||
</p>
|
||||
<p class="font-w600 mb-0"
|
||||
[ngClass]="entry.processingStatus==='Failed' ? 'text-danger' : 'text-muted'">
|
||||
<p class="font-w600 mb-0" [ngClass]="entry.processingStatus==='Failed' ? 'text-danger' : 'text-muted'">
|
||||
<span>{{entry.processingStatus}}</span>| {{entry.createDate | amTimeAgo}}
|
||||
</p>
|
||||
</td>
|
||||
<td class="d-none d-sm-table-cell">
|
||||
<em class="text-muted">
|
||||
<span *ngIf="entry.processingStatus === 'Accepted'"
|
||||
style="width: 100%">
|
||||
<i class="fa fa-cog fa-spin fa-3x fa-fw"></i>
|
||||
</span>
|
||||
<span *ngIf="entry.processingStatus === 'Failed'">
|
||||
<button class="btn btn-hero btn-lg btn-outline-success text-uppercase mb-10"
|
||||
(click)="retry(entry)">Retry</button>
|
||||
</span>
|
||||
<span *ngIf="entry.processingStatus!=='Processed' && entry.processingStatus !== 'Accepted' && entry.processingStatus !== 'Failed'"
|
||||
style="width: 100%">
|
||||
<div class="clearfix">
|
||||
<div class="float-left">
|
||||
<strong>{{percentageProcessed}}%</strong>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<small class="text-muted">{{entry.processingStatus}}: {{currentSpeed}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="progress progress-xs">
|
||||
<div class="progress-bar bg-success"
|
||||
role="progressbar"
|
||||
[style.width]="percentageProcessed + '%'"
|
||||
[attr.aria-valuenow]="percentageProcessed"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"></div>
|
||||
</div>
|
||||
</span>
|
||||
<span *ngIf="entry.processingStatus==='Processed'"
|
||||
style="width: 100%">
|
||||
<audio controls
|
||||
preload="none">
|
||||
<source src="{{entry.audioUrl}}"
|
||||
type="audio/mpeg" />
|
||||
<a target="_blank"
|
||||
[href]="entry.audioUrl">{{entry.title}}</a>
|
||||
</audio>
|
||||
</span>
|
||||
</em>
|
||||
<span *ngIf="entry.processingStatus === 'Accepted'" style="width: 100%">
|
||||
<i class="fa fa-cog fa-spin fa-3x fa-fw"></i>
|
||||
</span>
|
||||
<span *ngIf="entry.processingStatus === 'Failed'">
|
||||
<button class="btn btn-hero btn-lg btn-outline-success text-uppercase mb-10" (click)="retry(entry)">Retry</button>
|
||||
</span>
|
||||
<span *ngIf="entry.processingStatus!=='Processed' && entry.processingStatus !== 'Accepted' && entry.processingStatus !== 'Failed'"
|
||||
style="width: 100%">
|
||||
<div class="clearfix">
|
||||
<div class="float-left">
|
||||
<strong>{{percentageProcessed}}%</strong>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<small class="text-muted">{{entry.processingStatus}}: {{currentSpeed}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="progress progress-xs">
|
||||
<div class="progress-bar bg-success" role="progressbar" [style.width]="percentageProcessed + '%'" [attr.aria-valuenow]="percentageProcessed"
|
||||
aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
</span>
|
||||
<span *ngIf="entry.processingStatus==='Processed'" style="width: 100%">
|
||||
<audio controls preload="none">
|
||||
<source src="{{entry.audioUrl}}" type="audio/mpeg" />
|
||||
<a target="_blank" [href]="entry.audioUrl">{{entry.title}}</a>
|
||||
</audio>
|
||||
</span>
|
||||
</em>
|
||||
</td>
|
||||
<td class="d-none d-sm-table-cell">
|
||||
<a class="btn btn-outline btn-outline-danger"
|
||||
(click)="entryDeleteDialog.show()"><i class="fa fa-remove"></i></a>
|
||||
<a class="btn btn-outline btn-outline-danger" (click)="playAudio(entry.audioUrl)">
|
||||
<i class="fa" [ngClass]="playing ? 'fa-pause' : 'fa-play'"></i>
|
||||
</a>
|
||||
<a class="btn btn-outline btn-outline-danger" (click)="entryDeleteDialog.show()">
|
||||
<i class="fa fa-remove"></i>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<div class="modal fade"
|
||||
bsModal
|
||||
#entryDeleteDialog="bs-modal"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-hidden="true">
|
||||
<div class="modal fade" bsModal #entryDeleteDialog="bs-modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title pull-left">Delete this podcast entry?</h4>
|
||||
<button type="button"
|
||||
class="close pull-right"
|
||||
aria-label="Close"
|
||||
(click)="entryDeleteDialog.hide()">
|
||||
<button type="button" class="close pull-right" aria-label="Close" (click)="entryDeleteDialog.hide()">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<button type="button"
|
||||
class="btn btn-primary pull-right"
|
||||
(click)="entryDeleteDialog.hide()">No</button>
|
||||
<button type="button"
|
||||
class="btn btn-danger pull-right"
|
||||
(click)="deleteEntry(); entryDeleteDialog.hide()">Yes
|
||||
<button type="button" class="btn btn-primary pull-right" (click)="entryDeleteDialog.hide()">No</button>
|
||||
<button type="button" class="btn btn-danger pull-right" (click)="deleteEntry(); entryDeleteDialog.hide()">Yes
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { ToastyService, ToastData, ToastOptions } from 'ng2-toasty';
|
||||
|
||||
import * as fromEntriesActions from 'app/actions/entries.actions';
|
||||
import { PodcastService } from '../../../services/podcast.service';
|
||||
import { AudioService } from 'app/services/audio.service';
|
||||
|
||||
@Component({
|
||||
selector: '[app-entry-list-item]',
|
||||
@@ -20,9 +21,11 @@ export class EntryListItemComponent implements OnInit {
|
||||
|
||||
percentageProcessed = 0;
|
||||
currentSpeed: string = '';
|
||||
playing: boolean = false;
|
||||
|
||||
constructor(
|
||||
private _signalrService: SignalRService,
|
||||
private _audioService: AudioService,
|
||||
private _entryService: PodcastService,
|
||||
private _store: Store<ApplicationState>,
|
||||
private _toasty: ToastyService
|
||||
@@ -44,14 +47,14 @@ export class EntryListItemComponent implements OnInit {
|
||||
}__info_processed`;
|
||||
this._signalrService.connection.on(
|
||||
updateChannel,
|
||||
result => {
|
||||
(result) => {
|
||||
this.percentageProcessed = result.percentage;
|
||||
this.currentSpeed = result.currentSpeed;
|
||||
}
|
||||
);
|
||||
this._signalrService.connection.on(
|
||||
processedChannel,
|
||||
result => {
|
||||
(result) => {
|
||||
this.entry = result;
|
||||
if (this.entry.processingStatus === 'Processed') {
|
||||
// only update the store when we're finished.
|
||||
@@ -64,7 +67,7 @@ export class EntryListItemComponent implements OnInit {
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(err =>
|
||||
.catch((err) =>
|
||||
console.error(
|
||||
'entry-list-item.component.ts',
|
||||
'_signalrService.init',
|
||||
@@ -85,9 +88,19 @@ export class EntryListItemComponent implements OnInit {
|
||||
window.open(entry.sourceUrl);
|
||||
}
|
||||
retry(entry: PodcastEntryModel) {
|
||||
this._entryService.reSubmitEntry(entry).subscribe(r => {
|
||||
this._entryService.reSubmitEntry(entry).subscribe((r) => {
|
||||
this.entry = r;
|
||||
this._toasty.info('Submitted podcast for re-processing');
|
||||
});
|
||||
}
|
||||
playAudio(source: string) {
|
||||
this._audioService.playStateChanged.subscribe((r) => {
|
||||
this.playing = r == 1;
|
||||
});
|
||||
if (!this.playing) {
|
||||
this._audioService.playAudio(this.entry.audioUrl, this.entry.title);
|
||||
} else {
|
||||
this._audioService.pauseAudio();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
img.sidebar-icon {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin: 0 4px;
|
||||
border-radius: 50em;
|
||||
}
|
||||
#sidebar {
|
||||
margin-bottom: 55px;
|
||||
}
|
||||
img.sidebar-icon {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin: 0 4px;
|
||||
border-radius: 50em;
|
||||
}
|
||||
|
||||
@@ -116,18 +116,15 @@ export class AuthService {
|
||||
}
|
||||
public scheduleRenewal() {
|
||||
if (!this.isAuthenticated()) return;
|
||||
console.log('auth.service.ts', 'scheduleRenewal', 'Schedule required');
|
||||
this.unscheduleRenewal();
|
||||
|
||||
const expiresAt = JSON.parse(window.localStorage.getItem('expires_at'));
|
||||
const source = Observable.of(expiresAt).flatMap(e => {
|
||||
console.log('auth.service.ts', 'scheduleRenewal_expiresAt', `Renewal scheduled at: ${new Date(e)}`);
|
||||
const now = Date.now();
|
||||
return Observable.timer(Math.max(1, e - now));
|
||||
});
|
||||
this.refreshSubscription = source.subscribe(() => {
|
||||
console.log('auth.service.ts', 'scheduleRenewal', 'Starting renewal and schedule');
|
||||
|
||||
this.renewToken();
|
||||
this.scheduleRenewal();
|
||||
});
|
||||
|
||||
@@ -43,12 +43,10 @@ export class MessagingService {
|
||||
this.messaging
|
||||
.requestPermission()
|
||||
.then(() => {
|
||||
console.log('Notification permission granted.');
|
||||
const token = this.messaging.getToken();
|
||||
return token;
|
||||
})
|
||||
.then(token => {
|
||||
console.log(token);
|
||||
this.updateToken(token);
|
||||
})
|
||||
.catch(err => {
|
||||
@@ -58,7 +56,6 @@ export class MessagingService {
|
||||
|
||||
receiveMessage() {
|
||||
this.messaging.onMessage(payload => {
|
||||
console.log('Message received', payload);
|
||||
this.currentMessage.next(payload);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,7 +17,9 @@ export class PushRegistrationService {
|
||||
|
||||
urlBase64ToUint8Array(base64String) {
|
||||
const padding = '='.repeat((4 - base64String.length % 4) % 4);
|
||||
const base64 = (base64String + padding).replace(/\-/g, '+').replace(/_/g, '/');
|
||||
const base64 = (base64String + padding)
|
||||
.replace(/\-/g, '+')
|
||||
.replace(/_/g, '/');
|
||||
const rawData = window.atob(base64);
|
||||
const outputArray = new Uint8Array(rawData.length);
|
||||
for (let i = 0; i < rawData.length; ++i) {
|
||||
@@ -27,27 +29,18 @@ export class PushRegistrationService {
|
||||
}
|
||||
|
||||
addSubscriber(subscription) {
|
||||
console.log('[Push Service] Adding subscriber')
|
||||
const url = `${this.API_URL}/webpush/subscribe`;
|
||||
return this.http
|
||||
.post(url, subscription)
|
||||
.catch(this.handleError);
|
||||
return this.http.post(url, subscription).catch(this.handleError);
|
||||
}
|
||||
|
||||
deleteSubscriber(subscription) {
|
||||
|
||||
const url = `${this.API_URL}/webpush`;
|
||||
console.log('[Push Service] Deleting subscriber')
|
||||
|
||||
let body = {
|
||||
const body = {
|
||||
action: 'unsubscribe',
|
||||
subscription: subscription
|
||||
}
|
||||
|
||||
return this.http
|
||||
.post(url, body)
|
||||
.catch(this.handleError);
|
||||
};
|
||||
|
||||
return this.http.post(url, body).catch(this.handleError);
|
||||
}
|
||||
|
||||
private handleError(error: Response | any) {
|
||||
@@ -59,5 +52,4 @@ export class PushRegistrationService {
|
||||
}
|
||||
return Observable.throw(errMsg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ export class SignalRService {
|
||||
|
||||
constructor(private _auth: AuthService) {}
|
||||
public init(hub: string): Promise<void> {
|
||||
const url = `${environment.SIGNALR_HOST}hubs/${hub}`;
|
||||
const url = `${environment.SIGNALR_HOST}/hubs/${hub}`;
|
||||
|
||||
const token = this._auth.getToken();
|
||||
const options: any = {
|
||||
|
||||
@@ -2,7 +2,7 @@ export const environment = {
|
||||
production: true,
|
||||
// API_HOST: 'https://api.podnoms.com',
|
||||
API_HOST: 'https://api.podnoms.com',
|
||||
SIGNALR_HOST: 'https://rt.podnoms.com/',
|
||||
SIGNALR_HOST: 'https://rt.podnoms.com',
|
||||
AUTH0_REDIRECT_URL: 'https://podnoms.com/callback',
|
||||
BASE_URL: 'https://podnoms.com',
|
||||
appInsights: {
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
|
||||
const ROOT_URL = 'https://api.podnoms.com';
|
||||
// const ROOT_URL = 'https://api.podnoms.com';
|
||||
const ROOT_URL = 'http://localhost:5000';
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
// API_HOST: 'http://localhost:5000',
|
||||
API_HOST: ROOT_URL,
|
||||
SIGNALR_HOST: 'https://api.podnoms.com',
|
||||
AUTH0_REDIRECT_URL: 'http://localhost:4200/callback',
|
||||
SIGNALR_HOST: ROOT_URL,
|
||||
AUTH0_REDIRECT_URL: `${ROOT_URL}/callback`,
|
||||
BASE_URL: 'http://localhost:4200/',
|
||||
appInsights: {
|
||||
instrumentationKey: '020b002a-bd3d-4b25-8a74-cab16fd39dfc'
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<PackageReference Include="Hangfire" Version="1.6.17" />
|
||||
<PackageReference Include="Hangfire.MemoryStorage" Version="1.5.2" />
|
||||
<PackageReference Include="Lib.Net.Http.WebPush" Version="1.3.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-preview1-final" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-preview2-final" />
|
||||
<PackageReference Include="AutoMapper" Version="6.2.2" />
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="3.2.0" />
|
||||
<PackageReference Include="Handlebars.NetStandard" Version="1.8.1" />
|
||||
@@ -26,7 +26,7 @@
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.0-beta0003" />
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="1.1.10-pre20180223200113" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="2.3.0" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0-preview1-26216-02" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0-preview2-26406-04" />
|
||||
<PackageReference Include="WindowsAzure.Storage" Version="8.2.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace PodNoms.Api.Services.Hubs
|
||||
{
|
||||
public class DebugHubLifetimeManager<THub> : DefaultHubLifetimeManager<THub>
|
||||
where THub : Hub
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -184,9 +184,6 @@ namespace PodNoms.Api {
|
||||
services.AddScoped<IAudioUploadProcessService, AudioUploadProcessService>();
|
||||
services.AddScoped<IMailSender, MailgunSender>();
|
||||
|
||||
services.AddSingleton(typeof(HubLifetimeManager<DebugHub>),
|
||||
typeof(DebugHubLifetimeManager<DebugHub>));
|
||||
|
||||
//register the codepages (required for slugify)
|
||||
var instance = CodePagesEncodingProvider.Instance;
|
||||
Encoding.RegisterProvider(instance);
|
||||
|
||||
Reference in New Issue
Block a user