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",
...
@@ -72,8 +72,6 @@ application_module.controller("ConfigNamespaceController",
}
}
function
refreshNamespaces
(
viewType
)
{
function
refreshNamespaces
(
viewType
)
{
if
(
$rootScope
.
pageContext
.
env
==
''
)
{
if
(
$rootScope
.
pageContext
.
env
==
''
)
{
return
;
return
;
...
@@ -173,7 +171,6 @@ application_module.controller("ConfigNamespaceController",
...
@@ -173,7 +171,6 @@ application_module.controller("ConfigNamespaceController",
$
(
"#rollbackAlertDialog"
).
modal
(
'show'
);
$
(
"#rollbackAlertDialog"
).
modal
(
'show'
);
}
}
$scope
.
toRollbackNamespace
=
{};
$scope
.
toRollbackNamespace
=
{};
function
preRollback
(
namespace
)
{
function
preRollback
(
namespace
)
{
$scope
.
toRollbackNamespace
=
namespace
;
$scope
.
toRollbackNamespace
=
namespace
;
...
@@ -181,7 +178,8 @@ application_module.controller("ConfigNamespaceController",
...
@@ -181,7 +178,8 @@ application_module.controller("ConfigNamespaceController",
ReleaseService
.
findActiveReleases
(
$rootScope
.
pageContext
.
appId
,
ReleaseService
.
findActiveReleases
(
$rootScope
.
pageContext
.
appId
,
$rootScope
.
pageContext
.
env
,
$rootScope
.
pageContext
.
env
,
$rootScope
.
pageContext
.
clusterName
,
$rootScope
.
pageContext
.
clusterName
,
$scope
.
toRollbackNamespace
.
baseInfo
.
namespaceName
,
0
,
2
)
$scope
.
toRollbackNamespace
.
baseInfo
.
namespaceName
,
0
,
2
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
if
(
result
.
length
<=
1
)
{
if
(
result
.
length
<=
1
)
{
toastr
.
error
(
"没有可以回滚的发布历史"
);
toastr
.
error
(
"没有可以回滚的发布历史"
);
...
@@ -290,11 +288,13 @@ application_module.controller("ConfigNamespaceController",
...
@@ -290,11 +288,13 @@ application_module.controller("ConfigNamespaceController",
if
(
selectedClusters
.
length
==
0
)
{
if
(
selectedClusters
.
length
==
0
)
{
toastr
.
error
(
"请选择集群"
);
toastr
.
error
(
"请选择集群"
);
}
else
{
return
;
}
if
(
!
$scope
.
item
.
value
)
{
if
(
!
$scope
.
item
.
value
)
{
$scope
.
item
.
value
=
""
;
$scope
.
item
.
value
=
""
;
}
}
selectedClusters
.
forEach
(
function
(
cluster
)
{
if
(
$scope
.
tableViewOperType
==
TABLE_VIEW_OPER_TYPE
.
CREATE
)
{
if
(
$scope
.
tableViewOperType
==
TABLE_VIEW_OPER_TYPE
.
CREATE
)
{
//check key unique
//check key unique
...
@@ -311,31 +311,33 @@ application_module.controller("ConfigNamespaceController",
...
@@ -311,31 +311,33 @@ application_module.controller("ConfigNamespaceController",
}
}
$scope
.
addItemBtnDisabled
=
true
;
$scope
.
addItemBtnDisabled
=
true
;
selectedClusters
.
forEach
(
function
(
cluster
)
{
ConfigService
.
create_item
(
$rootScope
.
pageContext
.
appId
,
ConfigService
.
create_item
(
$rootScope
.
pageContext
.
appId
,
cluster
.
env
,
cluster
.
env
,
cluster
.
name
,
cluster
.
name
,
toOperationNamespace
.
baseInfo
.
namespaceName
,
toOperationNamespace
.
baseInfo
.
namespaceName
,
$scope
.
item
).
then
(
$scope
.
item
).
then
(
function
(
result
)
{
function
(
result
)
{
toastr
.
success
(
cluster
.
env
+
" , "
+
$scope
.
item
.
key
,
toastr
.
success
(
cluster
.
env
+
" , "
+
$scope
.
item
.
key
,
"添加成功"
);
"添加成功"
);
itemModal
.
modal
(
'hide'
);
$scope
.
addItemBtnDisabled
=
false
;
$rootScope
.
refreshNamespaces
(
namespace_view_type
.
TABLE
);
},
function
(
result
)
{
},
function
(
result
)
{
$scope
.
addItemBtnDisabled
=
false
;
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"添加失败"
);
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
)
{
if
(
!
$scope
.
item
.
comment
)
{
$scope
.
item
.
comment
=
""
;
$scope
.
item
.
comment
=
""
;
}
}
ConfigService
.
update_item
(
$rootScope
.
pageContext
.
appId
,
ConfigService
.
update_item
(
$rootScope
.
pageContext
.
appId
,
cluster
.
env
,
$rootScope
.
pageContext
.
env
,
cluster
.
n
ame
,
$rootScope
.
pageContext
.
clusterN
ame
,
toOperationNamespace
.
baseInfo
.
namespaceName
,
toOperationNamespace
.
baseInfo
.
namespaceName
,
$scope
.
item
).
then
(
$scope
.
item
).
then
(
function
(
result
)
{
function
(
result
)
{
...
@@ -346,8 +348,6 @@ application_module.controller("ConfigNamespaceController",
...
@@ -346,8 +348,6 @@ application_module.controller("ConfigNamespaceController",
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"更新失败"
);
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"更新失败"
);
});
});
}
}
});
}
}
}
...
@@ -362,12 +362,12 @@ application_module.controller("ConfigNamespaceController",
...
@@ -362,12 +362,12 @@ application_module.controller("ConfigNamespaceController",
function
closeTip
(
clusterName
)
{
function
closeTip
(
clusterName
)
{
var
hideTip
=
JSON
.
parse
(
localStorage
.
getItem
(
"hideTip"
));
var
hideTip
=
JSON
.
parse
(
localStorage
.
getItem
(
"hideTip"
));
if
(
!
hideTip
){
if
(
!
hideTip
)
{
hideTip
=
{};
hideTip
=
{};
hideTip
[
$rootScope
.
pageContext
.
appId
]
=
{};
hideTip
[
$rootScope
.
pageContext
.
appId
]
=
{};
}
}
if
(
!
hideTip
[
$rootScope
.
pageContext
.
appId
]){
if
(
!
hideTip
[
$rootScope
.
pageContext
.
appId
])
{
hideTip
[
$rootScope
.
pageContext
.
appId
]
=
{};
hideTip
[
$rootScope
.
pageContext
.
appId
]
=
{};
}
}
...
@@ -387,5 +387,7 @@ application_module.controller("ConfigNamespaceController",
...
@@ -387,5 +387,7 @@ application_module.controller("ConfigNamespaceController",
$
(
'.config-item-container'
).
removeClass
(
'hide'
);
$
(
'.config-item-container'
).
removeClass
(
'hide'
);
new
Clipboard
(
'.clipboard'
);
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