Skip to content

Commit

Permalink
Initial Checkin for the TeamCityMonitor project. this has been create…
Browse files Browse the repository at this point in the history
…d from the Sample application in TeamCitySharp
  • Loading branch information
stack72 committed Jul 5, 2012
0 parents commit f2a964f
Show file tree
Hide file tree
Showing 139 changed files with 84,538 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
obj
bin
deploy
*.csproj.user
*.suo
*ReSharper*
*.orig
*.dotCover
output
*.TeamCityMonitor.sln.metaproj*
*.DotSettings.*
nuget
1 change: 1 addition & 0 deletions License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
License: http://stack72.mit-license.org/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#TeamCityMonitor

Build Monitor based on TeamCitySharp

##License
http://stack72.mit-license.org/
20 changes: 20 additions & 0 deletions TeamCityMonitor.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamCityMonitor", "TeamCityMonitor\TeamCityMonitor.csproj", "{4CF6D742-60E7-481A-BD9C-3B6D5D661B76}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4CF6D742-60E7-481A-BD9C-3B6D5D661B76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CF6D742-60E7-481A-BD9C-3B6D5D661B76}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CF6D742-60E7-481A-BD9C-3B6D5D661B76}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4CF6D742-60E7-481A-BD9C-3B6D5D661B76}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added TeamCityMonitor/App_Data/ApplicationData.sdf
Binary file not shown.
24 changes: 24 additions & 0 deletions TeamCityMonitor/Areas/Admin/AdminAreaRegistration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Web.Mvc;

namespace BuildMonitor.Areas.Admin
{
public class AdminAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Admin";
}
}

public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Admin_default",
"Admin/{controller}/{action}/{id}",
new { Controller="Features", action = "Index", id = UrlParameter.Optional }
);
}
}
}
43 changes: 43 additions & 0 deletions TeamCityMonitor/Areas/Admin/Controllers/FeaturesController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System.Web.Mvc;
using BuildMonitor.Models;
using BuildMonitor.Models.Entities;

namespace BuildMonitor.Areas.Admin.Controllers
{
public class FeaturesController : Controller
{
private readonly FeatureRepository featuresRepo;

public FeaturesController()
{
featuresRepo = new FeatureRepository();
}
//
// GET: /Admin/Features/

public ActionResult Index()
{
var features = featuresRepo.GetAllFeatures();
return View(features);
}

public ActionResult FeatureDetails(int featureId)
{
var feature = featuresRepo.GetFeature(featureId);
return View(feature);
}

public ActionResult AddFeature()
{
return View();
}

[HttpPost]
public ActionResult AddFeature(Feature feature)
{
var successful = featuresRepo.AddFeature(feature);
return View();
}

}
}
7 changes: 7 additions & 0 deletions TeamCityMonitor/Areas/Admin/Views/Features/AddFeature.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@model BuildMonitor.Models.Entities.Feature

@{
ViewBag.Title = "title";
}

<h2>Add New Feature</h2>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@model BuildMonitor.Models.Entities.Feature

@{
ViewBag.Title = "title";
}

<h2>@Model.FeatureName</h2>
24 changes: 24 additions & 0 deletions TeamCityMonitor/Areas/Admin/Views/Features/Index.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@model List<BuildMonitor.Models.Entities.Feature>

@{
ViewBag.Title = "Index";
}

<h2>Index</h2>
<table>
<tr>
<th>Id</th>
<th>Feature Name</th>
<th>Enabled?</th>
</tr>
@foreach (var feature in Model)
{
<tr>
<td>@feature.FeatureSwitchId</td>
<td>@Html.ActionLink(feature.FeatureName, "FeatureDetails", new {featureId = feature.FeatureSwitchId}, null)</td>
<td>@feature.Enabled</td>
</tr>
}
</table>

@Html.ActionLink("Add New Feature", "AddFeature");
58 changes: 58 additions & 0 deletions TeamCityMonitor/Areas/Admin/Views/Web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0"?>

<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.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=3.0.0.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" />
</namespaces>
</pages>
</system.web.webPages.razor>

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

<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>

<!--
Enabling request validation in view pages would cause validation to occur
after the input has already been processed by the controller. By default
MVC performs request validation before a controller processes the input.
To change this behavior apply the ValidateInputAttribute to a
controller or action.
-->
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>

<system.webServer>
<validation validateIntegratedModeConfiguration="false" />

<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>
23 changes: 23 additions & 0 deletions TeamCityMonitor/Attributes/DisableCaching.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace BuildMonitor.Attributes
{
public class DisableCaching : ActionFilterAttribute
{
public override void OnResultExecuting(ResultExecutingContext filterContext)
{
filterContext.HttpContext.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
filterContext.HttpContext.Response.Cache.SetValidUntilExpires(false);
filterContext.HttpContext.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
filterContext.HttpContext.Response.Cache.SetNoStore();

base.OnResultExecuting(filterContext);
}

}
}
Loading

0 comments on commit f2a964f

Please sign in to comment.