Browse Source

Added Stream service for displaying streaming images

tags/2.0.3
Teknikode 4 years ago
parent
commit
14a5765b9e

+ 1
- 0
.gitignore View File

@@ -193,3 +193,4 @@ ModelManifest.xml
/.vs/config/applicationhost.config
/Teknik/TransformWebConfig/assist/Web.config
/Teknik/Properties/PublishProfiles/IIS.pubxml
/Teknik/App_Data/ConnectionStrings.config

+ 21
- 0
Teknik/Areas/Stream/Controllers/StreamController.cs View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Teknik.Areas.Stream.ViewModels;
using Teknik.Controllers;

namespace Teknik.Areas.Stream.Controllers
{
public class StreamController : DefaultController
{
[AllowAnonymous]
public ActionResult Index()
{
ViewBag.Title = "Teknikam";
StreamViewModel model = new StreamViewModel();
return View(model);
}
}
}

+ 27
- 0
Teknik/Areas/Stream/StreamAreaRegistration.cs View File

@@ -0,0 +1,27 @@
using System.Collections.Generic;
using System.Web.Mvc;

namespace Teknik.Areas.Stream
{
public class StreamAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Stream";
}
}

public override void RegisterArea(AreaRegistrationContext context)
{
context.MapSubdomainRoute(
"Stream.Index", // Route name
new List<string>() { "dev", "stream" }, // Subdomains
"", // URL with parameters
new { controller = "Stream", action = "Index" }, // Parameter defaults
new[] { typeof(Controllers.StreamController).Namespace }
);
}
}
}

+ 13
- 0
Teknik/Areas/Stream/ViewModels/StreamViewModel.cs View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Teknik.ViewModels;

namespace Teknik.Areas.Stream.ViewModels
{
public class StreamViewModel : ViewModelBase
{
}
}

+ 24
- 0
Teknik/Areas/Stream/Views/Stream/Index.cshtml View File

@@ -0,0 +1,24 @@
@model Teknik.Areas.Stream.ViewModels.StreamViewModel

<div class="container">
@if (Model.Config.StreamConfig.Enabled)
{
foreach (string src in Model.Config.StreamConfig.Sources)
{
<div class="row">
<div class="col-ms-12">
<div class="thumbnail" width="330" height="250">
<img src="@src">
</div>
</div>
</div>
}
}
else
{
<div class="row">
<div class="col-ms-12">Streams are currently disabled.</div>
</div>
}
</div>


+ 3
- 0
Teknik/Areas/Stream/Views/_ViewStart.cshtml View File

@@ -0,0 +1,3 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}

+ 36
- 0
Teknik/Areas/Stream/Views/web.config View File

@@ -0,0 +1,36 @@
<?xml version="1.0"?>

<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>

<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.Optimization" />
<add namespace="Teknik" />
</namespaces>
</pages>
</system.web.webPages.razor>

<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>

<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>

+ 5
- 0
Teknik/Configuration/Config.cs View File

@@ -30,6 +30,7 @@ namespace Teknik.Configuration
private BlogConfig _BlogConfig;
private ApiConfig _ApiConfig;
private PodcastConfig _PodcastConfig;
private StreamConfig _StreamConfig;
private DatabaseConfig _DatabaseConfig;

public bool DevEnvironment { get { return _DevEnvironment; } set { _DevEnvironment = value; } }
@@ -71,6 +72,9 @@ namespace Teknik.Configuration
// Podcast Configuration
public PodcastConfig PodcastConfig { get { return _PodcastConfig; } set { _PodcastConfig = value; } }

// Stream Configuration
public StreamConfig StreamConfig { get { return _StreamConfig; } set { _StreamConfig = value; } }

// Database Configuration
public DatabaseConfig DatabaseConfig { get { return _DatabaseConfig; } set { _DatabaseConfig = value; } }

@@ -104,6 +108,7 @@ namespace Teknik.Configuration
PasteConfig = new PasteConfig();
ApiConfig = new ApiConfig();
PodcastConfig = new PodcastConfig();
StreamConfig = new StreamConfig();
DatabaseConfig = new DatabaseConfig();
}


+ 21
- 0
Teknik/Configuration/StreamConfig.cs View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Teknik.Configuration
{
public class StreamConfig
{
public bool Enabled { get; set; }

public List<string> Sources { get; set; }

public StreamConfig()
{
Enabled = true;
Sources = new List<string>();
}
}
}

+ 9
- 1
Teknik/Teknik.csproj View File

@@ -206,6 +206,9 @@
<Compile Include="Areas\Profile\ViewModels\SettingsViewModel.cs" />
<Compile Include="Areas\RSS\Controllers\RSSController.cs" />
<Compile Include="Areas\RSS\RSSAreaRegistration.cs" />
<Compile Include="Areas\Stream\Controllers\StreamController.cs" />
<Compile Include="Areas\Stream\StreamAreaRegistration.cs" />
<Compile Include="Areas\Stream\ViewModels\StreamViewModel.cs" />
<Compile Include="Areas\Transparency\Controllers\TransparencyController.cs" />
<Compile Include="Areas\Transparency\Models\Bill.cs" />
<Compile Include="Areas\Transparency\Models\Donation.cs" />
@@ -222,6 +225,7 @@
<Compile Include="Areas\Upload\ViewModels\DeleteViewModel.cs" />
<Compile Include="Areas\Upload\ViewModels\DownloadViewModel.cs" />
<Compile Include="Areas\Upload\ViewModels\UploadViewModel.cs" />
<Compile Include="Configuration\StreamConfig.cs" />
<Compile Include="Configuration\ApiConfig.cs" />
<Compile Include="Configuration\DatabaseConfig.cs" />
<Compile Include="Configuration\EmailConfig.cs" />
@@ -381,7 +385,7 @@
<Content Include="Global.asax" />
<Content Include="Content\common.css" />
<Content Include="Images\Icon.png" />
<Content Include="ConnectionStrings.config" />
<Content Include="App_Data\ConnectionStrings.config" />
<Content Include="Areas\Blog\Views\web.config" />
<Content Include="Areas\Blog\Views\Blog\Blog.cshtml" />
<Content Include="Areas\Dev\Views\web.config" />
@@ -467,6 +471,9 @@
<Content Include="Areas\Transparency\Views\_ViewStart.cshtml" />
<Content Include="Areas\Transparency\Views\Transparency\Index.cshtml" />
<Content Include="Areas\Help\Views\Help\RSS.cshtml" />
<Content Include="Areas\Stream\Views\web.config" />
<Content Include="Areas\Stream\Views\_ViewStart.cshtml" />
<Content Include="Areas\Stream\Views\Stream\Index.cshtml" />
<None Include="Properties\PublishProfiles\Teknik Dev.pubxml" />
<None Include="Properties\PublishProfiles\Teknik Production.pubxml" />
<None Include="Scripts\jquery-2.1.4.intellisense.js" />
@@ -557,6 +564,7 @@
<Folder Include="Areas\Privacy\Models\" />
<Folder Include="Areas\Privacy\Views\Shared\" />
<Folder Include="Areas\Profile\Views\Shared\" />
<Folder Include="Areas\Stream\Views\Shared\" />
<Folder Include="Areas\Transparency\Views\Shared\" />
<Folder Include="Areas\Upload\Views\Shared\" />
</ItemGroup>

+ 1
- 1
Teknik/Web.config View File

@@ -7,7 +7,7 @@
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings configSource="ConnectionStrings.config" />
<connectionStrings configSource="App_Data\ConnectionStrings.config" />
<!-- Create ConnectionStrings.config and add your connection string-->
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />

Loading…
Cancel
Save