Skip to content

Commit

Permalink
Servers read/edit UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Berzeger committed Jul 14, 2015
1 parent b051bf5 commit 8391d39
Show file tree
Hide file tree
Showing 27 changed files with 454 additions and 211 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<Compile Include="Domain\Deployment\Contracts\IDeploymentUow.cs" />
<Compile Include="Domain\Deployment\Contracts\IInstallationsRepository.cs" />
<Compile Include="Domain\Deployment\Contracts\IProjectsRepository.cs" />
<Compile Include="Domain\Deployment\Contracts\IServersRepository.cs" />
<Compile Include="Domain\Deployment\Entities\Application.cs" />
<Compile Include="Domain\Deployment\Entities\Installation.cs" />
<Compile Include="Domain\Deployment\Entities\InstallationLog.cs" />
Expand All @@ -80,6 +81,7 @@
<Compile Include="Domain\Deployment\Enums\LogSeverity.cs" />
<Compile Include="Domain\Deployment\Models\DeployPackageInfo.cs" />
<Compile Include="Domain\Deployment\Queries\InstallationQueries.cs" />
<Compile Include="Domain\Deployment\Queries\ServerQueries.cs" />
<Compile Include="Domain\EntityBase.cs" />
<Compile Include="Domain\IUow.cs" />
<Compile Include="Domain\Security\Contracts\IPositionsRepository.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ public interface IDeploymentUow : IUow
{
IProjectsRepository Projects { get; }
IInstallationsRepository Installations { get; }
IServersRepository Servers { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Baud.Deployment.BusinessLogic.Domain.Deployment.Entities;

namespace Baud.Deployment.BusinessLogic.Domain.Deployment.Contracts
{
public interface IServersRepository
{
IQueryable<Server> GetServers();

Server GetServerDetail(int id);

void UpdateServer(int id, Server server);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Baud.Deployment.Resources;

namespace Baud.Deployment.BusinessLogic.Domain.Deployment.Entities
{
Expand All @@ -13,9 +14,11 @@ public class Server : EntityBase

[Required]
[MaxLength(100)]
[Display(Name="Server", ResourceType=typeof(StringResources))]
public string Name { get; set; }

[MaxLength(100)]
[Display(Name = "AgentUrl", ResourceType = typeof(StringResources))]
public string AgentUrl { get; set; }

public List<ServerSite> Sites { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/Server/DeploymentFramework/Database/Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<Compile Include="Deployment\DeploymentDbContext.cs" />
<Compile Include="Deployment\DeploymentUow.cs" />
<Compile Include="Deployment\InstallationsRepository.cs" />
<Compile Include="Deployment\ServersRepository.cs" />
<Compile Include="Migrations\DeploymentConfiguration.cs" />
<Compile Include="Migrations\SecurityConfiguration.cs" />
<Compile Include="NoChangeTrackingDbContextProvider.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public IInstallationsRepository Installations
get { return GetRepository<IInstallationsRepository>(); }
}

public IServersRepository Servers
{
get { return GetRepository<IServersRepository>(); }
}

public DeploymentUow(IDbContextProvider<DeploymentDbContext> contextProvider, IRepositoryProvider<DeploymentDbContext> repositoryProvider, ICurrentUserProvider currentUserProvider, IDateTimeProvider dateTimeProvider)
: base(contextProvider, repositoryProvider, currentUserProvider, dateTimeProvider)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Baud.Deployment.BusinessLogic.Domain.Deployment.Contracts;
using Baud.Deployment.BusinessLogic.Domain.Deployment.Entities;
using Baud.Deployment.BusinessLogic.Domain.Deployment.Queries;

namespace Baud.Deployment.Database.Deployment
{
public class ServersRepository : RepositoryBase<DeploymentDbContext>, IServersRepository
{
public ServersRepository(DeploymentDbContext context)
: base(context)
{
}

public IQueryable<Server> GetServers()
{
return Context.Servers;
}

public Server GetServerDetail(int id)
{
return Context.Servers.FilterByID(id).FirstOrDefault();
}

public void UpdateServer(int id, Server server)
{
server.ID = id;

Context.AttachAsModified(server,
x => x.Name,
x => x.AgentUrl);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@
<data name="ActiveTo" xml:space="preserve">
<value>Aktivní do</value>
</data>
<data name="AgentURL" xml:space="preserve">
<data name="AgentUrl" xml:space="preserve">
<value>URL agenta</value>
</data>
<data name="BackToDetail" xml:space="preserve">
<value>Zpět na detail</value>
</data>
<data name="BackToList" xml:space="preserve">
<value>Zpět na seznam</value>
</data>
Expand Down Expand Up @@ -207,6 +210,12 @@
<data name="Security" xml:space="preserve">
<value>Bezpečnost</value>
</data>
<data name="Server" xml:space="preserve">
<value>Server</value>
</data>
<data name="ServerDetail" xml:space="preserve">
<value>Detail serveru</value>
</data>
<data name="Servers" xml:space="preserve">
<value>Servery</value>
</data>
Expand Down
21 changes: 15 additions & 6 deletions src/Server/DeploymentFramework/Resources/StringResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@
<data name="ActiveTo" xml:space="preserve">
<value>Active to</value>
</data>
<data name="AgentURL" xml:space="preserve">
<data name="AgentUrl" xml:space="preserve">
<value>Agent URL</value>
</data>
<data name="BackToDetail" xml:space="preserve">
<value>Back to detail</value>
</data>
<data name="BackToList" xml:space="preserve">
<value>Back to list</value>
</data>
Expand All @@ -139,7 +142,7 @@
<value>Edit</value>
</data>
<data name="EditName" xml:space="preserve">
<value>Edit Name</value>
<value>Edit name</value>
</data>
<data name="Enable" xml:space="preserve">
<value>Enable</value>
Expand Down Expand Up @@ -175,7 +178,7 @@
<value>No</value>
</data>
<data name="NoData" xml:space="preserve">
<value>No Data</value>
<value>No data</value>
</data>
<data name="Packages" xml:space="preserve">
<value>Packages</value>
Expand All @@ -184,7 +187,7 @@
<value>You can upload packages to </value>
</data>
<data name="PositionDetail" xml:space="preserve">
<value>Position Detail</value>
<value>Position detail</value>
</data>
<data name="Positions" xml:space="preserve">
<value>Positions</value>
Expand All @@ -193,7 +196,7 @@
<value>Products</value>
</data>
<data name="RoleDetail" xml:space="preserve">
<value>Role Detail</value>
<value>Role detail</value>
</data>
<data name="Roles" xml:space="preserve">
<value>Roles</value>
Expand All @@ -207,14 +210,20 @@
<data name="Security" xml:space="preserve">
<value>Security</value>
</data>
<data name="Server" xml:space="preserve">
<value>Server</value>
</data>
<data name="ServerDetail" xml:space="preserve">
<value>Server detail</value>
</data>
<data name="Servers" xml:space="preserve">
<value>Servers</value>
</data>
<data name="True" xml:space="preserve">
<value>Yes</value>
</data>
<data name="UserDetail" xml:space="preserve">
<value>User Detail</value>
<value>User detail</value>
</data>
<data name="Users" xml:space="preserve">
<value>Users</value>
Expand Down
Loading

0 comments on commit 8391d39

Please sign in to comment.