Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
71584552
Commit
71584552
authored
5 years ago
by
sameer79
Committed by
Sarath Subramanian
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS:3456 : Allows user to add label in entity detail page.
parent
4952a560
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
535 additions
and
47 deletions
+535
-47
common.scss
dashboardv2/public/css/scss/common.scss
+11
-2
panel.scss
dashboardv2/public/css/scss/panel.scss
+8
-8
VEntity.js
dashboardv2/public/js/models/VEntity.js
+9
-2
DetailPageLayoutView_tmpl.html
...c/js/templates/detail_page/DetailPageLayoutView_tmpl.html
+1
-0
EntityLabelDefineView_tmpl.html
...ublic/js/templates/entity/EntityLabelDefineView_tmpl.html
+97
-0
Statistics_tmpl.html
dashboardv2/public/js/templates/site/Statistics_tmpl.html
+5
-6
UrlLinks.js
dashboardv2/public/js/utils/UrlLinks.js
+4
-2
DetailPageLayoutView.js
...ardv2/public/js/views/detail_page/DetailPageLayoutView.js
+10
-2
EntityDetailTableLayoutView.js
...dv2/public/js/views/entity/EntityDetailTableLayoutView.js
+2
-1
EntityLabelDefineView.js
dashboardv2/public/js/views/entity/EntityLabelDefineView.js
+120
-0
EntityUserDefineView.js
dashboardv2/public/js/views/entity/EntityUserDefineView.js
+1
-1
common.scss
dashboardv3/public/css/scss/common.scss
+11
-2
panel.scss
dashboardv3/public/css/scss/panel.scss
+8
-8
VEntity.js
dashboardv3/public/js/models/VEntity.js
+9
-2
DetailPageLayoutView_tmpl.html
...c/js/templates/detail_page/DetailPageLayoutView_tmpl.html
+1
-0
EntityLabelDefineView_tmpl.html
...ublic/js/templates/entity/EntityLabelDefineView_tmpl.html
+97
-0
Statistics_tmpl.html
dashboardv3/public/js/templates/site/Statistics_tmpl.html
+5
-6
UrlLinks.js
dashboardv3/public/js/utils/UrlLinks.js
+4
-2
DetailPageLayoutView.js
...ardv3/public/js/views/detail_page/DetailPageLayoutView.js
+9
-1
EntityDetailTableLayoutView.js
...dv3/public/js/views/entity/EntityDetailTableLayoutView.js
+2
-1
EntityLabelDefineView.js
dashboardv3/public/js/views/entity/EntityLabelDefineView.js
+120
-0
EntityUserDefineView.js
dashboardv3/public/js/views/entity/EntityUserDefineView.js
+1
-1
No files found.
dashboardv2/public/css/scss/common.scss
View file @
71584552
...
...
@@ -228,16 +228,18 @@ pre {
.custom-col-0
{
text-align
:
center
;
vertical-align
:
middle
;
line-height
:
31px
;
width
:
2%
;
}
.custom-col-1
{
width
:
4
3
%
;
width
:
4
0
%
;
}
.custom-col-2
{
text-align
:
center
;
width
:
10%
;
width
:
12%
;
margin-left
:
2%
;
}
}
}
...
...
@@ -245,3 +247,10 @@ pre {
.errorMsg
{
color
:
$red
;
}
.badge-default
{
background-color
:
$color_havelock_blue_approx
;
color
:
$white
;
font-size
:
12px
;
font-weight
:
normal
;
}
This diff is collapsed.
Click to expand it.
dashboardv2/public/css/scss/panel.scss
View file @
71584552
...
...
@@ -31,7 +31,7 @@
.panel-title
{
font-weight
:
bold
;
padding-top
:
8
px
;
padding-top
:
6
px
;
}
}
...
...
@@ -102,26 +102,26 @@
}
i
.ec-icon
:before
{
content
:
"\f0
78
"
content
:
"\f0
54
"
}
&
.collapsed
,
&
[
aria-expanded
=
"false"
]
{
i
.ec-icon
:before
{
content
:
"\f0
78
"
content
:
"\f0
54
"
}
}
&
[
aria-expanded
=
"true"
]
{
i
.ec-icon
:before
{
content
:
"\f07
7
"
content
:
"\f07
8
"
}
}
}
}
.panel-default.custom-panel
>
.panel-heading
{
color
:
$
black
;
color
:
$
color_jungle_green_approx
;
cursor
:
pointer
;
border-bottom
:
none
;
display
:
inline-block
;
...
...
@@ -129,12 +129,12 @@
.panel-title
{
font-weight
:
normal
;
a
:hover
{
color
:
$
black
;
color
:
$
color_jungle_green_approx
;
opacity
:
0
.7
;
}
}
.btn-group
{
margin-top
:
3
px
;
margin-top
:
4
px
;
}
}
...
...
@@ -151,5 +151,5 @@
border-top
:
none
;
}
.panel-default.custom-panel
>
.panel-heading
>
.btn-group
>
button
{
color
:
$
black
;
color
:
$
color_jungle_green_approx
;
}
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/models/VEntity.js
View file @
71584552
...
...
@@ -87,7 +87,15 @@ define(['require',
dataType
:
'json'
},
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
""
,
options
);
},
saveEntityLabels
:
function
(
guid
,
options
)
{
var
url
=
UrlLinks
.
entityLabelsAPIUrl
(
guid
);
options
=
_
.
extend
({
contentType
:
'application/json'
,
dataType
:
'json'
},
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
"POST"
,
options
);
}
},
{});
return
VEntity
;
});
\ No newline at end of file
});
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
View file @
71584552
...
...
@@ -75,6 +75,7 @@
</div>
<div
class=
"col-md-6"
>
<div
id=
"r_entityUserDefineView"
></div>
<div
id=
"r_entityLabelDefineView"
></div>
</div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/templates/entity/EntityLabelDefineView_tmpl.html
0 → 100644
View file @
71584552
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div
class=
"panel-group"
id=
"accordion"
>
<div
class=
"panel panel-default custom-panel expand_collapse_panel-icon"
data-id=
"userDefineLabel"
>
{{#ifCond labels.length "===" 0}}
<div
class=
"panel-heading collapsed"
data-toggle=
"collapse"
href=
"#collapse3"
aria-expanded=
"false"
style=
"width: 70%"
>
<h4
class=
"panel-title"
>
<a>
Labels
</a>
</h4>
<div
class=
"btn-group pull-left"
>
<button
type=
"button"
title=
"Collapse"
><i
class=
"ec-icon fa"
></i></button>
</div>
</div>
{{else}}
<div
class=
"panel-heading"
data-toggle=
"collapse"
href=
"#collapse3"
aria-expanded=
"true"
style=
"width: 70%"
>
<h4
class=
"panel-title"
>
<a>
Labels
</a>
</h4>
<div
class=
"btn-group pull-left"
>
<button
type=
"button"
title=
"Collapse"
><i
class=
"ec-icon fa"
></i></button>
</div>
</div>
{{/ifCond}}
{{#ifCond readOnlyEntity "===" false}}
<div
class=
"panel-actions"
>
{{#ifCond swapItem "!==" true}}
<button
class=
"btn btn-action btn-sm"
data-id=
"addLabels"
{{#
ifCond
labels
.
length
"==="
0
}}
data-original-title=
"Add User-Defined Labels"
{{
else
}}
data-original-title=
"Edit User-Defined Labels"
{{/
ifCond
}}
>
{{#ifCond labels.length "===" 0}} Add {{else}} Edit {{/ifCond}}
</button>
{{/ifCond}}
{{#ifCond saveLabels "===" true}}
<button
class=
"btn btn-action btn-sm"
data-id=
"saveLabels"
data-original-title=
"Save User-Defined Labels"
>
Save
</button>
{{/ifCond}}
</div>
{{/ifCond}}
<div
id=
"collapse3"
{{#
ifCond
swapItem
"==="
false
}}
class=
"panel-collapse collapse"
{{
else
}}
class=
"panel-collapse collapse in"
{{/
ifCond
}}
>
{{#ifCond labels.length "===" 0}}
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
{{#ifCond swapItem "===" true}}
<select
class=
"form-control"
data-id=
"addLabelOptions"
multiple=
"multiple"
></select>
{{else}}
<div
class=
"badge-container"
>
{{#each labels}}
<label
class=
"label badge-default"
>
{{this}}
</label>
{{/each}}
</div>
{{/ifCond}}
</div>
</div>
</div>
{{/ifCond}}
</div>
{{#ifCond labels.length ">" 0}}
<div
id=
"collapse3"
class=
"panel-collapse collapse in"
>
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
{{#ifCond swapItem "===" true}}
<select
class=
"form-control"
data-id=
"addLabelOptions"
multiple=
"multiple"
></select>
{{else}}
<div
class=
"badge-container"
>
{{#each labels}}
<label
class=
"label badge-default"
>
{{this}}
</label>
{{/each}}
</div>
{{/ifCond}}
</div>
</div>
</div>
</div>
{{/ifCond}}
</div>
</div>
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/templates/site/Statistics_tmpl.html
View file @
71584552
...
...
@@ -15,12 +15,12 @@
* limitations under the License.
-->
<div
class=
"panel-group server-stats-container statsContainer hide"
id=
"accordion"
>
<div
class=
"panel panel-default expand_collapse_panel-icon"
data-id=
"entity"
>
<div
class=
"panel panel-default
custom-panel
expand_collapse_panel-icon"
data-id=
"entity"
>
<div
class=
"panel-heading"
data-toggle=
"collapse"
href=
"#collapse1"
aria-expanded=
"true"
>
<h4
class=
"panel-title"
>
<a>
Entities
<span
class=
"count"
>
(0)
</span></a>
</h4>
<div
class=
"btn-group pull-
righ
t"
>
<div
class=
"btn-group pull-
lef
t"
>
<button
type=
"button"
title=
"Collapse"
><i
class=
"ec-icon fa"
></i></button>
</div>
</div>
...
...
@@ -36,12 +36,12 @@
</div>
</div>
</div>
<div
class=
"panel panel-default expand_collapse_panel-icon"
data-id=
"stats"
>
<div
class=
"panel panel-default
custom-panel
expand_collapse_panel-icon"
data-id=
"stats"
>
<div
class=
"panel-heading"
data-toggle=
"collapse"
href=
"#collapse3"
aria-expanded=
"true"
>
<h4
class=
"panel-title"
>
<a>
Server Statistics
</a>
</h4>
<div
class=
"btn-group pull-
righ
t"
>
<div
class=
"btn-group pull-
lef
t"
>
<button
type=
"button"
title=
"Collapse"
><i
class=
"ec-icon fa"
></i></button>
</div>
</div>
...
...
@@ -90,4 +90,4 @@
</div>
<div
class=
"fontLoader-relative statsLoader show"
>
<i
class=
"fa fa-refresh fa-spin-custom"
></i>
</div>
\ No newline at end of file
</div>
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/utils/UrlLinks.js
View file @
71584552
...
...
@@ -78,6 +78,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
return
entitiesUrl
+=
'?minExtInfo='
+
(
minExtInfo
);
}
},
entityLabelsAPIUrl
:
function
(
guid
)
{
return
this
.
entitiesApiUrl
({
guid
:
guid
})
+
"/labels"
;
},
entityHeaderApiUrl
:
function
(
guid
)
{
return
this
.
entitiesApiUrl
({
guid
:
guid
})
+
"/header"
},
...
...
@@ -221,4 +224,4 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
});
return
UrlLinks
;
});
\ No newline at end of file
});
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js
View file @
71584552
...
...
@@ -47,6 +47,7 @@ define(['require',
RProfileLayoutView
:
"#r_profileLayoutView"
,
RRelationshipLayoutView
:
"#r_relationshipLayoutView"
,
REntityUserDefineView
:
"#r_entityUserDefineView"
,
REntityLabelDefineView
:
"#r_entityLabelDefineView"
},
/** ui selector cache */
ui
:
{
...
...
@@ -196,7 +197,7 @@ define(['require',
if
(
collectionJSON
.
isIncomplete
===
true
)
{
this
.
$
(
".isIncomplete"
).
addClass
(
"show"
);
}
this
.
ui
.
entityIcon
.
attr
(
'title'
,
_
.
escape
(
collectionJSON
.
typeName
)).
html
(
'<img src="'
+
Utils
.
getEntityIconPath
({
entityData
:
entityData
})
+
'"/><i class="fa fa-
refresh fa-spin-custom
"></i>'
).
find
(
"img"
).
on
(
'error'
,
function
()
{
this
.
ui
.
entityIcon
.
attr
(
'title'
,
_
.
escape
(
collectionJSON
.
typeName
)).
html
(
'<img src="'
+
Utils
.
getEntityIconPath
({
entityData
:
entityData
})
+
'"/><i class="fa fa-
hourglass-half
"></i>'
).
find
(
"img"
).
on
(
'error'
,
function
()
{
this
.
src
=
Utils
.
getEntityIconPath
({
entityData
:
entityData
,
errorUrl
:
this
.
src
});
});
}
else
{
...
...
@@ -248,6 +249,7 @@ define(['require',
}
this
.
renderEntityDetailTableLayoutView
(
obj
);
this
.
renderEntityUserDefineView
(
obj
);
this
.
renderEntityLabelDefineView
(
obj
);
this
.
renderRelationshipLayoutView
(
obj
);
this
.
renderAuditTableLayoutView
(
obj
);
this
.
renderTagTableLayoutView
(
obj
);
...
...
@@ -425,7 +427,7 @@ define(['require',
_
.
each
(
data
,
function
(
val
)
{
// if (val.relationshipStatus == "ACTIVE") {
termData
+=
'<span class="btn btn-action btn-sm btn-icon btn-blue" data-id="termClick"><span title='
+
_
.
escape
(
val
.
displayText
)
+
'>'
+
_
.
escape
(
val
.
displayText
)
+
'</span><i class="'
+
(
val
.
relationshipStatus
==
"ACTIVE"
?
'fa fa-close'
:
""
)
+
'" data-id="deleteTerm" data-guid="'
+
val
.
guid
+
'" data-type="term" title="Remove Term"></i></span>'
;
// }
// }
});
this
.
ui
.
termList
.
find
(
"span.btn"
).
remove
();
this
.
ui
.
termList
.
prepend
(
termData
);
...
...
@@ -495,6 +497,12 @@ define(['require',
that
.
REntityUserDefineView
.
show
(
new
EntityUserDefineView
(
obj
));
});
},
renderEntityLabelDefineView
:
function
(
obj
)
{
var
that
=
this
;
require
([
'views/entity/EntityLabelDefineView'
],
function
(
EntityLabelDefineView
)
{
that
.
REntityLabelDefineView
.
show
(
new
EntityLabelDefineView
(
obj
));
});
},
renderTagTableLayoutView
:
function
(
obj
)
{
var
that
=
this
;
require
([
'views/tag/TagDetailTableLayoutView'
],
function
(
TagDetailTableLayoutView
)
{
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js
View file @
71584552
...
...
@@ -83,4 +83,4 @@ define(['require',
}
});
return
EntityDetailTableLayoutView
;
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/entity/EntityLabelDefineView.js
0 → 100644
View file @
71584552
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define
([
'require'
,
'backbone'
,
'hbs!tmpl/entity/EntityLabelDefineView_tmpl'
,
'models/VEntity'
,
'utils/Utils'
,
'utils/Messages'
,
'utils/Enums'
],
function
(
require
,
Backbone
,
EntityLabelDefineView_tmpl
,
VEntity
,
Utils
,
Messages
,
Enums
)
{
'use strict'
;
return
Backbone
.
Marionette
.
LayoutView
.
extend
({
_viewName
:
'REntityLabelDefineView'
,
template
:
EntityLabelDefineView_tmpl
,
templateHelpers
:
function
()
{
return
{
swapItem
:
this
.
swapItem
,
labels
:
this
.
labels
,
saveLabels
:
this
.
saveLabels
,
readOnlyEntity
:
this
.
readOnlyEntity
};
},
ui
:
{
addLabelOptions
:
"[data-id='addLabelOptions']"
,
addLabels
:
"[data-id='addLabels']"
,
saveLabels
:
"[data-id='saveLabels']"
},
events
:
function
()
{
var
events
=
{};
events
[
"change "
+
this
.
ui
.
addLabelOptions
]
=
'onChangeLabelChange'
;
events
[
"click "
+
this
.
ui
.
addLabels
]
=
'handleBtnClick'
;
events
[
"click "
+
this
.
ui
.
saveLabels
]
=
'saveUserDefinedLabels'
;
return
events
;
},
initialize
:
function
(
options
)
{
var
self
=
this
;
_
.
extend
(
this
,
_
.
pick
(
options
,
'entity'
));
this
.
swapItem
=
false
,
this
.
saveLabels
=
false
;
this
.
readOnlyEntity
=
Enums
.
entityStateReadOnly
[
this
.
entity
.
status
]
this
.
entityModel
=
new
VEntity
(
this
.
entity
);
this
.
labels
=
this
.
entity
.
labels
||
[];
},
onRender
:
function
()
{
this
.
populateLabelOptions
();
},
bindEvents
:
function
()
{
},
populateLabelOptions
:
function
()
{
var
that
=
this
,
str
=
this
.
labels
.
map
(
function
(
label
)
{
return
"<option selected > "
+
label
+
" </option>"
;
});
this
.
ui
.
addLabelOptions
.
html
(
str
);
this
.
ui
.
addLabelOptions
.
select2
({
placeholder
:
"Select Label"
,
allowClear
:
true
,
tags
:
true
,
multiple
:
true
});
},
onChangeLabelChange
:
function
()
{
this
.
labels
=
this
.
ui
.
addLabelOptions
.
val
();
},
handleBtnClick
:
function
()
{
this
.
swapItem
=
!
this
.
swapItem
;
this
.
saveLabels
=
this
.
swapItem
===
true
?
true
:
false
;
this
.
render
();
},
saveUserDefinedLabels
:
function
()
{
var
that
=
this
;
var
entityJson
=
that
.
entityModel
.
toJSON
();
var
payload
=
this
.
labels
;
that
.
entityModel
.
saveEntityLabels
(
entityJson
.
guid
,{
data
:
JSON
.
stringify
(
payload
),
type
:
'POST'
,
success
:
function
()
{
var
msg
=
entityJson
.
labels
===
undefined
?
'addSuccessMessage'
:
'editSuccessMessage'
;
if
(
payload
.
length
===
0
)
{
that
.
entityModel
.
unset
(
'labels'
);
}
else
{
that
.
entityModel
.
set
(
'labels'
,
payload
);
}
Utils
.
notifySuccess
({
content
:
"User-defined labels "
+
Messages
[
msg
]
});
that
.
swapItem
=
false
;
that
.
saveLabels
=
false
;
that
.
render
();
},
error
:
function
(
e
)
{
that
.
ui
.
saveLabels
&&
that
.
ui
.
saveLabels
.
length
>
0
&&
that
.
ui
.
saveLabels
[
0
].
setAttribute
(
"disabled"
,
false
);
Utils
.
notifySuccess
({
content
:
e
.
message
});
},
complete
:
function
()
{
that
.
ui
.
saveLabels
&&
that
.
ui
.
saveLabels
.
length
>
0
&&
that
.
ui
.
saveLabels
[
0
].
setAttribute
(
"disabled"
,
false
);
that
.
render
();
}
});
}
});
});
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/entity/EntityUserDefineView.js
View file @
71584552
...
...
@@ -81,7 +81,7 @@ define(['require',
okText
:
'Save'
,
okCloses
:
false
,
cancelText
:
"Cancel"
,
mainClass
:
'modal-
lg
'
,
mainClass
:
'modal-
md
'
,
allowCancel
:
true
,
};
this
.
setAttributeModal
(
modalObj
);
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/css/scss/common.scss
View file @
71584552
...
...
@@ -227,16 +227,18 @@ pre {
.custom-col-0
{
text-align
:
center
;
vertical-align
:
middle
;
line-height
:
31px
;
width
:
2%
;
}
.custom-col-1
{
width
:
4
3
%
;
width
:
4
0
%
;
}
.custom-col-2
{
text-align
:
center
;
width
:
10%
;
width
:
12%
;
margin-left
:
2%
;
}
}
}
...
...
@@ -244,3 +246,10 @@ pre {
.errorMsg
{
color
:
$red
;
}
.badge-default
{
background-color
:
$color_havelock_blue_approx
;
color
:
$white
;
font-size
:
12px
;
font-weight
:
normal
;
}
This diff is collapsed.
Click to expand it.
dashboardv3/public/css/scss/panel.scss
View file @
71584552
...
...
@@ -37,7 +37,7 @@
.panel-title
{
font-weight
:
bold
;
padding-top
:
8
px
;
padding-top
:
6
px
;
}
}
...
...
@@ -117,19 +117,19 @@
}
i
.ec-icon
:before
{
content
:
"\f0
78
"
content
:
"\f0
54
"
}
&
.collapsed
,
&
[
aria-expanded
=
"false"
]
{
i
.ec-icon
:before
{
content
:
"\f0
78
"
content
:
"\f0
54
"
}
}
&
[
aria-expanded
=
"true"
]
{
i
.ec-icon
:before
{
content
:
"\f07
7
"
content
:
"\f07
8
"
}
}
}
...
...
@@ -137,7 +137,7 @@
}
.panel-default.custom-panel
>
.panel-heading
{
color
:
$
black
;
color
:
$
color_jungle_green_approx
;
cursor
:
pointer
;
border-bottom
:
none
;
display
:
inline-block
;
...
...
@@ -145,12 +145,12 @@
.panel-title
{
font-weight
:
normal
;
a
:hover
{
color
:
$
black
;
color
:
$
color_jungle_green_approx
;
opacity
:
0
.7
;
}
}
.btn-group
{
margin-top
:
3
px
;
margin-top
:
4
px
;
}
}
...
...
@@ -167,5 +167,5 @@
border-top
:
none
;
}
.panel-default.custom-panel
>
.panel-heading
>
.btn-group
>
button
{
color
:
$
black
;
color
:
$
color_jungle_green_approx
;
}
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/models/VEntity.js
View file @
71584552
...
...
@@ -87,7 +87,15 @@ define(['require',
dataType
:
'json'
},
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
""
,
options
);
},
saveEntityLabels
:
function
(
guid
,
options
)
{
var
url
=
UrlLinks
.
entityLabelsAPIUrl
(
guid
);
options
=
_
.
extend
({
contentType
:
'application/json'
,
dataType
:
'json'
},
options
);
return
this
.
constructor
.
nonCrudOperation
.
call
(
this
,
url
,
"POST"
,
options
);
}
},
{});
return
VEntity
;
});
\ No newline at end of file
});
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
View file @
71584552
...
...
@@ -78,6 +78,7 @@
</div>
<div
class=
"col-md-6"
>
<div
id=
"r_entityUserDefineView"
></div>
<div
id=
"r_entityLabelDefineView"
></div>
</div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/entity/EntityLabelDefineView_tmpl.html
0 → 100644
View file @
71584552
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div
class=
"panel-group"
id=
"accordion"
>
<div
class=
"panel panel-default custom-panel expand_collapse_panel-icon"
data-id=
"userDefineLabel"
>
{{#ifCond labels.length "===" 0}}
<div
class=
"panel-heading collapsed"
data-toggle=
"collapse"
href=
"#collapse3"
aria-expanded=
"false"
style=
"width: 70%"
>
<h4
class=
"panel-title"
>
<a>
Labels
</a>
</h4>
<div
class=
"btn-group pull-left"
>
<button
type=
"button"
title=
"Collapse"
><i
class=
"ec-icon fa"
></i></button>
</div>
</div>
{{else}}
<div
class=
"panel-heading"
data-toggle=
"collapse"
href=
"#collapse3"
aria-expanded=
"true"
style=
"width: 70%"
>
<h4
class=
"panel-title"
>
<a>
Labels
</a>
</h4>
<div
class=
"btn-group pull-left"
>
<button
type=
"button"
title=
"Collapse"
><i
class=
"ec-icon fa"
></i></button>
</div>
</div>
{{/ifCond}}
{{#ifCond readOnlyEntity "===" false}}
<div
class=
"panel-actions"
>
{{#ifCond swapItem "!==" true}}
<button
class=
"btn btn-action btn-sm"
data-id=
"addLabels"
{{#
ifCond
labels
.
length
"==="
0
}}
data-original-title=
"Add User-Defined Labels"
{{
else
}}
data-original-title=
"Edit User-Defined Labels"
{{/
ifCond
}}
>
{{#ifCond labels.length "===" 0}} Add {{else}} Edit {{/ifCond}}
</button>
{{/ifCond}}
{{#ifCond saveLabels "===" true}}
<button
class=
"btn btn-action btn-sm"
data-id=
"saveLabels"
data-original-title=
"Save User-Defined Labels"
>
Save
</button>
{{/ifCond}}
</div>
{{/ifCond}}
<div
id=
"collapse3"
{{#
ifCond
swapItem
"==="
false
}}
class=
"panel-collapse collapse"
{{
else
}}
class=
"panel-collapse collapse in"
{{/
ifCond
}}
>
{{#ifCond labels.length "===" 0}}
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
{{#ifCond swapItem "===" true}}
<select
class=
"form-control"
data-id=
"addLabelOptions"
multiple=
"multiple"
></select>
{{else}}
<div
class=
"badge-container"
>
{{#each labels}}
<label
class=
"label badge-default"
>
{{this}}
</label>
{{/each}}
</div>
{{/ifCond}}
</div>
</div>
</div>
{{/ifCond}}
</div>
{{#ifCond labels.length ">" 0}}
<div
id=
"collapse3"
class=
"panel-collapse collapse in"
>
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
{{#ifCond swapItem "===" true}}
<select
class=
"form-control"
data-id=
"addLabelOptions"
multiple=
"multiple"
></select>
{{else}}
<div
class=
"badge-container"
>
{{#each labels}}
<label
class=
"label badge-default"
>
{{this}}
</label>
{{/each}}
</div>
{{/ifCond}}
</div>
</div>
</div>
</div>
{{/ifCond}}
</div>
</div>
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/templates/site/Statistics_tmpl.html
View file @
71584552
...
...
@@ -15,12 +15,12 @@
* limitations under the License.
-->
<div
class=
"panel-group server-stats-container statsContainer hide"
id=
"accordion"
>
<div
class=
"panel panel-default expand_collapse_panel-icon"
data-id=
"entity"
>
<div
class=
"panel panel-default
custom-panel
expand_collapse_panel-icon"
data-id=
"entity"
>
<div
class=
"panel-heading"
data-toggle=
"collapse"
href=
"#collapse1"
aria-expanded=
"true"
>
<h4
class=
"panel-title"
>
<a>
Entities
<span
class=
"count"
>
(0)
</span></a>
</h4>
<div
class=
"btn-group pull-
righ
t"
>
<div
class=
"btn-group pull-
lef
t"
>
<button
type=
"button"
title=
"Collapse"
><i
class=
"ec-icon fa"
></i></button>
</div>
</div>
...
...
@@ -36,12 +36,12 @@
</div>
</div>
</div>
<div
class=
"panel panel-default expand_collapse_panel-icon"
data-id=
"stats"
>
<div
class=
"panel panel-default
custom-panel
expand_collapse_panel-icon"
data-id=
"stats"
>
<div
class=
"panel-heading"
data-toggle=
"collapse"
href=
"#collapse3"
aria-expanded=
"true"
>
<h4
class=
"panel-title"
>
<a>
Server Statistics
</a>
</h4>
<div
class=
"btn-group pull-
righ
t"
>
<div
class=
"btn-group pull-
lef
t"
>
<button
type=
"button"
title=
"Collapse"
><i
class=
"ec-icon fa"
></i></button>
</div>
</div>
...
...
@@ -90,4 +90,4 @@
</div>
<div
class=
"fontLoader-relative statsLoader show"
>
<i
class=
"fa fa-refresh fa-spin-custom"
></i>
</div>
\ No newline at end of file
</div>
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/utils/UrlLinks.js
View file @
71584552
...
...
@@ -79,6 +79,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
return
entitiesUrl
+=
'?minExtInfo='
+
(
minExtInfo
);
}
},
entityLabelsAPIUrl
:
function
(
guid
)
{
return
this
.
entitiesApiUrl
({
guid
:
guid
})
+
"/labels"
;
},
entityHeaderApiUrl
:
function
(
guid
)
{
return
this
.
entitiesApiUrl
({
guid
:
guid
})
+
"/header"
},
...
...
@@ -222,4 +225,4 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
});
return
UrlLinks
;
});
\ No newline at end of file
});
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/detail_page/DetailPageLayoutView.js
View file @
71584552
...
...
@@ -47,6 +47,7 @@ define(['require',
RProfileLayoutView
:
"#r_profileLayoutView"
,
RRelationshipLayoutView
:
"#r_relationshipLayoutView"
,
REntityUserDefineView
:
"#r_entityUserDefineView"
,
REntityLabelDefineView
:
"#r_entityLabelDefineView"
},
/** ui selector cache */
ui
:
{
...
...
@@ -201,7 +202,7 @@ define(['require',
if
(
collectionJSON
.
isIncomplete
===
true
)
{
this
.
$
(
".isIncomplete"
).
addClass
(
"show"
);
}
this
.
ui
.
entityIcon
.
attr
(
'title'
,
_
.
escape
(
collectionJSON
.
typeName
)).
html
(
'<img src="'
+
Utils
.
getEntityIconPath
({
entityData
:
entityData
})
+
'"/><i class="fa fa-
refresh fa-spin-custom
"></i>'
).
find
(
"img"
).
on
(
'error'
,
function
()
{
this
.
ui
.
entityIcon
.
attr
(
'title'
,
_
.
escape
(
collectionJSON
.
typeName
)).
html
(
'<img src="'
+
Utils
.
getEntityIconPath
({
entityData
:
entityData
})
+
'"/><i class="fa fa-
hourglass-half
"></i>'
).
find
(
"img"
).
on
(
'error'
,
function
()
{
this
.
src
=
Utils
.
getEntityIconPath
({
entityData
:
entityData
,
errorUrl
:
this
.
src
});
});
}
else
{
...
...
@@ -254,6 +255,7 @@ define(['require',
}
this
.
renderEntityDetailTableLayoutView
(
obj
);
this
.
renderEntityUserDefineView
(
obj
);
this
.
renderEntityLabelDefineView
(
obj
);
this
.
renderRelationshipLayoutView
(
obj
);
this
.
renderAuditTableLayoutView
(
obj
);
this
.
renderTagTableLayoutView
(
obj
);
...
...
@@ -507,6 +509,12 @@ define(['require',
that
.
REntityUserDefineView
.
show
(
new
EntityUserDefineView
(
obj
));
});
},
renderEntityLabelDefineView
:
function
(
obj
)
{
var
that
=
this
;
require
([
'views/entity/EntityLabelDefineView'
],
function
(
EntityLabelDefineView
)
{
that
.
REntityLabelDefineView
.
show
(
new
EntityLabelDefineView
(
obj
));
});
},
renderTagTableLayoutView
:
function
(
obj
)
{
var
that
=
this
;
require
([
'views/tag/TagDetailTableLayoutView'
],
function
(
TagDetailTableLayoutView
)
{
...
...
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/entity/EntityDetailTableLayoutView.js
View file @
71584552
...
...
@@ -83,4 +83,4 @@ define(['require',
}
});
return
EntityDetailTableLayoutView
;
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/entity/EntityLabelDefineView.js
0 → 100644
View file @
71584552
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
define
([
'require'
,
'backbone'
,
'hbs!tmpl/entity/EntityLabelDefineView_tmpl'
,
'models/VEntity'
,
'utils/Utils'
,
'utils/Messages'
,
'utils/Enums'
],
function
(
require
,
Backbone
,
EntityLabelDefineView_tmpl
,
VEntity
,
Utils
,
Messages
,
Enums
)
{
'use strict'
;
return
Backbone
.
Marionette
.
LayoutView
.
extend
({
_viewName
:
'REntityLabelDefineView'
,
template
:
EntityLabelDefineView_tmpl
,
templateHelpers
:
function
()
{
return
{
swapItem
:
this
.
swapItem
,
labels
:
this
.
labels
,
saveLabels
:
this
.
saveLabels
,
readOnlyEntity
:
this
.
readOnlyEntity
};
},
ui
:
{
addLabelOptions
:
"[data-id='addLabelOptions']"
,
addLabels
:
"[data-id='addLabels']"
,
saveLabels
:
"[data-id='saveLabels']"
},
events
:
function
()
{
var
events
=
{};
events
[
"change "
+
this
.
ui
.
addLabelOptions
]
=
'onChangeLabelChange'
;
events
[
"click "
+
this
.
ui
.
addLabels
]
=
'handleBtnClick'
;
events
[
"click "
+
this
.
ui
.
saveLabels
]
=
'saveUserDefinedLabels'
;
return
events
;
},
initialize
:
function
(
options
)
{
var
self
=
this
;
_
.
extend
(
this
,
_
.
pick
(
options
,
'entity'
));
this
.
swapItem
=
false
,
this
.
saveLabels
=
false
;
this
.
readOnlyEntity
=
Enums
.
entityStateReadOnly
[
this
.
entity
.
status
]
this
.
entityModel
=
new
VEntity
(
this
.
entity
);
this
.
labels
=
this
.
entity
.
labels
||
[];
},
onRender
:
function
()
{
this
.
populateLabelOptions
();
},
bindEvents
:
function
()
{
},
populateLabelOptions
:
function
()
{
var
that
=
this
,
str
=
this
.
labels
.
map
(
function
(
label
)
{
return
"<option selected > "
+
label
+
" </option>"
;
});
this
.
ui
.
addLabelOptions
.
html
(
str
);
this
.
ui
.
addLabelOptions
.
select2
({
placeholder
:
"Select Label"
,
allowClear
:
true
,
tags
:
true
,
multiple
:
true
});
},
onChangeLabelChange
:
function
()
{
this
.
labels
=
this
.
ui
.
addLabelOptions
.
val
();
},
handleBtnClick
:
function
()
{
this
.
swapItem
=
!
this
.
swapItem
;
this
.
saveLabels
=
this
.
swapItem
===
true
?
true
:
false
;
this
.
render
();
},
saveUserDefinedLabels
:
function
()
{
var
that
=
this
;
var
entityJson
=
that
.
entityModel
.
toJSON
();
var
payload
=
this
.
labels
;
that
.
entityModel
.
saveEntityLabels
(
entityJson
.
guid
,{
data
:
JSON
.
stringify
(
payload
),
type
:
'POST'
,
success
:
function
()
{
var
msg
=
entityJson
.
labels
===
undefined
?
'addSuccessMessage'
:
'editSuccessMessage'
;
if
(
payload
.
length
===
0
)
{
that
.
entityModel
.
unset
(
'labels'
);
}
else
{
that
.
entityModel
.
set
(
'labels'
,
payload
);
}
Utils
.
notifySuccess
({
content
:
"User-defined labels "
+
Messages
[
msg
]
});
that
.
swapItem
=
false
;
that
.
saveLabels
=
false
;
that
.
render
();
},
error
:
function
(
e
)
{
that
.
ui
.
saveLabels
&&
that
.
ui
.
saveLabels
.
length
>
0
&&
that
.
ui
.
saveLabels
[
0
].
setAttribute
(
"disabled"
,
false
);
Utils
.
notifySuccess
({
content
:
e
.
message
});
},
complete
:
function
()
{
that
.
ui
.
saveLabels
&&
that
.
ui
.
saveLabels
.
length
>
0
&&
that
.
ui
.
saveLabels
[
0
].
setAttribute
(
"disabled"
,
false
);
that
.
render
();
}
});
}
});
});
This diff is collapsed.
Click to expand it.
dashboardv3/public/js/views/entity/EntityUserDefineView.js
View file @
71584552
...
...
@@ -81,7 +81,7 @@ define(['require',
okText
:
'Save'
,
okCloses
:
false
,
cancelText
:
"Cancel"
,
mainClass
:
'modal-
lg
'
,
mainClass
:
'modal-
md
'
,
allowCancel
:
true
,
};
this
.
setAttributeModal
(
modalObj
);
...
...
This diff is collapsed.
Click to expand it.
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