Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
console
Commits
ad895998
Commit
ad895998
authored
Jan 06, 2017
by
wudizhanche1000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packages
parent
b2261db8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
22 deletions
+48
-22
app/app-detail.component.ts
app/app-detail.component.ts
+3
-4
app/app-packages.component.html
app/app-packages.component.html
+14
-14
app/app-packages.component.ts
app/app-packages.component.ts
+6
-4
app/app.service.ts
app/app.service.ts
+11
-0
models/app.ts
models/app.ts
+2
-0
package/pack.ts
package/pack.ts
+9
-0
routes/packages.ts
routes/packages.ts
+3
-0
No files found.
app/app-detail.component.ts
View file @
ad895998
import
{
Component
,
OnInit
,
ChangeDetectorRef
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
App
from
'
../models/browserapp
'
;
import
{
AppService
}
from
'
./app.service
'
;
import
{
ActivatedRoute
,
Params
,
Router
}
from
'
@angular/router
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
'
rxjs/Rx
'
;
import
{
MdIconRegistry
,
MdSnackBar
}
from
'
@angular/material
'
;
import
{
DomSanitizer
}
from
'
@angular/platform-browser
'
;
import
{
MdSnackBar
}
from
'
@angular/material
'
;
@
Component
({
moduleId
:
module
.
id
,
...
...
app/app-packages.component.html
View file @
ad895998
<md-tab-group
*ngIf=
"app"
>
<md-tab
*ngFor=
"let package of packages"
[label]=
"package_description(package)"
>
<form
class=
"example-form"
style=
"margin-top:16px;"
>
<
md-input-container
class=
"example-full-width"
>
<
input
md-input
name=
"name"
placeholder=
"应用名称"
[(ngModel)]=
"app.name[locale]"
>
<
/md-input-container
>
<
!--<md-input-container class="example-full-width">--
>
<
!--<input md-input name="name" placeholder="应用名称" [(ngModel)]="app.name[locale]">--
>
<
!--</md-input-container>--
>
<
md-input-container
class=
"example-full-width"
>
<
textarea
md-input
name=
"description"
placeholder=
"应用介绍"
[(ngModel)]=
"app.description[locale]"
></textarea
>
<
md-hint
align=
"end"
>
支持 Markdown 语法
</md-hint
>
<
/md-input-container
>
<
!--<md-input-container class="example-full-width">--
>
<
!--<textarea md-input name="description" placeholder="应用介绍"-->
<!--[(ngModel)]="app.description[locale]"></textarea>--
>
<
!--<md-hint align="end">支持 Markdown 语法</md-hint>--
>
<
!--</md-input-container>--
>
<
md-input-container
class=
"example-full-width"
>
<
textarea
md-input
name=
"news"
placeholder=
"新闻"
[(ngModel)]=
"news[locale]"
></textarea
>
<
md-hint
align=
"end"
>
JSON
{
title: string, url: string, image: string
}
[],不会写请联系
zh99998@gmail.com
<
/md-hint
>
<
/md-input-container
>
<
!--<md-input-container class="example-full-width">--
>
<
!--<textarea md-input name="news" placeholder="新闻" [(ngModel)]="news[locale]"></textarea>--
>
<
!--<md-hint align="end">JSON {title: string, url: string, image: string}[],不会写请联系-->
<!--zh99998@gmail.com-->
<
!--</md-hint>--
>
<
!--</md-input-container>--
>
<button
md-raised-button
color=
"primary"
>
提交
</button>
</form>
...
...
app/app-packages.component.ts
View file @
ad895998
...
...
@@ -3,8 +3,7 @@ import App from '../models/browserapp';
import
{
AppService
}
from
'
./app.service
'
;
import
{
ActivatedRoute
,
Params
}
from
'
@angular/router
'
;
import
'
rxjs/Rx
'
;
import
{
MdIconRegistry
}
from
'
@angular/material
'
;
import
{
DomSanitizer
}
from
'
@angular/platform-browser
'
;
import
{
Package
}
from
'
../models/package
'
;
@
Component
({
moduleId
:
module
.
id
,
...
...
@@ -14,14 +13,17 @@ import {DomSanitizer} from '@angular/platform-browser';
export
class
AppPackagesComponent
implements
OnInit
{
app
:
App
;
constructor
(
private
appService
:
AppService
,
private
route
:
ActivatedRoute
,
iconRegistry
:
MdIconRegistry
,
sanitizer
:
DomSanitizer
)
{
packages
:
Package
[];
constructor
(
private
appService
:
AppService
,
private
route
:
ActivatedRoute
)
{
}
async
ngOnInit
()
{
this
.
route
.
parent
.
params
.
switchMap
((
params
:
Params
)
=>
this
.
appService
.
find
(
params
[
'
id
'
]))
.
subscribe
(
a
pp
=>
{
.
subscribe
(
a
sync
(
app
)
=>
{
this
.
app
=
app
;
this
.
packages
=
await
this
.
appService
.
allPackages
(
app
.
id
);
});
}
...
...
app/app.service.ts
View file @
ad895998
...
...
@@ -3,6 +3,7 @@ import App from '../models/browserapp';
import
{
Http
,
RequestOptions
,
Headers
,
Response
}
from
'
@angular/http
'
;
import
'
rxjs/add/operator/toPromise
'
;
import
{
Observable
}
from
'
rxjs/Rx
'
;
import
{
Package
}
from
'
../models/package
'
;
/**
* Created by weijian on 2016/12/30.
*/
...
...
@@ -23,6 +24,16 @@ export class AppService {
}
async
allPackages
(
appId
:
string
):
Promise
<
Package
[]
>
{
return
[
new
Package
({
version
:
'
1.06
'
,
platforms
:
[
'
win32
'
,
'
darwin
'
],
locales
:
[
'
zh-CN
'
,
'
en-US
'
],
files
:
{
'
1.txt
'
:
'
hashA
'
,
'
2.txt
'
:
'
hashB
'
,
'
3.txt
'
:
'
hashC
'
},
})];
}
all
():
Promise
<
App
[]
>
{
return
this
.
http
.
get
(
'
http://localhost:8000/apps
'
)
.
map
((
response
)
=>
{
...
...
models/app.ts
View file @
ad895998
...
...
@@ -21,6 +21,8 @@ export class App extends Model {
@
field
news
:
I18n
<
{
title
:
string
,
url
:
string
,
image
:
string
}[]
>
;
@
field
changelog
:
I18n
<
string
>
;
@
field
conference
?:
string
;
@
field
data
:
any
;
...
...
package/pack.ts
0 → 100644
View file @
ad895998
/**
* Created by weijian on 2017/1/6.
*/
const
queue
=
[];
while
(
true
){
}
routes/packages.ts
View file @
ad895998
...
...
@@ -7,6 +7,9 @@ import {NotFound} from '../koa/errors';
import
{
Package
}
from
'
../models/package
'
;
const
router
=
new
Router
();
router
.
get
(
'
/packages/all/:appId
'
,
async
(
ctx
,
next
)
=>
{
});
router
.
get
(
'
/packages/:id
'
,
async
(
ctx
,
next
)
=>
{
let
p
:
Package
|
null
=
await
Package
.
findOne
({
id
:
ctx
.
params
.
id
});
if
(
!
p
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment