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
9936e2f2
Commit
9936e2f2
authored
Sep 20, 2016
by
zhangle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: update other cluster's item
parent
15e41ed3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
ConfigNamespaceController.js
...ic/scripts/controller/config/ConfigNamespaceController.js
+22
-20
No files found.
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js
View file @
9936e2f2
...
...
@@ -72,8 +72,6 @@ application_module.controller("ConfigNamespaceController",
}
function
refreshNamespaces
(
viewType
)
{
if
(
$rootScope
.
pageContext
.
env
==
''
)
{
return
;
...
...
@@ -173,7 +171,6 @@ application_module.controller("ConfigNamespaceController",
$
(
"#rollbackAlertDialog"
).
modal
(
'show'
);
}
$scope
.
toRollbackNamespace
=
{};
function
preRollback
(
namespace
)
{
$scope
.
toRollbackNamespace
=
namespace
;
...
...
@@ -181,7 +178,8 @@ application_module.controller("ConfigNamespaceController",
ReleaseService
.
findActiveReleases
(
$rootScope
.
pageContext
.
appId
,
$rootScope
.
pageContext
.
env
,
$rootScope
.
pageContext
.
clusterName
,
$scope
.
toRollbackNamespace
.
baseInfo
.
namespaceName
,
0
,
2
)
$scope
.
toRollbackNamespace
.
baseInfo
.
namespaceName
,
0
,
2
)
.
then
(
function
(
result
)
{
if
(
result
.
length
<=
1
)
{
toastr
.
error
(
"没有可以回滚的发布历史"
);
...
...
@@ -290,11 +288,13 @@ application_module.controller("ConfigNamespaceController",
if
(
selectedClusters
.
length
==
0
)
{
toastr
.
error
(
"请选择集群"
);
}
else
{
return
;
}
if
(
!
$scope
.
item
.
value
)
{
$scope
.
item
.
value
=
""
;
}
selectedClusters
.
forEach
(
function
(
cluster
)
{
if
(
$scope
.
tableViewOperType
==
TABLE_VIEW_OPER_TYPE
.
CREATE
)
{
//check key unique
...
...
@@ -311,31 +311,33 @@ application_module.controller("ConfigNamespaceController",
}
$scope
.
addItemBtnDisabled
=
true
;
selectedClusters
.
forEach
(
function
(
cluster
)
{
ConfigService
.
create_item
(
$rootScope
.
pageContext
.
appId
,
cluster
.
env
,
cluster
.
name
,
toOperationNamespace
.
baseInfo
.
namespaceName
,
$scope
.
item
).
then
(
function
(
result
)
{
toastr
.
success
(
cluster
.
env
+
" , "
+
$scope
.
item
.
key
,
"添加成功"
);
itemModal
.
modal
(
'hide'
);
$scope
.
addItemBtnDisabled
=
false
;
$rootScope
.
refreshNamespaces
(
namespace_view_type
.
TABLE
);
toastr
.
success
(
cluster
.
env
+
" , "
+
$scope
.
item
.
key
,
"添加成功"
);
},
function
(
result
)
{
$scope
.
addItemBtnDisabled
=
false
;
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"添加失败"
);
});
});
}
else
if
(
$scope
.
tableViewOperType
==
TABLE_VIEW_OPER_TYPE
.
UPDATE
)
{
$scope
.
addItemBtnDisabled
=
false
;
itemModal
.
modal
(
'hide'
);
$rootScope
.
refreshNamespaces
(
namespace_view_type
.
TABLE
);
}
else
{
if
(
!
$scope
.
item
.
comment
)
{
$scope
.
item
.
comment
=
""
;
}
ConfigService
.
update_item
(
$rootScope
.
pageContext
.
appId
,
cluster
.
env
,
cluster
.
n
ame
,
$rootScope
.
pageContext
.
env
,
$rootScope
.
pageContext
.
clusterN
ame
,
toOperationNamespace
.
baseInfo
.
namespaceName
,
$scope
.
item
).
then
(
function
(
result
)
{
...
...
@@ -346,8 +348,6 @@ application_module.controller("ConfigNamespaceController",
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"更新失败"
);
});
}
});
}
}
...
...
@@ -362,12 +362,12 @@ application_module.controller("ConfigNamespaceController",
function
closeTip
(
clusterName
)
{
var
hideTip
=
JSON
.
parse
(
localStorage
.
getItem
(
"hideTip"
));
if
(
!
hideTip
){
if
(
!
hideTip
)
{
hideTip
=
{};
hideTip
[
$rootScope
.
pageContext
.
appId
]
=
{};
}
if
(
!
hideTip
[
$rootScope
.
pageContext
.
appId
]){
if
(
!
hideTip
[
$rootScope
.
pageContext
.
appId
])
{
hideTip
[
$rootScope
.
pageContext
.
appId
]
=
{};
}
...
...
@@ -387,5 +387,7 @@ application_module.controller("ConfigNamespaceController",
$
(
'.config-item-container'
).
removeClass
(
'hide'
);
new
Clipboard
(
'.clipboard'
);
}]);
}
]);
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