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
7fc51e61
Commit
7fc51e61
authored
Apr 08, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文本view
parent
761dd307
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
7 deletions
+91
-7
AppConfigController.js
...rces/static/scripts/controller/app/AppConfigController.js
+44
-2
index.html
apollo-portal/src/main/resources/static/views/app/index.html
+47
-5
No files found.
apollo-portal/src/main/resources/static/scripts/controller/app/AppConfigController.js
View file @
7fc51e61
...
@@ -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 @
7fc51e61
...
@@ -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>
...
@@ -114,6 +122,11 @@
...
@@ -114,6 +122,11 @@
{{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>
...
@@ -129,8 +142,10 @@
...
@@ -129,8 +142,10 @@
</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