Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Ombi/blame/commit/75dbfef3755a4546895544d8665fb4bbc26d72e9/Ombi.Core/SettingModels/SlackNotificationSettings.cs
You should set ROOT_URL correctly, otherwise the web may not work correctly.
|
|
|
|
using System;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
namespace Ombi.Core.SettingModels
|
|
|
|
|
{
|
|
|
|
|
public sealed class SlackNotificationSettings : NotificationSettings
|
|
|
|
|
{
|
|
|
|
|
public string WebhookUrl { get; set; }
|
|
|
|
|
public string Channel { get; set; }
|
|
|
|
|
public string Username { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public string Team => SplitWebUrl(3);
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public string Service => SplitWebUrl(4);
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public string Token => SplitWebUrl(5);
|
|
|
|
|
|
|
|
|
|
private string SplitWebUrl(int index)
|
|
|
|
|
{
|
|
|
|
|
if (!WebhookUrl.StartsWith("http", StringComparison.InvariantCulture))
|
|
|
|
|
{
|
|
|
|
|
WebhookUrl = "https://" + WebhookUrl;
|
|
|
|
|
}
|
|
|
|
|
var split = WebhookUrl.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
|
|
|
|
|
|
|
|
|
|
return split.Length < index
|
|
|
|
|
? string.Empty
|
|
|
|
|
: split[index];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|