mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 10:36:54 -07:00
Started #298
This commit is contained in:
parent
071daf4ab4
commit
0dd30968d5
22 changed files with 8276 additions and 252 deletions
|
@ -55,6 +55,7 @@ using PlexRequests.UI.Helpers;
|
|||
using PlexRequests.UI.Models;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Nancy.Json;
|
||||
using Nancy.Security;
|
||||
|
@ -83,6 +84,7 @@ namespace PlexRequests.UI.Modules
|
|||
private INotificationService NotificationService { get; }
|
||||
private ICacheProvider Cache { get; }
|
||||
private ISettingsService<SlackNotificationSettings> SlackSettings { get; }
|
||||
private ISettingsService<LandingPageSettings> LandingSettings { get; }
|
||||
private ISlackApi SlackApi { get; }
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
@ -105,7 +107,7 @@ namespace PlexRequests.UI.Modules
|
|||
ISettingsService<HeadphonesSettings> headphones,
|
||||
ISettingsService<LogSettings> logs,
|
||||
ICacheProvider cache, ISettingsService<SlackNotificationSettings> slackSettings,
|
||||
ISlackApi slackApi) : base("admin", prService)
|
||||
ISlackApi slackApi, ISettingsService<LandingPageSettings> lp) : base("admin", prService)
|
||||
{
|
||||
PrService = prService;
|
||||
CpService = cpService;
|
||||
|
@ -128,6 +130,7 @@ namespace PlexRequests.UI.Modules
|
|||
Cache = cache;
|
||||
SlackSettings = slackSettings;
|
||||
SlackApi = slackApi;
|
||||
LandingSettings = lp;
|
||||
|
||||
this.RequiresClaims(UserClaims.Admin);
|
||||
|
||||
|
@ -186,6 +189,9 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
Get["/slacknotification"] = _ => SlackNotifications();
|
||||
Post["/slacknotification"] = _ => SaveSlackNotifications();
|
||||
|
||||
Get["/landingpage", true] = async (x,ct) => await LandingPage();
|
||||
Post["/landingpage"] = _ => SaveSlackNotifications();
|
||||
}
|
||||
|
||||
private Negotiator Authentication()
|
||||
|
@ -806,5 +812,12 @@ namespace PlexRequests.UI.Modules
|
|||
? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Slack Notifications!" }
|
||||
: new JsonResponseModel { Result = false, Message = "Could not update the settings, take a look at the logs." });
|
||||
}
|
||||
|
||||
private async Task<Negotiator> LandingPage()
|
||||
{
|
||||
var settings = await LandingSettings.GetSettingsAsync();
|
||||
|
||||
return View["LandingPage", settings];
|
||||
}
|
||||
}
|
||||
}
|
41
PlexRequests.UI/Modules/LandingPageModule.cs
Normal file
41
PlexRequests.UI/Modules/LandingPageModule.cs
Normal file
|
@ -0,0 +1,41 @@
|
|||
#region Copyright
|
||||
// /************************************************************************
|
||||
// Copyright (c) 2016 Jamie Rees
|
||||
// File: LandingPageModule.cs
|
||||
// Created By: Jamie Rees
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ************************************************************************/
|
||||
#endregion
|
||||
using PlexRequests.Core;
|
||||
using PlexRequests.Core.SettingModels;
|
||||
|
||||
namespace PlexRequests.UI.Modules
|
||||
{
|
||||
public class LandingPageModule : BaseModule
|
||||
{
|
||||
public LandingPageModule(ISettingsService<PlexRequestSettings> settingsService, ISettingsService<LandingPageSettings> landing) : base("landing", settingsService)
|
||||
{
|
||||
LandingSettings = landing;
|
||||
}
|
||||
|
||||
private ISettingsService<LandingPageSettings> LandingSettings { get; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue