Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
c809ec1c
Commit
c809ec1c
authored
Feb 19, 2019
by
Grandschtroumpf
Committed by
yann300
Mar 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update style for plugin manager
parent
fe313515
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
20 deletions
+54
-20
plugin-manager-component.js
src/app/components/plugin-manager-component.js
+54
-20
No files found.
src/app/components/plugin-manager-component.js
View file @
c809ec1c
...
...
@@ -4,8 +4,21 @@ const csjs = require('csjs-inject')
const
EventEmitter
=
require
(
'events'
)
const
css
=
csjs
`
.plugin
Manager
{
.plugin
Search
{
padding: 10px;
position: sticky;
top: 0;
z-index: 2;
}
.displayName {
text-transform: capitalize;
}
.description {
text-transform: capitalize;
}
.row {
display: flex;
flex-direction: row;
}
`
...
...
@@ -44,23 +57,29 @@ class PluginManagerComponent {
this
.
store
.
event
.
on
(
'remove'
,
(
entity
)
=>
{
this
.
reRender
()
})
}
renderItem
(
item
)
{
const
mod
=
this
.
store
.
getOne
(
item
)
renderItem
(
name
)
{
const
mod
=
this
.
store
.
getOne
(
name
)
if
(
!
mod
)
return
const
isActive
=
this
.
store
.
actives
.
includes
(
mod
.
profile
.
name
)
const
displayName
=
(
mod
.
profile
.
displayName
)
?
mod
.
profile
.
displayName
:
mod
.
profile
.
name
const
input
=
isActive
?
yo
`<input onchange="
${
_
=>
this
.
appManager
.
deactivateOne
(
item
)}
" checked type="checkbox" class="form-check-input">`
:
yo
`<input onchange="
${
_
=>
this
.
appManager
.
activateOne
(
item
)}
" type="checkbox" class="form-check-input">`
const
isActive
=
this
.
store
.
actives
.
includes
(
name
)
const
displayName
=
(
mod
.
profile
.
displayName
)
?
mod
.
profile
.
displayName
:
name
const
activationButton
=
isActive
?
yo
`
<button onclick="
${
_
=>
this
.
appManager
.
deactivateOne
(
name
)}
" class="btn btn-secondary btn-sm">
Deactivate
</button>`
:
yo
`
<button onclick="
${
_
=>
this
.
appManager
.
activateOne
(
name
)}
" class="btn btn-primary btn-sm">
Activate
</button>`
return
yo
`
<article class="
plugin" id="
${
mod
.
profile
.
name
}
" title="
${
item
}
" >
<div
id="
${
mod
.
profile
.
name
}
Activation" class="form-check row
align-items-center">
${
input
}
<h6 class="form-check-label">
${
displayName
}
</h6>
<article class="
list-group-item" title="
${
name
}
" >
<div
class="
${
css
.
row
}
justify-content-between
align-items-center">
<h6 class="
${
css
.
displayName
}
">
${
displayName
}
</h6>
${
activationButton
}
</div>
<p>
${
mod
.
profile
.
description
}
</p>
<p
class="
${
css
.
description
}
"
>
${
mod
.
profile
.
description
}
</p>
</article>
`
}
...
...
@@ -87,24 +106,39 @@ class PluginManagerComponent {
},
{
actives
:
[],
inactives
:
[]
})
const
activeTile
=
actives
.
length
!==
0
?
yo
`<h3>Active Modules</h3>`
?
yo
`
<nav class="navbar navbar-expand-lg navbar-light bg-light justify-content-between align-items-center">
<span class="navbar-brand">Active Modules</span>
<span class="badge badge-pill badge-primary">
${
actives
.
length
}
</span>
</nav>`
:
''
const
inactiveTile
=
inactives
.
length
!==
0
?
yo
`<h3>Inactive Modules</h3>`
?
yo
`
<nav class="navbar navbar-expand-lg navbar-light bg-light justify-content-between align-items-center">
<span class="navbar-brand">Inactive Modules</span>
<span class="badge badge-pill badge-primary">
${
inactives
.
length
}
</span>
</nav>`
:
''
const
rootView
=
yo
`
<section id="
${
css
.
pluginManager
}
">
<h2>Plugin Manager</h2>
<hr/>
<div class="form-group">
<div>
<header class="navbar navbar-dark bg-dark">
<h2 class="navbar-brand">Plugin Manager</h2>
</header>
<div class="form-group
${
css
.
pluginSearch
}
">
<input onkeyup="
${
e
=>
this
.
filterPlugins
(
e
)}
" class="form-control" placeholder='Search'>
</div>
<section>
${
activeTile
}
<div class="list-group list-group-flush">
${
actives
.
map
(
name
=>
this
.
renderItem
(
name
))}
</div>
${
inactiveTile
}
<div class="list-group list-group-flush">
${
inactives
.
map
(
name
=>
this
.
renderItem
(
name
))}
</div>
</section>
</div>
`
if
(
!
this
.
views
.
root
)
this
.
views
.
root
=
rootView
return
rootView
...
...
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