Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
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
openSource
apollo
Commits
c56c0db7
Commit
c56c0db7
authored
Apr 08, 2016
by
Yiming Liu
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71 from lepdou/v2
文本view 视图切换。修改过的key可以查看旧值
parents
4c0a4889
7fc51e61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
12 deletions
+96
-12
AppConfigController.js
...rces/static/scripts/controller/app/AppConfigController.js
+45
-3
index.html
apollo-portal/src/main/resources/static/views/app/index.html
+51
-9
No files found.
apollo-portal/src/main/resources/static/scripts/controller/app/AppConfigController.js
View file @
c56c0db7
...
@@ -32,18 +32,60 @@ application_module.controller("AppConfigController",
...
@@ -32,18 +32,60 @@ application_module.controller("AppConfigController",
levels
:
99
levels
:
99
});
});
},
function
(
result
)
{
},
function
(
result
)
{
toastr
.
error
(
"加载导航出错
"
);
toastr
.
error
(
"加载导航出错
:"
+
result
);
});
});
///////////
///////////
$scope
.
env
=
'LOCAL'
;
$scope
.
env
=
'LOCAL'
;
$scope
.
clusterName
=
'default'
;
$scope
.
clusterName
=
'default'
;
ConfigService
.
load_all_namespaces
(
$scope
.
appId
,
$scope
.
env
,
$scope
.
clusterName
).
then
(
ConfigService
.
load_all_namespaces
(
$scope
.
appId
,
$scope
.
env
,
$scope
.
clusterName
).
then
(
function
(
result
)
{
function
(
result
)
{
$scope
.
namespaces
=
result
;
$scope
.
namespaces
=
result
;
//初始化视图
if
(
$scope
.
namespaces
){
$scope
.
namespaces
.
forEach
(
function
(
item
){
item
.
viewType
=
'table'
;
})
}
},
function
(
result
)
{
},
function
(
result
)
{
toastr
.
error
(
"加载配置信息出错
"
);
toastr
.
error
(
"加载配置信息出错
:"
+
result
);
});
});
/////////
$scope
.
queryOldValue
=
function
(
key
,
oldValue
)
{
$scope
.
queryKey
=
key
;
if
(
oldValue
==
''
)
{
$scope
.
OldValue
=
key
+
"是新添加的key"
;
}
else
{
$scope
.
OldValue
=
oldValue
;
}
};
$scope
.
switchView
=
function
(
namespace
,
viewType
){
if
(
'textarea'
==
viewType
){
namespace
.
text
=
parseTableModel2Text
(
namespace
);
}
namespace
.
viewType
=
viewType
;
};
function
parseTableModel2Text
(
namespace
){
if
(
!
namespace
.
items
){
return
"无配置信息"
;
}
var
result
=
""
;
namespace
.
items
.
forEach
(
function
(
item
){
if
(
item
.
modified
){
result
+=
"**"
;
}
result
+=
item
.
item
.
key
+
":"
+
item
.
item
.
value
+
" ##"
+
item
.
item
.
comment
+
"
\
n"
;
});
return
result
;
}
}]);
}]);
apollo-portal/src/main/resources/static/views/app/index.html
View file @
c56c0db7
...
@@ -64,13 +64,16 @@
...
@@ -64,13 +64,16 @@
</div>
</div>
<div
class=
"btn-group"
role=
"group"
aria-label=
"..."
>
<div
class=
"btn-group"
role=
"group"
aria-label=
"..."
>
<button
type=
"button"
<button
type=
"button"
class=
"btn btn-default btn-sm J_tableview_btn"
>
文本
class=
"btn btn-default btn-sm J_tableview_btn"
ng-click=
"switchView(namespace, 'textarea')"
>
文本
</button>
</button>
<button
type=
"button"
<button
type=
"button"
class=
"btn btn-default btn-sm J_tableview_btn"
>
表格
class=
"btn btn-default btn-sm J_tableview_btn"
ng-click=
"switchView(namespace, 'table')"
>
表格
</button>
</button>
<button
type=
"button"
<button
type=
"button"
class=
"btn btn-default btn-sm J_historyview_btn"
>
class=
"btn btn-default btn-sm J_historyview_btn"
ng-click=
"switchView(namespace, 'history')"
>
更改日志
更改日志
</button>
</button>
</div>
</div>
...
@@ -86,8 +89,13 @@
...
@@ -86,8 +89,13 @@
</div>
</div>
</header>
</header>
<div
ng-show=
"namespace.viewType == 'textarea'"
>
<textarea
class=
"form-control"
rows=
"20"
>
{{namespace.text}}
</textarea>
</div>
<table
class=
"table table-bordered text-center table-hover"
>
<table
class=
"table table-bordered text-center table-hover"
ng-show=
"namespace.viewType == 'table'"
>
<thead>
<thead>
<tr>
<tr>
<th>
<th>
...
@@ -100,10 +108,10 @@
...
@@ -100,10 +108,10 @@
备注
备注
</th>
</th>
<th>
<th>
最后修改人
最后修改人
</th>
</th>
<th>
<th>
最后修改时间
最后修改时间
</th>
</th>
</tr>
</tr>
</thead>
</thead>
...
@@ -114,23 +122,30 @@
...
@@ -114,23 +122,30 @@
{{config.item.key}}
{{config.item.key}}
</td>
</td>
<td>
<td>
<button
data-placement=
"top"
title=
"查看旧值"
class=
"glyphicon glyphicon-eye-open"
aria-hidden=
"true"
data-toggle=
"modal"
data-target=
"#oldValue"
ng-show=
"config.modified"
ng-click=
"queryOldValue(config.item.key, config.oldValue)"
></button>
{{config.item.value}}
{{config.item.value}}
</td>
</td>
<td>
<td>
{{config.item.comment}}
{{config.item.comment}}
</td>
</td>
<td>
<td>
{{config.item.dataChangeLastModifiedBy}}
{{config.item.dataChangeLastModifiedBy}}
</td>
</td>
<td>
<td>
{{config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'}}
{{config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'}}
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
<!--历史修改视图-->
<!--历史修改视图-->
<div
class=
"J_historyview
Hide historyview
"
>
<div
class=
"J_historyview
historyview"
ng-show=
"namespace.viewType == 'history'
"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-11 col-md-offset-1 list"
style=
""
>
<div
class=
"col-md-11 col-md-offset-1 list"
style=
""
>
<div
class=
"media"
>
<div
class=
"media"
>
...
@@ -180,12 +195,33 @@
...
@@ -180,12 +195,33 @@
</div>
</div>
</div>
</div>
<!-- Modal -->
<div
class=
"modal fade "
id=
"oldValue"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
>
<div
class=
"modal-dialog modal-sm"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header panel-primary"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
旧值
</h4>
</div>
<div
class=
"modal-body"
>
{{OldValue}}
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
ng-include=
"'../common/footer.html'"
></div>
<div
ng-include=
"'../common/footer.html'"
></div>
<!-- jquery.js -->
<!-- jquery.js -->
<script
src=
"../../vendor/jquery.js"
type=
"text/javascript"
></script>
<script
src=
"../../vendor/jquery.js"
type=
"text/javascript"
></script>
...
@@ -217,5 +253,11 @@
...
@@ -217,5 +253,11 @@
<!--controller-->
<!--controller-->
<script
type=
"application/javascript"
src=
"../../scripts/controller/app/AppConfigController.js"
></script>
<script
type=
"application/javascript"
src=
"../../scripts/controller/app/AppConfigController.js"
></script>
<script
type=
"application/javascript"
>
$
(
function
()
{
$
(
'[data-toggle="tooltip"]'
).
tooltip
()
})
</script>
</body>
</body>
</html>
</html>
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