mirror of https://github.com/Ombi-app/Ombi
parent
15fe04d4a6
commit
c222f1a945
@ -1,9 +1,12 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace Ombi.Api.Plex.Models
|
namespace Ombi.Api.Plex.Models
|
||||||
{
|
{
|
||||||
public class PlexWatchlistContainer
|
public class PlexWatchlistContainer
|
||||||
{
|
{
|
||||||
public PlexWatchlist MediaContainer { get; set; }
|
public PlexWatchlist MediaContainer { get; set; }
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool AuthError { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,13 @@
|
|||||||
|
@import "~styles/shared.scss";
|
||||||
|
.small-middle-container {
|
||||||
|
margin: auto;
|
||||||
|
width: 95%;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.fieldset {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.key {
|
||||||
|
width: 40px;
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
// also exported from '@storybook/angular' if you can deal with breaking changes in 6.1
|
||||||
|
import { APP_BASE_HREF, CommonModule } from '@angular/common';
|
||||||
|
import { Story, Meta, moduleMetadata } from '@storybook/angular';
|
||||||
|
import { Observable, of } from 'rxjs';
|
||||||
|
import { IPlexWatchlistUsers, WatchlistSyncStatus } from '../../../../interfaces';
|
||||||
|
import { PlexService } from '../../../../services';
|
||||||
|
import { SharedModule } from '../../../../shared/shared.module';
|
||||||
|
import { PlexWatchlistComponent } from './plex-watchlist.component';
|
||||||
|
|
||||||
|
|
||||||
|
const mockUsers: IPlexWatchlistUsers[] =
|
||||||
|
[
|
||||||
|
{
|
||||||
|
userName: "Success User",
|
||||||
|
userId: "a",
|
||||||
|
syncStatus: WatchlistSyncStatus.Successful
|
||||||
|
},
|
||||||
|
{
|
||||||
|
userName: "Failed User",
|
||||||
|
userId: "2",
|
||||||
|
syncStatus: WatchlistSyncStatus.Failed
|
||||||
|
},
|
||||||
|
{
|
||||||
|
userName: "Not Enabled",
|
||||||
|
userId: "2",
|
||||||
|
syncStatus: WatchlistSyncStatus.NotEnabled
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
function plexServiveMock(): Partial<PlexService> {
|
||||||
|
return {
|
||||||
|
getWatchlistUsers: () : Observable<IPlexWatchlistUsers[]> => of(mockUsers),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// More on default export: https://storybook.js.org/docs/angular/writing-stories/introduction#default-export
|
||||||
|
export default {
|
||||||
|
title: 'Plex Watchlist Component',
|
||||||
|
component: PlexWatchlistComponent,
|
||||||
|
decorators: [
|
||||||
|
moduleMetadata({
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: APP_BASE_HREF,
|
||||||
|
useValue: ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provide: PlexService,
|
||||||
|
useValue: plexServiveMock()
|
||||||
|
}
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
SharedModule
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
} as Meta;
|
||||||
|
|
||||||
|
// More on component templates: https://storybook.js.org/docs/angular/writing-stories/introduction#using-args
|
||||||
|
const Template: Story<PlexWatchlistComponent> = (args: PlexWatchlistComponent) => ({
|
||||||
|
props: args,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const Default = Template.bind({});
|
||||||
|
Default.args = {
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,25 @@
|
|||||||
|
import { Component, OnInit } from "@angular/core";
|
||||||
|
import { MatTableDataSource } from "@angular/material/table";
|
||||||
|
import { take } from "rxjs";
|
||||||
|
import { IPlexWatchlistUsers, WatchlistSyncStatus } from "../../../../interfaces";
|
||||||
|
import { PlexService } from "../../../../services";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: "./plex-watchlist.component.html",
|
||||||
|
styleUrls: ["./plex-watchlist.component.scss"]
|
||||||
|
})
|
||||||
|
export class PlexWatchlistComponent implements OnInit{
|
||||||
|
|
||||||
|
public dataSource: MatTableDataSource<IPlexWatchlistUsers> = new MatTableDataSource();
|
||||||
|
public displayedColumns: string[] = ['userName','syncStatus'];
|
||||||
|
|
||||||
|
public WatchlistSyncStatus = WatchlistSyncStatus;
|
||||||
|
|
||||||
|
constructor(private plexService: PlexService) { }
|
||||||
|
|
||||||
|
public ngOnInit() {
|
||||||
|
this.plexService.getWatchlistUsers().pipe(take(1)).subscribe((x: IPlexWatchlistUsers[]) => {
|
||||||
|
this.dataSource = new MatTableDataSource(x);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"OmbiDatabase": {
|
||||||
|
"Type": "MySQL",
|
||||||
|
"ConnectionString": "Server=192.168.68.118;Port=3306;Database=Ombi;User=ombi;"
|
||||||
|
},
|
||||||
|
"SettingsDatabase": {
|
||||||
|
"Type": "MySQL",
|
||||||
|
"ConnectionString": "Server=192.168.68.118;Port=3306;Database=Ombi;User=ombi;"
|
||||||
|
},
|
||||||
|
"ExternalDatabase": {
|
||||||
|
"Type": "MySQL",
|
||||||
|
"ConnectionString": "Server=192.168.68.118;Port=3306;Database=Ombi;User=ombi;"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue