60 lines
1.5 KiB
C#
60 lines
1.5 KiB
C#
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.IO;
|
||
|
using System.Threading.Tasks;
|
||
|
using Newtonsoft.Json.Converters;
|
||
|
using Tesses.WebServer;
|
||
|
|
||
|
namespace Tesses.CMS
|
||
|
{
|
||
|
public class CMSConfiguration
|
||
|
{
|
||
|
|
||
|
public ushort Port {get;set;}=62444;
|
||
|
|
||
|
public string Title {get;set;}="TessesCMS";
|
||
|
|
||
|
public string Root {get;set;}="/";
|
||
|
[Newtonsoft.Json.JsonConverter(typeof(StringEnumConverter))]
|
||
|
public CMSPublish Publish {get;set;}=CMSPublish.NoRestriction;
|
||
|
public List<CMSNavUrl> Urls { get; set; }=new List<CMSNavUrl>();
|
||
|
public string BrowserTranscode {get;set;}="-vf scale=640:480 -crf 28";
|
||
|
public List<string> BittorrentTrackers {get;set;}=new List<string>();
|
||
|
public CMSNavUrl RelativeNavUrl(string text,string url)
|
||
|
{
|
||
|
return RelativeNavUrl(new CMSNavUrl(text,url));
|
||
|
}
|
||
|
public CMSNavUrl RelativeNavUrl(CMSNavUrl url)
|
||
|
{
|
||
|
return new CMSNavUrl(url.Text,$"{Root.TrimEnd('/')}/{url.Url.TrimStart('/')}");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public class CMSNavUrl
|
||
|
{
|
||
|
public CMSNavUrl() : this("","")
|
||
|
{
|
||
|
|
||
|
}
|
||
|
public CMSNavUrl(string text,string url)
|
||
|
{
|
||
|
Text = text;
|
||
|
Url = url;
|
||
|
}
|
||
|
public string Text {get;set;}
|
||
|
|
||
|
public string Url {get;set;}
|
||
|
|
||
|
public bool Active {get;set;}=false;
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
public enum CMSPublish
|
||
|
{
|
||
|
NoRestriction = 0,
|
||
|
RequireInvite = 1,
|
||
|
|
||
|
Admin = 2
|
||
|
}
|
||
|
}
|