Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wrr-cat
apollo
提交
a002fa82
apollo
项目概览
wrr-cat
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a002fa82
编写于
3月 06, 2017
作者:
J
Jason Song
提交者:
GitHub
3月 06, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #555 from lepdou/optimize_portal
check item value hidden chars
上级
91a6893c
d20d8a85
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
87 addition
and
30 deletion
+87
-30
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigBaseInfoController.js
...tic/scripts/controller/config/ConfigBaseInfoController.js
+24
-22
apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js
...esources/static/scripts/directive/item-modal-directive.js
+48
-5
apollo-portal/src/main/resources/static/styles/common-style.css
...-portal/src/main/resources/static/styles/common-style.css
+4
-1
apollo-portal/src/main/resources/static/views/component/item-modal.html
...src/main/resources/static/views/component/item-modal.html
+9
-1
apollo-portal/src/main/resources/static/views/component/namespace-panel-master-tab.html
...es/static/views/component/namespace-panel-master-tab.html
+2
-1
未找到文件。
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigBaseInfoController.js
浏览文件 @
a002fa82
...
...
@@ -15,6 +15,7 @@ function ConfigBaseInfoController($rootScope, $scope, $window, $location, toastr
if
(
!
appId
)
{
$window
.
location
.
href
=
'
/index.html
'
;
return
;
}
initPage
();
...
...
@@ -51,6 +52,7 @@ function ConfigBaseInfoController($rootScope, $scope, $window, $location, toastr
}
function
loadAppInfo
()
{
$scope
.
notFoundApp
=
true
;
AppService
.
load
(
$rootScope
.
pageContext
.
appId
).
then
(
function
(
result
)
{
$scope
.
notFoundApp
=
false
;
...
...
@@ -60,40 +62,40 @@ function ConfigBaseInfoController($rootScope, $scope, $window, $location, toastr
loadNavTree
();
recordVisitApp
();
findMissEnvs
();
$
(
"
.J_appFound
"
).
removeClass
(
"
hidden
"
);
},
function
(
result
)
{
$
(
"
.J_appNotFound
"
).
removeClass
(
"
hidden
"
);
});
}
$scope
.
createAppInMissEnv
=
function
()
{
var
count
=
0
;
$scope
.
missEnvs
.
forEach
(
function
(
env
)
{
AppService
.
create_remote
(
env
,
$scope
.
appBaseInfo
).
then
(
function
(
result
)
{
toastr
.
success
(
env
,
'
创建成功
'
);
count
++
;
if
(
count
==
$scope
.
missEnvs
.
length
)
{
location
.
reload
(
true
);
}
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
'
创建失败:
'
+
env
);
count
++
;
if
(
count
==
$scope
.
missEnvs
.
length
)
{
location
.
reload
(
true
);
}
});
});
};
////// 补缺失的环境 //////
function
findMissEnvs
()
{
$scope
.
missEnvs
=
[];
AppService
.
find_miss_envs
(
$rootScope
.
pageContext
.
appId
).
then
(
function
(
result
)
{
$scope
.
missEnvs
=
AppUtil
.
collectData
(
result
);
},
function
(
result
)
{
});
$scope
.
createAppInMissEnv
=
function
()
{
var
count
=
0
;
$scope
.
missEnvs
.
forEach
(
function
(
env
)
{
AppService
.
create_remote
(
env
,
$scope
.
appBaseInfo
).
then
(
function
(
result
)
{
toastr
.
success
(
env
,
'
创建成功
'
);
count
++
;
if
(
count
==
$scope
.
missEnvs
.
length
)
{
location
.
reload
(
true
);
}
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
'
创建失败:
'
+
env
);
count
++
;
if
(
count
==
$scope
.
missEnvs
.
length
)
{
location
.
reload
(
true
);
}
});
});
};
}
function
recordVisitApp
()
{
//save user recent visited apps
var
VISITED_APPS_STORAGE_KEY
=
"
VisitedAppsV2
"
;
...
...
apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js
浏览文件 @
a002fa82
directive_module
.
directive
(
'
itemmodal
'
,
itemModalDirective
);
function
itemModalDirective
(
toastr
,
AppUtil
,
EventManager
,
ConfigService
)
{
function
itemModalDirective
(
toastr
,
$sce
,
AppUtil
,
EventManager
,
ConfigService
)
{
return
{
restrict
:
'
E
'
,
templateUrl
:
'
../../views/component/item-modal.html
'
,
...
...
@@ -15,7 +15,6 @@ function itemModalDirective(toastr, AppUtil, EventManager, ConfigService) {
},
link
:
function
(
scope
)
{
var
TABLE_VIEW_OPER_TYPE
=
{
CREATE
:
'
create
'
,
UPDATE
:
'
update
'
...
...
@@ -23,6 +22,13 @@ function itemModalDirective(toastr, AppUtil, EventManager, ConfigService) {
scope
.
doItem
=
doItem
;
scope
.
collectSelectedClusters
=
collectSelectedClusters
;
scope
.
showHiddenChars
=
showHiddenChars
;
$
(
'
#itemModal
'
).
on
(
'
show.bs.modal
'
,
function
(
e
)
{
scope
.
showHiddenCharsContext
=
false
;
scope
.
hiddenCharCounter
=
0
;
scope
.
valueWithHiddenChars
=
$sce
.
trustAsHtml
(
''
);
});
function
doItem
()
{
...
...
@@ -61,7 +67,6 @@ function itemModalDirective(toastr, AppUtil, EventManager, ConfigService) {
namespace
:
scope
.
toOperationNamespace
});
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"
添加失败
"
);
scope
.
item
.
addItemBtnDisabled
=
false
;
...
...
@@ -97,7 +102,6 @@ function itemModalDirective(toastr, AppUtil, EventManager, ConfigService) {
});
}
}
else
{
if
(
!
scope
.
item
.
comment
)
{
...
...
@@ -114,7 +118,7 @@ function itemModalDirective(toastr, AppUtil, EventManager, ConfigService) {
{
namespace
:
scope
.
toOperationNamespace
});
AppUtil
.
hideModal
(
'
#itemModal
'
);
toastr
.
success
(
"
更新成功, 如需生效请发布
"
);
...
...
@@ -126,9 +130,48 @@ function itemModalDirective(toastr, AppUtil, EventManager, ConfigService) {
}
var
selectedClusters
=
[];
function
collectSelectedClusters
(
data
)
{
selectedClusters
=
data
;
}
function
showHiddenChars
()
{
var
value
=
scope
.
item
.
value
;
if
(
!
value
)
{
return
;
}
var
hiddenCharCounter
=
0
,
valueWithHiddenChars
=
value
;
for
(
var
i
=
0
;
i
<
valueWithHiddenChars
.
length
;
i
++
)
{
var
c
=
valueWithHiddenChars
[
i
];
if
(
isHiddenChar
(
c
))
{
valueWithHiddenChars
=
valueWithHiddenChars
.
replace
(
c
,
viewHiddenChar
);
hiddenCharCounter
++
;
}
}
scope
.
showHiddenCharsContext
=
true
;
scope
.
hiddenCharCounter
=
hiddenCharCounter
;
scope
.
valueWithHiddenChars
=
$sce
.
trustAsHtml
(
valueWithHiddenChars
);
}
function
isHiddenChar
(
c
)
{
return
c
==
'
\t
'
||
c
==
'
\n
'
||
c
==
'
'
;
}
function
viewHiddenChar
(
c
)
{
if
(
c
==
'
\t
'
)
{
return
'
<mark>#制表符#</mark>
'
;
}
else
if
(
c
==
'
\n
'
)
{
return
'
<mark>#换行符#</mark>
'
;
}
else
if
(
c
==
'
'
)
{
return
'
<mark>#空格#</mark>
'
;
}
}
}
}
}
...
...
apollo-portal/src/main/resources/static/styles/common-style.css
浏览文件 @
a002fa82
...
...
@@ -62,6 +62,10 @@ p, td, span {
border-top
:
1px
solid
#ddd
;
}
.bg-info
,
.bg-primary
,
.bg-warning
,
.bg-danger
,
.bg-success
{
padding
:
10px
;
}
.active
{
background
:
#f5f5f5
;
}
...
...
@@ -503,7 +507,6 @@ table th {
background
:
url(../img/add.png)
no-repeat
;
}
.list-group-item
.icon-text
{
background-size
:
20px
;
background-position
:
5%
50%
;
...
...
apollo-portal/src/main/resources/static/views/component/item-modal.html
浏览文件 @
a002fa82
...
...
@@ -6,7 +6,9 @@
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
>
<span
ng-show=
"item.tableViewOperType == 'create' && !toOperationNamespace.isBranch"
>
添加配置项
</span>
<span
ng-show=
"item.tableViewOperType == 'create' && !toOperationNamespace.isBranch"
>
添加配置项
<small
class=
"text-info"
>
(温馨提示: 可以通过文本模式批量添加配置)
</small>
</span>
<span
ng-show=
"item.tableViewOperType == 'create' && toOperationNamespace.isBranch"
>
添加灰度配置项
</span>
<span
ng-show=
"item.tableViewOperType == 'update'"
>
修改配置项
</span>
</h4>
...
...
@@ -33,7 +35,13 @@
ng-required=
"true"
ng-model=
"item.value"
>
</textarea>
注意: 隐藏字符(空格、换行符、制表符Tab)容易导致配置出错,如果需要检测Value中隐藏字符请点击
<a
ng-click=
"showHiddenChars()"
>
检测隐藏字符
</a>
<br>
<div
class=
"bg-info"
ng-show=
"showHiddenCharsContext && hiddenCharCounter == 0"
>
无隐藏字符
</div>
<div
class=
"bg-info"
ng-bind-html=
"valueWithHiddenChars"
ng-show=
"showHiddenCharsContext && hiddenCharCounter > 0"
></div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
Comment
</label>
...
...
apollo-portal/src/main/resources/static/views/component/namespace-panel-master-tab.html
浏览文件 @
a002fa82
...
...
@@ -233,7 +233,8 @@
</thead>
<tbody>
<tr
ng-repeat=
"config in namespace.viewItems |orderBy:col:desc"
ng-if=
"config.item.key"
>
ng-if=
"config.item.key"
ng-class=
"{'warning': !config.item.value}"
>
<td
width=
"8%"
class=
"text-center"
>
<span
class=
"label label-warning no-radius cursor-pointer"
ng-if=
"config.isModified"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"点击查看已发布的值"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录