├── .gitattributes ├── .gitignore ├── .vscode ├── launch.json └── tasks.json ├── Dockerfile ├── GogsBoard.sln ├── README.md ├── global.json ├── package.json └── src └── GogsBoard ├── App ├── AppModule.ts ├── Components │ ├── GogsBoardComponent.html │ ├── GogsBoardComponent.ts │ ├── IssueComponent.html │ ├── IssueComponent.ts │ ├── RepoBoardComponent.html │ ├── RepoBoardComponent.ts │ ├── RepoListComponent.html │ └── RepoListComponent.ts ├── Main.ts └── Services │ ├── ConfigService.ts │ ├── LabelService.ts │ └── RepoService.ts ├── Controllers ├── ConfigController.cs └── HomeController.cs ├── GogsBoard.xproj ├── Models └── GogsBoardOptions.cs ├── Program.cs ├── Properties └── launchSettings.json ├── Startup.cs ├── Views └── Home │ └── index.cshtml ├── config.default.json ├── favicon.png ├── logo.png ├── package.json ├── project.json ├── systemjs.config.js └── tsconfig.json /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | [Xx]64/ 19 | [Xx]86/ 20 | [Bb]uild/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | *.vspx 89 | *.sap 90 | 91 | # TFS 2012 Local Workspace 92 | $tf/ 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | *.DotSettings.user 101 | 102 | # JustCode is a .NET coding add-in 103 | .JustCode 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | _NCrunch_* 113 | .*crunch*.local.xml 114 | nCrunchTemp_* 115 | 116 | # MightyMoose 117 | *.mm.* 118 | AutoTest.Net/ 119 | 120 | # Web workbench (sass) 121 | .sass-cache/ 122 | 123 | # Installshield output folder 124 | [Ee]xpress/ 125 | 126 | # DocProject is a documentation generator add-in 127 | DocProject/buildhelp/ 128 | DocProject/Help/*.HxT 129 | DocProject/Help/*.HxC 130 | DocProject/Help/*.hhc 131 | DocProject/Help/*.hhk 132 | DocProject/Help/*.hhp 133 | DocProject/Help/Html2 134 | DocProject/Help/html 135 | 136 | # Click-Once directory 137 | publish/ 138 | 139 | # Publish Web Output 140 | *.[Pp]ublish.xml 141 | *.azurePubxml 142 | 143 | # TODO: Un-comment the next line if you do not want to checkin 144 | # your web deploy settings because they may include unencrypted 145 | # passwords 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # NuGet Packages 150 | *.nupkg 151 | # The packages folder can be ignored because of Package Restore 152 | **/packages/* 153 | # except build/, which is used as an MSBuild target. 154 | !**/packages/build/ 155 | # Uncomment if necessary however generally it will be regenerated when needed 156 | #!**/packages/repositories.config 157 | # NuGet v3's project.json files produces more ignoreable files 158 | *.nuget.props 159 | *.nuget.targets 160 | 161 | # Microsoft Azure Build Output 162 | csx/ 163 | *.build.csdef 164 | 165 | # Microsoft Azure Emulator 166 | ecf/ 167 | rcf/ 168 | 169 | # Windows Store app package directory 170 | AppPackages/ 171 | BundleArtifacts/ 172 | 173 | # Visual Studio cache files 174 | # files ending in .cache can be ignored 175 | *.[Cc]ache 176 | # but keep track of directories ending in .cache 177 | !*.[Cc]ache/ 178 | 179 | # Others 180 | ClientBin/ 181 | [Ss]tyle[Cc]op.* 182 | ~$* 183 | *~ 184 | *.dbmdl 185 | *.dbproj.schemaview 186 | *.pfx 187 | *.publishsettings 188 | node_modules/ 189 | orleans.codegen.cs 190 | 191 | # RIA/Silverlight projects 192 | Generated_Code/ 193 | 194 | # Backup & report files from converting an old project file 195 | # to a newer Visual Studio version. Backup files are not needed, 196 | # because we have git ;-) 197 | _UpgradeReport_Files/ 198 | Backup*/ 199 | UpgradeLog*.XML 200 | UpgradeLog*.htm 201 | 202 | # SQL Server files 203 | *.mdf 204 | *.ldf 205 | 206 | # Business Intelligence projects 207 | *.rdl.data 208 | *.bim.layout 209 | *.bim_*.settings 210 | 211 | # Microsoft Fakes 212 | FakesAssemblies/ 213 | 214 | # GhostDoc plugin setting file 215 | *.GhostDoc.xml 216 | 217 | # Node.js Tools for Visual Studio 218 | .ntvs_analysis.dat 219 | 220 | # Visual Studio 6 build log 221 | *.plg 222 | 223 | # Visual Studio 6 workspace options file 224 | *.opt 225 | 226 | # Visual Studio LightSwitch build output 227 | **/*.HTMLClient/GeneratedArtifacts 228 | **/*.DesktopClient/GeneratedArtifacts 229 | **/*.DesktopClient/ModelManifest.xml 230 | **/*.Server/GeneratedArtifacts 231 | **/*.Server/ModelManifest.xml 232 | _Pvt_Extensions 233 | 234 | # LightSwitch generated files 235 | GeneratedArtifacts/ 236 | ModelManifest.xml 237 | 238 | # Paket dependency manager 239 | .paket/paket.exe 240 | 241 | # FAKE - F# Make 242 | .fake/ 243 | 244 | # js files 245 | src/GogsBoard/App/**/*.js 246 | src/GogsBoard/App/**/*.js.map 247 | 248 | # config 249 | config.json -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": ".NET Core Launch (web)", 6 | "type": "coreclr", 7 | "request": "launch", 8 | "preLaunchTask": "build", 9 | "program": "${workspaceRoot}/src/GogsBoard/bin/Debug/netcoreapp1.0/GogsBoard.dll", 10 | "args": [], 11 | "cwd": "${workspaceRoot}", 12 | "stopAtEntry": false, 13 | "internalConsoleOptions": "openOnSessionStart", 14 | "launchBrowser": { 15 | "enabled": true, 16 | "args": "${auto-detect-url}", 17 | "windows": { 18 | "command": "cmd.exe", 19 | "args": "/C start ${auto-detect-url}" 20 | }, 21 | "osx": { 22 | "command": "open" 23 | }, 24 | "linux": { 25 | "command": "xdg-open" 26 | } 27 | }, 28 | "env": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | }, 31 | "sourceFileMap": { 32 | "/Views": "${workspaceRoot}/Views" 33 | } 34 | }, 35 | { 36 | "name": ".NET Core Attach", 37 | "type": "coreclr", 38 | "request": "attach", 39 | "processId": "${command.pickProcess}" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | "command": "dotnet", 4 | "isShellCommand": true, 5 | "args": [], 6 | "tasks": [ 7 | { 8 | "taskName": "build", 9 | "args": [ 10 | "${workspaceRoot}/src/GogsBoard/project.json" 11 | ], 12 | "isBuildCommand": true, 13 | "problemMatcher": "$msCompile" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mhtsbt/dotnet:1.1.0 2 | 3 | ADD ./src/GogsBoard/package.json /app/src/GogsBoard/package.json 4 | RUN cd /app/src/GogsBoard && npm install -y && npm install gulp -g -y 5 | 6 | COPY ./ /app/ 7 | 8 | WORKDIR /app 9 | 10 | RUN ["dotnet", "restore"] 11 | 12 | WORKDIR /app/src/GogsBoard 13 | 14 | ENV gogsurl=url 15 | ENV gogstoken=token 16 | 17 | EXPOSE 5000 18 | ENTRYPOINT ["dotnet", "run"] -------------------------------------------------------------------------------- /GogsBoard.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{35B4443D-21D7-4002-B4D3-B7515C4FC590}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6E3DF521-176F-4111-94F9-6E79FF492E14}" 9 | ProjectSection(SolutionItems) = preProject 10 | .gitattributes = .gitattributes 11 | .gitignore = .gitignore 12 | Dockerfile = Dockerfile 13 | global.json = global.json 14 | README.md = README.md 15 | EndProjectSection 16 | EndProject 17 | Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "GogsBoard", "src\GogsBoard\GogsBoard.xproj", "{4621AD25-E0CF-4766-97B9-DEF38E48D983}" 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|Any CPU = Debug|Any CPU 22 | Release|Any CPU = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {4621AD25-E0CF-4766-97B9-DEF38E48D983}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {4621AD25-E0CF-4766-97B9-DEF38E48D983}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {4621AD25-E0CF-4766-97B9-DEF38E48D983}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {4621AD25-E0CF-4766-97B9-DEF38E48D983}.Release|Any CPU.Build.0 = Release|Any CPU 29 | EndGlobalSection 30 | GlobalSection(SolutionProperties) = preSolution 31 | HideSolutionNode = FALSE 32 | EndGlobalSection 33 | GlobalSection(NestedProjects) = preSolution 34 | {4621AD25-E0CF-4766-97B9-DEF38E48D983} = {35B4443D-21D7-4002-B4D3-B7515C4FC590} 35 | EndGlobalSection 36 | EndGlobal 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **WARNING: this repositoy is not maintained any longer** 2 | 3 | # GogsBoard 4 | GogsBoard is a kanban board for Gogs 5 | 6 | ## Install 7 | 8 | We are still in a very early stage. But if you want to check this out, the easyest way is to use Docker: 9 | 10 | docker run -p 5000:5000 -e gogsurl={{gogs url}} -e gogstoken={{gogs token}} mhtsbt/gogsboard 11 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ "src", "test" ], 3 | "sdk": { 4 | "version": "1.0.0-preview2-003131" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gogsboard", 3 | "version": "1.0.0", 4 | "description": "GogsBoard is a kanban board for Gogs", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "concurrently \"tsc -w -p src/GogsBoard\" \"cd src/GogsBoard && dotnet run\"" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/mhtsbt/GogsBoard.git" 12 | }, 13 | "author": "", 14 | "license": "ISC", 15 | "bugs": { 16 | "url": "https://github.com/mhtsbt/GogsBoard/issues" 17 | }, 18 | "homepage": "https://github.com/mhtsbt/GogsBoard#readme", 19 | "devDependencies": { 20 | "concurrently": "^3.4.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/GogsBoard/App/AppModule.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { HttpModule } from '@angular/http'; 4 | import { RouterModule } from '@angular/router'; 5 | import { DndModule } from 'ng2-dnd'; 6 | 7 | import { GogsBoardComponent } from './Components/GogsBoardComponent'; 8 | import { RepoBoardComponent } from './Components/RepoBoardComponent'; 9 | import { RepoListComponent } from './Components/RepoListComponent'; 10 | import { IssueComponent } from './Components/IssueComponent'; 11 | 12 | import { LabelService } from './Services/LabelService'; 13 | import { RepoService } from './Services/RepoService'; 14 | import { ConfigService } from './Services/ConfigService'; 15 | 16 | @NgModule({ 17 | imports: [BrowserModule, HttpModule, RouterModule.forRoot([ 18 | { path: '', component: RepoListComponent }, 19 | { path: 'repo/:owner/:repo', component: RepoBoardComponent } 20 | ]), DndModule.forRoot()], 21 | declarations: [GogsBoardComponent, RepoListComponent, RepoBoardComponent, IssueComponent], 22 | bootstrap: [GogsBoardComponent], 23 | providers: [RepoService,LabelService, ConfigService] 24 | }) 25 | export class AppModule { } -------------------------------------------------------------------------------- /src/GogsBoard/App/Components/GogsBoardComponent.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 9 | 10 | 11 | 12 |
-------------------------------------------------------------------------------- /src/GogsBoard/App/Components/GogsBoardComponent.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core" 2 | 3 | 4 | @Component({ 5 | selector: "gogs-board", 6 | templateUrl: "./App/Components/GogsBoardComponent.html" 7 | }) 8 | export class GogsBoardComponent { 9 | 10 | } -------------------------------------------------------------------------------- /src/GogsBoard/App/Components/IssueComponent.html: -------------------------------------------------------------------------------- 1 | 
2 |
{{issueData.title}}
3 |
4 |
5 | {{issueData.assignee.username}} 6 |
-------------------------------------------------------------------------------- /src/GogsBoard/App/Components/IssueComponent.ts: -------------------------------------------------------------------------------- 1 | import { Component, } from "@angular/core" 2 | 3 | @Component({ 4 | selector: "issue", 5 | templateUrl: "./App/Components/IssueComponent.html", 6 | inputs: ["issueData"] 7 | }) 8 | export class IssueComponent { 9 | 10 | public issueData; 11 | 12 | constructor() { 13 | 14 | 15 | 16 | } 17 | 18 | ngOnInit() { 19 | 20 | console.log(this.issueData); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /src/GogsBoard/App/Components/RepoBoardComponent.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
Backlog
6 | 7 |
8 | 9 |
10 | 11 |
In progress
12 | 13 |
14 | 15 |
16 | 17 |
Testable
18 | 19 |
20 | 21 |
22 | 23 |
Done
24 | 25 |
26 | 27 |
28 | 29 |
30 | 31 |
32 | 33 |
34 | 35 |
36 |
37 | 38 |
39 |
40 |
41 |
42 |

desc

43 |
44 |
45 |
46 | Issues 47 |
48 |
49 |
50 | 51 |
52 |
53 | 54 |
55 |
56 |
57 |
58 |

desc

59 |
60 |
61 |
62 | Issues 63 |
64 |
65 |
66 | 67 |
-------------------------------------------------------------------------------- /src/GogsBoard/App/Components/RepoBoardComponent.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core" 2 | 3 | import { RepoService } from '../Services/RepoService'; 4 | import { LabelService } from '../Services/LabelService'; 5 | 6 | import { ActivatedRoute } from '@angular/router'; 7 | 8 | @Component({ 9 | selector: "repo-board", 10 | templateUrl: "./App/Components/RepoBoardComponent.html" 11 | }) 12 | export class RepoBoardComponent { 13 | 14 | public backlogIssues = []; 15 | public progressIssues = []; 16 | 17 | public owner; 18 | public repo; 19 | 20 | constructor(private repoService: RepoService, private labelService: LabelService, private route: ActivatedRoute) { 21 | 22 | var ctrl = this; 23 | 24 | this.route.params.subscribe(params => { 25 | 26 | ctrl.owner = params['owner']; 27 | ctrl.repo = params['repo']; 28 | 29 | ctrl.repoService.getIssues(ctrl.owner, ctrl.repo).subscribe(function (issues) { 30 | ctrl.backlogIssues = issues; 31 | }); 32 | 33 | this.labelService.getLabelsForRepo(this.owner,this.repo).subscribe((res) => { console.log(res); }); 34 | 35 | }); 36 | 37 | } 38 | 39 | public receiveIssue(event, destination) { 40 | 41 | var ctrl = this; 42 | var issue = event.dragData; 43 | 44 | var backlogIndex = ctrl.backlogIssues.indexOf(issue); 45 | 46 | if (backlogIndex !== -1) { 47 | ctrl.backlogIssues.splice(backlogIndex, 1); 48 | } 49 | 50 | var currentFlowIndex = ctrl.progressIssues.indexOf(issue); 51 | 52 | if (currentFlowIndex === -1) { 53 | destination.push(issue); 54 | 55 | // push to api 56 | this.labelService.addLabelToIssue(this.owner,this.repo,issue.number,5).subscribe(() => {alert("ok!"); }); 57 | 58 | } 59 | 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/GogsBoard/App/Components/RepoListComponent.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 | 6 |
7 | 8 |
{{repo.updated_at}}
9 |
10 |

desc

11 |
12 |
13 |
14 | {{repo.open_issues_count}} Issues 15 |
16 |
17 |
18 |
-------------------------------------------------------------------------------- /src/GogsBoard/App/Components/RepoListComponent.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core" 2 | 3 | import { RepoService } from '../Services/RepoService'; 4 | 5 | @Component({ 6 | selector: "repo-list", 7 | templateUrl: "./App/Components/RepoListComponent.html" 8 | }) 9 | export class RepoListComponent { 10 | 11 | public repos; 12 | 13 | constructor(repoService: RepoService) { 14 | 15 | var ctrl = this; 16 | 17 | repoService.listRepo().subscribe(function (repos) { 18 | ctrl.repos = repos; 19 | console.log(repos); 20 | }); 21 | 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /src/GogsBoard/App/Main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | import { AppModule } from './AppModule'; 3 | const platform = platformBrowserDynamic(); 4 | platform.bootstrapModule(AppModule); -------------------------------------------------------------------------------- /src/GogsBoard/App/Services/ConfigService.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | 4 | import { Observable } from 'rxjs/Rx'; 5 | 6 | declare var config; 7 | 8 | @Injectable() 9 | export class ConfigService { 10 | 11 | constructor(private http: Http) { 12 | 13 | } 14 | 15 | public getConfig() { 16 | 17 | var service = this; 18 | 19 | return Observable.create(observable => { 20 | 21 | service.http.get("/api/config").subscribe(res => { 22 | observable.next(res.json()); 23 | }); 24 | }); 25 | 26 | } 27 | } -------------------------------------------------------------------------------- /src/GogsBoard/App/Services/LabelService.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | 4 | import { Observable } from 'rxjs/Rx'; 5 | 6 | import { ConfigService } from './ConfigService'; 7 | 8 | @Injectable() 9 | export class LabelService { 10 | 11 | constructor(private http: Http, private configService: ConfigService) { 12 | 13 | } 14 | 15 | public getLabelsForRepo(username: string, reponame: string) { 16 | 17 | var service = this; 18 | 19 | return Observable.create(observable => { 20 | 21 | service.configService.getConfig().subscribe(config => { 22 | 23 | service.http.get(config.gogsurl + "/api/v1/repos/" + username + "/" + reponame + "/labels?token=" + config.gogstoken).subscribe(res => { 24 | observable.next(res.json()); 25 | }); 26 | }); 27 | }); 28 | 29 | } 30 | 31 | public addLabelToIssue(username: string, reponame: string, issueIndex: number, labelId: number) { 32 | 33 | var service = this; 34 | 35 | var labels = {labels: [labelId]}; 36 | 37 | return Observable.create(observable => { 38 | 39 | service.configService.getConfig().subscribe(config => { 40 | 41 | service.http.post(config.gogsurl + "/api/v1/repos/" + username + "/" + reponame + "/issues/"+issueIndex+"/labels?token=" + config.gogstoken,labels).subscribe(res => { 42 | observable.next(res.json()); 43 | }); 44 | }); 45 | }); 46 | 47 | } 48 | 49 | public getIssues(owner: string, repo: string) { 50 | 51 | var service = this; 52 | 53 | return Observable.create(observable => { 54 | 55 | service.configService.getConfig().subscribe(config => { 56 | 57 | service.http.get(config.gogsurl + "/api/v1/repos/" + owner + "/" + repo + "/issues?token=" + config.gogstoken).subscribe(res => { 58 | observable.next(res.json()); 59 | }); 60 | 61 | }); 62 | 63 | }); 64 | 65 | } 66 | 67 | } -------------------------------------------------------------------------------- /src/GogsBoard/App/Services/RepoService.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | 4 | import { Observable } from 'rxjs/Rx'; 5 | 6 | import {ConfigService} from './ConfigService'; 7 | 8 | @Injectable() 9 | export class RepoService { 10 | 11 | constructor(private http: Http, private configService: ConfigService) { 12 | 13 | } 14 | 15 | public listRepo() { 16 | 17 | var service = this; 18 | 19 | return Observable.create(observable => { 20 | 21 | service.configService.getConfig().subscribe(config => { 22 | 23 | service.http.get(config.gogsurl + "/api/v1/user/repos?token=" + config.gogstoken).subscribe(res => { 24 | observable.next(res.json()); 25 | }); 26 | }); 27 | }); 28 | 29 | } 30 | 31 | public getIssues(owner: string, repo: string) { 32 | 33 | var service = this; 34 | 35 | return Observable.create(observable => { 36 | 37 | service.configService.getConfig().subscribe(config => { 38 | 39 | service.http.get(config.gogsurl + "/api/v1/repos/" + owner + "/" + repo + "/issues?token=" + config.gogstoken).subscribe(res => { 40 | observable.next(res.json()); 41 | }); 42 | 43 | }); 44 | 45 | }); 46 | 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /src/GogsBoard/Controllers/ConfigController.cs: -------------------------------------------------------------------------------- 1 | using GogsBoard.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Extensions.Options; 4 | using System.Collections.Generic; 5 | 6 | namespace GogsBoard.Controllers 7 | { 8 | public class ConfigController : Controller 9 | { 10 | 11 | private readonly GogsBoardOptions _options; 12 | 13 | public ConfigController(IOptions options) 14 | { 15 | _options = options.Value; 16 | } 17 | 18 | [Route("/api/config"), HttpGet] 19 | public GogsBoardOptions GetConfig() 20 | { 21 | return _options; 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/GogsBoard/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using GogsBoard.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Extensions.Options; 4 | using System.Collections.Generic; 5 | 6 | namespace GogsBoard.Controllers 7 | { 8 | public class HomeController : Controller 9 | { 10 | 11 | public IActionResult Index() 12 | { 13 | return View(); 14 | } 15 | 16 | [Route("repo/{user}/{project}")] 17 | public IActionResult ProjectPage() 18 | { 19 | return View("Index"); 20 | } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/GogsBoard/GogsBoard.xproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | 10 | 4621ad25-e0cf-4766-97b9-def38e48d983 11 | GogsBoard 12 | .\obj 13 | .\bin\ 14 | v4.5.2 15 | 16 | 17 | 18 | 2.0 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/GogsBoard/Models/GogsBoardOptions.cs: -------------------------------------------------------------------------------- 1 | namespace GogsBoard.Models 2 | { 3 | public class GogsBoardOptions 4 | { 5 | public string gogsurl { get; set; } 6 | public string gogstoken { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/GogsBoard/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using System.IO; 3 | 4 | namespace GogsBoard 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | var host = new WebHostBuilder() 11 | .UseKestrel() 12 | .UseContentRoot(Directory.GetCurrentDirectory()) 13 | .UseWebRoot(".") 14 | .UseUrls("http://*:5000") 15 | .UseStartup() 16 | .Build(); 17 | 18 | host.Run(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/GogsBoard/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:51662/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "GogsBoard": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "launchUrl": "http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/GogsBoard/Startup.cs: -------------------------------------------------------------------------------- 1 | using GogsBoard.Models; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using Microsoft.Extensions.Logging; 7 | 8 | namespace GogsBoard 9 | { 10 | public class Startup 11 | { 12 | public IConfigurationRoot _configuration { get; set; } 13 | 14 | public Startup(IHostingEnvironment env) 15 | { 16 | var builder = new ConfigurationBuilder() 17 | .SetBasePath(env.ContentRootPath) 18 | .AddJsonFile($"config.json", optional: true) 19 | .AddEnvironmentVariables(); 20 | 21 | _configuration = builder.Build(); 22 | 23 | } 24 | 25 | public void ConfigureServices(IServiceCollection services) 26 | { 27 | services.AddOptions(); 28 | services.Configure(_configuration); 29 | services.AddMvc(); 30 | } 31 | 32 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 33 | { 34 | loggerFactory.AddConsole(); 35 | 36 | if (env.IsDevelopment()) 37 | { 38 | app.UseDeveloperExceptionPage(); 39 | } 40 | 41 | 42 | app.UseMvc(routes => 43 | { 44 | routes.MapRoute( 45 | name: "default", 46 | template: "{controller=Home}/{action=Index}/{id?}"); 47 | }); 48 | 49 | app.UseStaticFiles(); 50 | 51 | 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/GogsBoard/Views/Home/index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | GogsBoard 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /src/GogsBoard/config.default.json: -------------------------------------------------------------------------------- 1 | { 2 | "gogsurl": "", 3 | "gogstoken": "" 4 | } -------------------------------------------------------------------------------- /src/GogsBoard/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhtsbt/GogsBoard/0ced9c6745a2951beb91c3df9dce02ffba23c1c9/src/GogsBoard/favicon.png -------------------------------------------------------------------------------- /src/GogsBoard/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mhtsbt/GogsBoard/0ced9c6745a2951beb91c3df9dce02ffba23c1c9/src/GogsBoard/logo.png -------------------------------------------------------------------------------- /src/GogsBoard/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "reader", 4 | "private": true, 5 | "scripts": { 6 | "typings": "typings" 7 | }, 8 | "dependencies": { 9 | "@angular/common": "^2.0.0", 10 | "@angular/compiler": "^2.0.0", 11 | "@angular/core": "^2.0.0", 12 | "@angular/forms": "^2.0.0", 13 | "@angular/http": "^2.0.0", 14 | "@angular/platform-browser": "^2.0.0", 15 | "@angular/platform-browser-dynamic": "^2.0.1", 16 | "@angular/router": "^3.0.0", 17 | "core-js": "^2.4.1", 18 | "reflect-metadata": "^0.1.3", 19 | "rxjs": "^5.0.3", 20 | "systemjs": "0.19.27", 21 | "zone.js": "^0.7.2", 22 | "semantic-ui-css": "~2.2.4", 23 | "ng2-dnd": "~2.1.1" 24 | }, 25 | "devDependencies": { 26 | "typings": "^1.0.4", 27 | "systemjs-builder": "~0.15.32", 28 | "gulp": "~3.9.1" 29 | } 30 | } -------------------------------------------------------------------------------- /src/GogsBoard/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.App": { 4 | "version": "1.1.0", 5 | "type": "platform" 6 | }, 7 | "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0", 8 | "Microsoft.Extensions.Configuration.Json": "1.1.0", 9 | "Microsoft.AspNetCore.Mvc.Core": "1.1.0", 10 | "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.1.0", 11 | "Microsoft.AspNetCore.Mvc": "1.1.0", 12 | "Microsoft.AspNetCore.Diagnostics": "1.1.0", 13 | "Microsoft.AspNetCore.Server.Kestrel": "1.1.0", 14 | "Microsoft.AspNetCore.StaticFiles": "1.1.0", 15 | "Microsoft.Extensions.Logging.Console": "1.1.0", 16 | "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0" 17 | }, 18 | "tools": { 19 | }, 20 | "frameworks": { 21 | "netcoreapp1.0": { 22 | "imports": [ 23 | "dotnet5.6", 24 | "portable-net45+win8" 25 | ] 26 | } 27 | }, 28 | 29 | "buildOptions": { 30 | "emitEntryPoint": true, 31 | "preserveCompilationContext": true 32 | }, 33 | 34 | "runtimeOptions": { 35 | "configProperties": { 36 | "System.GC.Server": true 37 | } 38 | }, 39 | 40 | "publishOptions": { 41 | "include": [ 42 | 43 | ] 44 | }, 45 | 46 | "scripts": { 47 | "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/GogsBoard/systemjs.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * System configuration for Angular samples 3 | * Adjust as necessary for your application needs. 4 | */ 5 | (function (global) { 6 | System.config({ 7 | paths: { 8 | // paths serve as alias 9 | 'npm:': 'node_modules/' 10 | }, 11 | // map tells the System loader where to look for things 12 | map: { 13 | // our app is within the app folder 14 | app: 'App', 15 | // angular bundles 16 | '@angular/core': 'npm:@angular/core/bundles/core.umd.js', 17 | '@angular/common': 'npm:@angular/common/bundles/common.umd.js', 18 | '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', 19 | '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', 20 | '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', 21 | '@angular/http': 'npm:@angular/http/bundles/http.umd.js', 22 | '@angular/router': 'npm:@angular/router/bundles/router.umd.js', 23 | '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', 24 | // other libraries 25 | 'rxjs': 'npm:rxjs', 26 | 'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api', 27 | 'ng2-dnd': 'node_modules/ng2-dnd/bundles/index.umd.js' 28 | }, 29 | // packages tells the System loader how to load when no filename and/or no extension 30 | packages: { 31 | app: { 32 | main: './Main.js', 33 | defaultExtension: 'js' 34 | }, 35 | rxjs: { 36 | defaultExtension: 'js' 37 | } 38 | } 39 | }); 40 | })(this); 41 | -------------------------------------------------------------------------------- /src/GogsBoard/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": true, 3 | "compilerOptions": { 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "sourceMap": true, 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "removeComments": false, 11 | "noImplicitAny": false 12 | } 13 | } --------------------------------------------------------------------------------