Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
moecube
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
JoyJ
moecube
Commits
518c78ba
Commit
518c78ba
authored
Oct 21, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app list
parent
07b9e520
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
16 deletions
+30
-16
app/app-detail.component.html
app/app-detail.component.html
+0
-1
app/apps.component.html
app/apps.component.html
+10
-6
app/apps.component.ts
app/apps.component.ts
+20
-9
No files found.
app/app-detail.component.html
View file @
518c78ba
...
@@ -218,4 +218,3 @@
...
@@ -218,4 +218,3 @@
</form>
</form>
</div>
</div>
</div>
</div>
app/apps.component.html
View file @
518c78ba
<span>
已安装
</span>
<ul
class=
"nav nav-sidebar"
>
<ul
class=
"nav nav-sidebar"
>
<li
*ngFor=
"let app of apps"
[class.active]=
"app.id==routingService.app"
><a
<li
*ngFor=
"let app of grouped_apps.installed"
[class.active]=
"app.id==routingService.app"
>
(click)=
"selectApp(app.id)"
<a
(click)=
"selectApp(app.id)"
href=
"#"
>
{{app.name[app.locales[0]]}}
</a>
href=
"#"
</li>
>
</ul>
{{app.name[app.locales[0]]}}
<span>
未安装
</span>
</a></li>
<ul
class=
"nav nav-sidebar"
>
<li
*ngFor=
"let app of grouped_apps.not_installed"
[class.active]=
"app.id==routingService.app"
>
<a
(click)=
"selectApp(app.id)"
href=
"#"
>
{{app.name[app.locales[0]]}}
</a>
</li>
</ul>
</ul>
<!--<ul class="nav nav-sidebar">
<!--<ul class="nav nav-sidebar">
<li><a href="">Nav item</a></li>
<li><a href="">Nav item</a></li>
...
...
app/apps.component.ts
View file @
518c78ba
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
}
from
'
@angular/core
'
;
import
{
AppsService
}
from
'
./apps.service
'
import
{
AppsService
}
from
'
./apps.service
'
import
{
RoutingService
}
from
'
./routing.service
'
import
{
RoutingService
}
from
'
./routing.service
'
@
Component
({
@
Component
({
selector
:
'
apps
'
,
selector
:
'
apps
'
,
...
@@ -9,10 +9,10 @@ import { RoutingService } from './routing.service'
...
@@ -9,10 +9,10 @@ import { RoutingService } from './routing.service'
})
})
export
class
AppsComponent
{
export
class
AppsComponent
{
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
)
{
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
)
{
appsService
.
getApps
(()
=>
{
appsService
.
getApps
(()
=>
{
//console.log(appsService.data)
//console.log(appsService.data)
if
(
appsService
.
data
.
length
>
0
)
{
if
(
appsService
.
data
.
length
>
0
)
{
this
.
selectApp
(
appsService
.
data
[
0
].
id
);
this
.
selectApp
(
appsService
.
data
[
0
].
id
);
let
tmp
=
this
.
appsService
.
data
.
filter
((
v
)
=>
v
.
id
===
this
.
routingService
.
app
);
let
tmp
=
this
.
appsService
.
data
.
filter
((
v
)
=>
v
.
id
===
this
.
routingService
.
app
);
//console.log(tmp);
//console.log(tmp);
...
@@ -27,20 +27,31 @@ export class AppsComponent {
...
@@ -27,20 +27,31 @@ export class AppsComponent {
let
data
=
this
.
appsService
.
data
;
let
data
=
this
.
appsService
.
data
;
let
apps
;
let
apps
;
if
(
data
)
{
if
(
data
)
{
apps
=
this
.
appsService
.
data
.
filter
((
app
)
=>
{
apps
=
this
.
appsService
.
data
.
filter
((
app
)
=>
{
return
contains
.
includes
(
app
.
category
);
return
contains
.
includes
(
app
.
category
);
});
});
}
}
return
apps
;
return
apps
||
[]
;
}
}
selectApp
(
id
)
{
selectApp
(
id
)
{
this
.
routingService
.
app
=
id
;
this
.
routingService
.
app
=
id
;
this
.
appsService
.
createInstallConfig
(
id
);
this
.
appsService
.
createInstallConfig
(
id
);
}
get
grouped_apps
()
{
let
result
=
{
'
installed
'
:
[],
'
not_installed
'
:
[]};
for
(
let
app
of
this
.
apps
)
{
if
(
app
.
local
)
{
result
.
installed
.
push
(
app
)
}
else
{
result
.
not_installed
.
push
(
app
)
}
}
return
result
}
}
}
}
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