Browse Source

Added Stream service for displaying streaming images

master
Teknikode 7 years ago
parent
commit
14a5765b9e
  1. 1
      .gitignore
  2. 21
      Teknik/Areas/Stream/Controllers/StreamController.cs
  3. 27
      Teknik/Areas/Stream/StreamAreaRegistration.cs
  4. 13
      Teknik/Areas/Stream/ViewModels/StreamViewModel.cs
  5. 24
      Teknik/Areas/Stream/Views/Stream/Index.cshtml
  6. 3
      Teknik/Areas/Stream/Views/_ViewStart.cshtml
  7. 36
      Teknik/Areas/Stream/Views/web.config
  8. 5
      Teknik/Configuration/Config.cs
  9. 21
      Teknik/Configuration/StreamConfig.cs
  10. 10
      Teknik/Teknik.csproj
  11. 2
      Teknik/Web.config

1
.gitignore vendored

@ -193,3 +193,4 @@ ModelManifest.xml @@ -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
Teknik/Areas/Stream/Controllers/StreamController.cs

@ -0,0 +1,21 @@ @@ -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
Teknik/Areas/Stream/StreamAreaRegistration.cs

@ -0,0 +1,27 @@ @@ -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
Teknik/Areas/Stream/ViewModels/StreamViewModel.cs

@ -0,0 +1,13 @@ @@ -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
Teknik/Areas/Stream/Views/Stream/Index.cshtml

@ -0,0 +1,24 @@ @@ -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
Teknik/Areas/Stream/Views/_ViewStart.cshtml

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

36
Teknik/Areas/Stream/Views/web.config

@ -0,0 +1,36 @@ @@ -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
Teknik/Configuration/Config.cs

@ -30,6 +30,7 @@ namespace Teknik.Configuration @@ -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 @@ -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 @@ -104,6 +108,7 @@ namespace Teknik.Configuration
PasteConfig = new PasteConfig();
ApiConfig = new ApiConfig();
PodcastConfig = new PodcastConfig();
StreamConfig = new StreamConfig();
DatabaseConfig = new DatabaseConfig();
}

21
Teknik/Configuration/StreamConfig.cs

@ -0,0 +1,21 @@ @@ -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>();
}
}
}

10
Teknik/Teknik.csproj

@ -206,6 +206,9 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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>

2
Teknik/Web.config

@ -7,7 +7,7 @@ @@ -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