Get git projects from Gogs
This commit is contained in:
parent
9fd9beb860
commit
292d7729f2
9 changed files with 122 additions and 10 deletions
19
Website/ViewComponents/ProjectNavigationViewComponent.cs
Normal file
19
Website/ViewComponents/ProjectNavigationViewComponent.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Website.Data;
|
||||
|
||||
namespace Website.ViewComponents {
|
||||
public class ProjectNavigationViewComponent :ViewComponent {
|
||||
private readonly GitServerApi _api;
|
||||
|
||||
public ProjectNavigationViewComponent(GitServerApi api) {
|
||||
_api = api;
|
||||
}
|
||||
|
||||
public async Task<IViewComponentResult> InvokeAsync() {
|
||||
var repositories = await _api.GetRepositories();
|
||||
return View(repositories.Take(5));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue