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
21492011
Commit
21492011
authored
Jan 20, 2017
by
Jason Song
Committed by
GitHub
Jan 20, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #522 from lepdou/fix_0119
add emergency publish confirm dialog
parents
5b2072cd
a9047e47
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
13 deletions
+36
-13
config.html
apollo-portal/src/main/resources/static/config.html
+5
-1
ConfigNamespaceController.js
...ic/scripts/controller/config/ConfigNamespaceController.js
+25
-0
publish-deny-modal-directive.js
.../static/scripts/directive/publish-deny-modal-directive.js
+4
-11
EventManager.js
...rc/main/resources/static/scripts/services/EventManager.js
+2
-1
No files found.
apollo-portal/src/main/resources/static/config.html
View file @
21492011
...
@@ -229,7 +229,7 @@
...
@@ -229,7 +229,7 @@
cluster=
"pageContext.clusterName"
>
cluster=
"pageContext.clusterName"
>
</mergeandpublishmodal>
</mergeandpublishmodal>
<publishdenymodal></publishdenymodal>
<publishdenymodal
env=
"pageContext.env"
></publishdenymodal>
<apolloconfirmdialog
apollo-dialog-id=
"'deleteConfirmDialog'"
apollo-title=
"'删除配置'"
<apolloconfirmdialog
apollo-dialog-id=
"'deleteConfirmDialog'"
apollo-title=
"'删除配置'"
apollo-detail=
"'确定要删除配置吗?'"
apollo-detail=
"'确定要删除配置吗?'"
...
@@ -256,6 +256,10 @@
...
@@ -256,6 +256,10 @@
apollo-detail=
"'确定要回滚吗?'"
apollo-detail=
"'确定要回滚吗?'"
apollo-show-cancel-btn=
"true"
apollo-confirm=
"rollback"
></apolloconfirmdialog>
apollo-show-cancel-btn=
"true"
apollo-confirm=
"rollback"
></apolloconfirmdialog>
<apolloconfirmdialog
apollo-dialog-id=
"'emergencyPublishAlertDialog'"
apollo-title=
"'紧急发布'"
apollo-detail=
"'确定要紧急发布吗?'"
apollo-show-cancel-btn=
"true"
apollo-confirm=
"emergencyPublish"
></apolloconfirmdialog>
<apolloconfirmdialog
apollo-dialog-id=
"'deleteBranchDialog'"
apollo-title=
"'删除灰度'"
<apolloconfirmdialog
apollo-dialog-id=
"'deleteBranchDialog'"
apollo-title=
"'删除灰度'"
apollo-detail=
"'删除灰度会丢失灰度的配置,确定要删除吗?'"
apollo-detail=
"'删除灰度会丢失灰度的配置,确定要删除吗?'"
apollo-show-cancel-btn=
"true"
apollo-confirm=
"deleteBranch"
></apolloconfirmdialog>
apollo-show-cancel-btn=
"true"
apollo-confirm=
"deleteBranch"
></apolloconfirmdialog>
...
...
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js
View file @
21492011
...
@@ -19,6 +19,7 @@ function controller($rootScope, $scope, toastr, AppUtil, EventManager, ConfigSer
...
@@ -19,6 +19,7 @@ function controller($rootScope, $scope, toastr, AppUtil, EventManager, ConfigSer
$scope
.
deleteBranch
=
deleteBranch
;
$scope
.
deleteBranch
=
deleteBranch
;
$scope
.
showNoModifyPermissionDialog
=
showNoModifyPermissionDialog
;
$scope
.
showNoModifyPermissionDialog
=
showNoModifyPermissionDialog
;
$scope
.
lockCheck
=
lockCheck
;
$scope
.
lockCheck
=
lockCheck
;
$scope
.
emergencyPublish
=
emergencyPublish
;
init
();
init
();
...
@@ -312,6 +313,30 @@ function controller($rootScope, $scope, toastr, AppUtil, EventManager, ConfigSer
...
@@ -312,6 +313,30 @@ function controller($rootScope, $scope, toastr, AppUtil, EventManager, ConfigSer
}
}
EventManager
.
subscribe
(
EventManager
.
EventType
.
EMERGENCY_PUBLISH
,
function
(
context
)
{
AppUtil
.
showModal
(
"#emergencyPublishAlertDialog"
);
$scope
.
emergencyPublishContext
=
context
;
});
function
emergencyPublish
()
{
if
(
$scope
.
emergencyPublishContext
.
mergeAndPublish
)
{
EventManager
.
emit
(
EventManager
.
EventType
.
MERGE_AND_PUBLISH_NAMESPACE
,
{
branch
:
$scope
.
emergencyPublishContext
.
namespace
,
isEmergencyPublish
:
true
});
}
else
{
EventManager
.
emit
(
EventManager
.
EventType
.
PUBLISH_NAMESPACE
,
{
namespace
:
$scope
.
emergencyPublishContext
.
namespace
,
isEmergencyPublish
:
true
});
}
}
new
Clipboard
(
'.clipboard'
);
new
Clipboard
(
'.clipboard'
);
}
}
...
...
apollo-portal/src/main/resources/static/scripts/directive/publish-deny-modal-directive.js
View file @
21492011
...
@@ -7,6 +7,7 @@ function publishDenyDirective(AppUtil, EventManager) {
...
@@ -7,6 +7,7 @@ function publishDenyDirective(AppUtil, EventManager) {
transclude
:
true
,
transclude
:
true
,
replace
:
true
,
replace
:
true
,
scope
:
{
scope
:
{
env
:
"="
},
},
link
:
function
(
scope
)
{
link
:
function
(
scope
)
{
var
MODAL_ID
=
"#publishDenyModal"
;
var
MODAL_ID
=
"#publishDenyModal"
;
...
@@ -22,19 +23,11 @@ function publishDenyDirective(AppUtil, EventManager) {
...
@@ -22,19 +23,11 @@ function publishDenyDirective(AppUtil, EventManager) {
function
emergencyPublish
()
{
function
emergencyPublish
()
{
AppUtil
.
hideModal
(
MODAL_ID
);
AppUtil
.
hideModal
(
MODAL_ID
);
if
(
scope
.
mergeAndPublish
)
{
EventManager
.
emit
(
EventManager
.
EventType
.
EMERGENCY_PUBLISH
,
EventManager
.
emit
(
EventManager
.
EventType
.
MERGE_AND_PUBLISH_NAMESPACE
,
{
{
branch
:
scope
.
toReleaseNamespace
,
mergeAndPublish
:
scope
.
mergeAndPublish
,
isEmergencyPublish
:
tru
e
namespace
:
scope
.
toReleaseNamespac
e
});
});
}
else
{
EventManager
.
emit
(
EventManager
.
EventType
.
PUBLISH_NAMESPACE
,
{
namespace
:
scope
.
toReleaseNamespace
,
isEmergencyPublish
:
true
});
}
}
}
}
}
...
...
apollo-portal/src/main/resources/static/scripts/services/EventManager.js
View file @
21492011
...
@@ -132,7 +132,8 @@ appService.service('EventManager', [function () {
...
@@ -132,7 +132,8 @@ appService.service('EventManager', [function () {
ROLLBACK_NAMESPACE
:
'rollback_namespace'
,
ROLLBACK_NAMESPACE
:
'rollback_namespace'
,
EDIT_GRAY_RELEASE_RULES
:
'edit_gray_release_rules'
,
EDIT_GRAY_RELEASE_RULES
:
'edit_gray_release_rules'
,
UPDATE_GRAY_RELEASE_RULES
:
'update_gray_release_rules'
,
UPDATE_GRAY_RELEASE_RULES
:
'update_gray_release_rules'
,
PUBLISH_DENY
:
'publish_deny'
PUBLISH_DENY
:
'publish_deny'
,
EMERGENCY_PUBLISH
:
'emergency_publish'
}
}
}
}
...
...
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