Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
22188ea3
D
dashboard
项目概览
凌波微步_大先生
/
dashboard
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dashboard
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
22188ea3
编写于
1月 08, 2016
作者:
P
Piotr Bryk
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #157 from cheld/error-dialog
Show simple error dialog
上级
6271624d
24823531
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
83 addition
and
4 deletion
+83
-4
src/app/frontend/common/errorhandling/errordialog_service.js
src/app/frontend/common/errorhandling/errordialog_service.js
+42
-0
src/app/frontend/common/errorhandling/errorhandling_module.js
...app/frontend/common/errorhandling/errorhandling_module.js
+26
-0
src/app/frontend/deploy/createnamespace.html
src/app/frontend/deploy/createnamespace.html
+2
-2
src/app/frontend/deploy/createnamespace_controller.js
src/app/frontend/deploy/createnamespace_controller.js
+11
-2
src/app/frontend/deploy/deploy_module.js
src/app/frontend/deploy/deploy_module.js
+2
-0
未找到文件。
src/app/frontend/common/errorhandling/errordialog_service.js
0 → 100644
浏览文件 @
22188ea3
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed 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.
/**
* Error dialog to display errors which could not be responded properly
*
* @final
*/
export
default
class
ErrorDialog
{
/**
* @param {!md.$dialog} $mdDialog
* @ngInject
*/
constructor
(
$mdDialog
)
{
/** @private {!md.$dialog} */
this
.
mdDialog_
=
$mdDialog
;
}
/**
* Opens a pop-up window that displays the error message
*
* @param {string} message
* @export
*/
open
(
message
)
{
let
alert
=
this
.
mdDialog_
.
alert
();
alert
.
title
(
message
);
alert
.
ok
(
'
Close
'
);
this
.
mdDialog_
.
show
(
alert
);
}
}
src/app/frontend/common/errorhandling/errorhandling_module.js
0 → 100644
浏览文件 @
22188ea3
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed 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.
import
errorDialogService
from
'
./errordialog_service
'
;
/**
* Angular module containing navigation chrome for the application.
*/
export
default
angular
.
module
(
'
kubernetesDashboard.errorhandling
'
,
[
'
ngMaterial
'
,
])
.
service
(
'
errorDialog
'
,
errorDialogService
);
src/app/frontend/deploy/createnamespace.html
浏览文件 @
22188ea3
...
...
@@ -19,7 +19,7 @@ limitations under the License.
<h4
class=
"md-title"
>
Create a new namespace
</h4>
<p>
The new namespace will be added to the cluster.
</p>
<!-- TODO(maciaszczykm): Missing detailed cluster info. -->
<form
name=
"namespaceForm"
ng-submit=
"ctrl.createNamespace()"
<form
name=
"
ctrl.
namespaceForm"
ng-submit=
"ctrl.createNamespace()"
novalidate
>
<md-input-container
class=
"md-block"
>
<label>
Namespace name
</label>
...
...
@@ -27,7 +27,7 @@ limitations under the License.
md-maxlength=
"{{ctrl.namespaceMaxLength}}"
ng-pattern=
"ctrl.namespacePattern"
required
>
<div
ng-messages=
"namespaceForm.namespace.$error"
>
<div
ng-messages=
"
ctrl.
namespaceForm.namespace.$error"
>
<div
ng-message=
"pattern"
>
Name must be alphanumeric and may contain dashes
</div>
<div
ng-message=
"md-maxlength"
>
Name is too long
</div>
<div
ng-message=
"required"
>
Name is required
</div>
...
...
src/app/frontend/deploy/createnamespace_controller.js
浏览文件 @
22188ea3
...
...
@@ -22,10 +22,12 @@ export default class NamespaceDialogController {
* @param {!md.$dialog} $mdDialog
* @param {!angular.$log} $log
* @param {!angular.$resource} $resource
* TODO (cheld) Set correct type after fixing issue #159
* @param {!Object} errorDialog
* @param {!Array<string>} namespaces
* @ngInject
*/
constructor
(
$mdDialog
,
$log
,
$resource
,
namespaces
)
{
constructor
(
$mdDialog
,
$log
,
$resource
,
errorDialog
,
namespaces
)
{
/** @private {!md.$dialog} */
this
.
mdDialog_
=
$mdDialog
;
...
...
@@ -35,6 +37,12 @@ export default class NamespaceDialogController {
/** @private {!angular.$resource} */
this
.
resource_
=
$resource
;
/**
* TODO (cheld) Set correct type after fixing issue #159
* @private {!Object}
*/
this
.
errorDialog_
=
errorDialog
;
/**
* List of available namespaces.
* @export {!Array<string>}
...
...
@@ -93,8 +101,9 @@ export default class NamespaceDialogController {
this
.
mdDialog_
.
hide
(
this
.
namespace
);
},
(
err
)
=>
{
this
.
log_
.
info
(
'
Error creating namespace:
'
,
err
);
this
.
mdDialog_
.
hide
();
this
.
errorDialog_
.
open
(
'
Error creating namespace
'
);
this
.
log_
.
info
(
'
Error creating namespace:
'
,
err
);
});
}
}
src/app/frontend/deploy/deploy_module.js
浏览文件 @
22188ea3
...
...
@@ -13,6 +13,7 @@
// limitations under the License.
import
stateConfig
from
'
./deploy_stateconfig
'
;
import
errorHandlingModule
from
'
../common/errorhandling/errorhandling_module
'
;
import
deployFromSettingsDirective
from
'
./deployfromsettings_directive
'
;
import
deployLabelDirective
from
'
./deploylabel_directive
'
;
import
deployFromFileDirective
from
'
./deployfromfile_directive
'
;
...
...
@@ -33,6 +34,7 @@ export default angular.module(
'
ngResource
'
,
'
ui.router
'
,
helpSectionModule
.
name
,
errorHandlingModule
.
name
,
])
.
config
(
stateConfig
)
.
directive
(
'
deployFromSettings
'
,
deployFromSettingsDirective
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录