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
20abd55d
Commit
20abd55d
authored
Jul 08, 2016
by
Jason Song
Committed by
GitHub
Jul 08, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #314 from lepdou/namespace-as-file-format-2
bugfix
parents
ff156676
66ca68f3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
7 deletions
+11
-7
ItemSetService.java
...om/ctrip/framework/apollo/biz/service/ItemSetService.java
+3
-0
ConfigController.java
.../framework/apollo/portal/controller/ConfigController.java
+0
-1
NamespaceController.java
...amework/apollo/portal/controller/NamespaceController.java
+2
-1
FileTextResolver.java
...k/apollo/portal/service/txtresolver/FileTextResolver.java
+4
-3
NamespaceController.js
...esources/static/scripts/controller/NamespaceController.js
+1
-1
namespace-panel-directive.js
...ces/static/scripts/directive/namespace-panel-directive.js
+1
-1
No files found.
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/ItemSetService.java
View file @
20abd55d
...
...
@@ -50,6 +50,9 @@ public class ItemSetService {
Item
entity
=
BeanUtils
.
transfrom
(
Item
.
class
,
item
);
Item
beforeUpdateItem
=
itemService
.
findOne
(
entity
.
getId
());
if
(
beforeUpdateItem
!=
null
){
beforeUpdateItem
=
BeanUtils
.
transfrom
(
Item
.
class
,
beforeUpdateItem
);
}
entity
.
setDataChangeLastModifiedBy
(
operator
);
Item
updatedItem
=
itemService
.
update
(
entity
);
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ConfigController.java
View file @
20abd55d
...
...
@@ -51,7 +51,6 @@ public class ConfigController {
model
.
setEnv
(
env
);
model
.
setNamespaceName
(
namespaceName
);
configService
.
updateConfigItemByText
(
model
);
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/NamespaceController.java
View file @
20abd55d
...
...
@@ -80,7 +80,7 @@ public class NamespaceController {
@PreAuthorize
(
value
=
"@permissionValidator.hasCreateAppNamespacePermission(#appId, #appNamespace)"
)
@RequestMapping
(
value
=
"/apps/{appId}/appnamespaces"
,
method
=
RequestMethod
.
POST
)
public
void
createAppNamespace
(
@PathVariable
String
appId
,
@RequestBody
AppNamespace
appNamespace
)
{
public
AppNamespace
createAppNamespace
(
@PathVariable
String
appId
,
@RequestBody
AppNamespace
appNamespace
)
{
checkArgument
(
appNamespace
.
getAppId
(),
appNamespace
.
getName
());
if
(!
InputValidator
.
isValidAppNamespace
(
appNamespace
.
getName
()))
{
...
...
@@ -106,6 +106,7 @@ public class NamespaceController {
publisher
.
publishEvent
(
new
AppNamespaceCreationEvent
(
createdAppNamespace
));
return
createdAppNamespace
;
}
@RequestMapping
(
"/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces"
)
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/txtresolver/FileTextResolver.java
View file @
20abd55d
...
...
@@ -21,19 +21,20 @@ public class FileTextResolver implements ConfigTextResolver {
return
changeSets
;
}
if
(
CollectionUtils
.
isEmpty
(
baseItems
))
{
changeSets
.
addCreateItem
(
createItem
(
namespaceId
,
configText
));
changeSets
.
addCreateItem
(
createItem
(
namespaceId
,
0
,
configText
));
}
else
{
ItemDTO
beforeItem
=
baseItems
.
get
(
0
);
if
(!
configText
.
equals
(
beforeItem
.
getValue
()))
{
//update
changeSets
.
addUpdateItem
(
createItem
(
namespaceId
,
configText
));
changeSets
.
addUpdateItem
(
createItem
(
namespaceId
,
beforeItem
.
getId
(),
configText
));
}
}
return
changeSets
;
}
private
ItemDTO
createItem
(
long
namespaceId
,
String
value
)
{
private
ItemDTO
createItem
(
long
namespaceId
,
long
itemId
,
String
value
)
{
ItemDTO
item
=
new
ItemDTO
();
item
.
setId
(
itemId
);
item
.
setNamespaceId
(
namespaceId
);
item
.
setValue
(
value
);
item
.
setKey
(
ConfigConsts
.
CONFIG_FILE_CONTENT_KEY
);
...
...
apollo-portal/src/main/resources/static/scripts/controller/NamespaceController.js
View file @
20abd55d
...
...
@@ -112,7 +112,7 @@ namespace_module.controller("LinkNamespaceController",
}
else
{
//private的直接link并且跳转到授权页面
$window
.
location
.
href
=
"/namespace/role.html?#/appid="
+
$scope
.
appId
+
"&namespaceName="
+
$scope
.
appNamespace
.
name
;
+
"&namespaceName="
+
result
.
name
;
}
},
1000
);
},
function
(
result
)
{
...
...
apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js
View file @
20abd55d
...
...
@@ -26,7 +26,7 @@ directive_module.directive('apollonspanel',
LOG
:
'log'
};
var
MIN_ROW_SIZE
=
3
0
;
var
MIN_ROW_SIZE
=
1
0
;
scope
.
switchView
=
switchView
;
...
...
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