Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
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
spring-boot-admin
Commits
c52a06e0
Commit
c52a06e0
authored
May 11, 2015
by
Johannes Stelzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for Spring Cloud Contexts /env endpoint.
This allows to (re-)set properties via POST-requests to the environment endpoint.
parent
a374bb23
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
171 additions
and
48 deletions
+171
-48
main.css
spring-boot-admin-server-ui/app/css/main.css
+6
-1
environmentCtrl.js
...admin-server-ui/app/js/controller/apps/environmentCtrl.js
+82
-1
index.js
spring-boot-admin-server-ui/app/js/filter/index.js
+0
-2
isEmpty.js
spring-boot-admin-server-ui/app/js/filter/isEmpty.js
+0
-28
application.js
spring-boot-admin-server-ui/app/js/service/application.js
+20
-7
environment.html
spring-boot-admin-server-ui/app/views/apps/environment.html
+62
-8
logging.html
spring-boot-admin-server-ui/app/views/apps/logging.html
+1
-1
No files found.
spring-boot-admin-server-ui/app/css/main.css
View file @
c52a06e0
...
...
@@ -11,7 +11,6 @@ body {
margin-bottom
:
50px
;
}
.center-block
{
display
:
block
;
margin-left
:
auto
;
...
...
@@ -171,6 +170,12 @@ span.refresh {
color
:
#f1f1f1
;
}
.accordion-group
,
.boxed
{
border
:
1px
solid
#34302D
;
}
.sortable
{
cursor
:
pointer
;
}
...
...
spring-boot-admin-server-ui/app/js/controller/apps/environmentCtrl.js
View file @
c52a06e0
...
...
@@ -17,12 +17,93 @@
module
.
exports
=
function
(
$scope
,
application
)
{
$scope
.
application
=
application
;
$scope
.
override
=
{
values
:
[{
key
:
''
,
value
:
''
}],
error
:
null
};
application
.
getEnv
(
application
)
var
toArray
=
function
(
map
)
{
var
array
=
[];
for
(
var
key
in
map
)
{
var
value
=
map
[
key
];
if
(
value
instanceof
Object
)
{
value
=
toArray
(
value
);
}
var
entry
=
{
key
:
key
,
value
:
value
};
array
.
push
(
entry
);
}
return
array
.
length
>
0
?
array
:
undefined
;
};
var
collectKeys
=
function
(
envArray
)
{
var
allKeys
=
{};
for
(
var
i
=
0
;
i
<
envArray
.
length
;
i
++
)
{
for
(
var
j
=
0
;
envArray
[
i
].
value
&&
j
<
envArray
[
i
].
value
.
length
;
j
++
)
{
allKeys
[
envArray
[
i
].
value
[
j
].
key
]
=
true
;
}
}
return
Object
.
getOwnPropertyNames
(
allKeys
);
};
$scope
.
reload
=
function
()
{
$scope
.
env
=
{};
$scope
.
envArray
=
[];
$scope
.
allKeys
=
[];
application
.
getEnv
()
.
success
(
function
(
env
)
{
$scope
.
env
=
env
;
$scope
.
envArray
=
toArray
(
env
);
$scope
.
allKeys
=
collectKeys
(
$scope
.
envArray
);
})
.
error
(
function
(
error
)
{
$scope
.
error
=
error
;
});
};
$scope
.
reload
();
var
getValue
=
function
(
item
)
{
if
(
item
.
key
&&
$scope
.
allKeys
.
indexOf
(
item
.
key
)
>=
0
)
{
application
.
getEnv
(
item
.
key
).
success
(
function
(
value
)
{
item
.
value
=
value
;
});
}
};
$scope
.
onChangeOverrideItem
=
function
(
item
)
{
getValue
(
item
);
if
(
$scope
.
override
.
values
[
$scope
.
override
.
values
.
length
-
1
].
key
)
{
$scope
.
override
.
values
.
push
({
key
:
''
,
value
:
''
});
}
};
$scope
.
overrideValue
=
function
()
{
var
map
=
{};
for
(
var
i
=
0
;
i
<
$scope
.
override
.
values
.
length
;
i
++
)
{
if
(
$scope
.
override
.
values
[
i
].
key
)
{
map
[
$scope
.
override
.
values
[
i
].
key
]
=
$scope
.
override
.
values
[
i
].
value
;
}
}
$scope
.
override
.
error
=
null
;
application
.
setEnv
(
map
).
success
(
function
()
{
$scope
.
override
=
{
values
:
[{
key
:
''
,
value
:
''
}],
error
:
null
};
$scope
.
reload
();
})
.
error
(
function
(
error
)
{
$scope
.
override
.
error
=
error
;
$scope
.
reload
();
});
};
$scope
.
reset
=
function
()
{
$scope
.
override
.
error
=
null
;
application
.
resetEnv
().
success
(
function
()
{
$scope
.
reload
();
})
.
error
(
function
(
error
)
{
$scope
.
override
.
error
=
error
;
$scope
.
reload
();
});
};
};
spring-boot-admin-server-ui/app/js/filter/index.js
View file @
c52a06e0
...
...
@@ -4,9 +4,7 @@ var angular = require('angular');
var
springBootAdmin
=
angular
.
module
(
'springBootAdmin'
);
springBootAdmin
.
filter
(
'timeInterval'
,
require
(
'./timeInterval'
));
springBootAdmin
.
filter
(
'classNameLoggerOnly'
,
require
(
'./classNameLoggerOnly'
));
springBootAdmin
.
filter
(
'capitalize'
,
require
(
'./capitalize'
));
springBootAdmin
.
filter
(
'humanBytes'
,
require
(
'./humanBytes'
));
springBootAdmin
.
filter
(
'joinArray'
,
require
(
'./joinArray'
));
springBootAdmin
.
filter
(
'isEmpty'
,
require
(
'./isEmpty'
));
spring-boot-admin-server-ui/app/js/filter/isEmpty.js
deleted
100644 → 0
View file @
a374bb23
/*
* Copyright 2014 the original author or authors.
*
* 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.
*/
'use strict'
;
module
.
exports
=
function
()
{
return
function
(
obj
)
{
for
(
var
bar
in
obj
)
{
if
(
obj
.
hasOwnProperty
(
bar
))
{
return
false
;
}
}
return
true
;
};
};
spring-boot-admin-server-ui/app/js/service/application.js
View file @
c52a06e0
...
...
@@ -18,18 +18,23 @@ var angular = require('angular');
module
.
exports
=
function
(
$resource
,
$http
)
{
var
isEndpoint
Enabled
=
function
(
endpoint
,
configprops
)
{
var
isEndpoint
Present
=
function
(
endpoint
,
configprops
)
{
if
(
configprops
[
endpoint
])
{
return
configprops
[
endpoint
].
properties
.
enabled
;
}
return
true
;
}
else
{
return
false
;
}
};
var
getCapabilities
=
function
(
application
)
{
application
.
capabilities
=
{};
$http
.
get
(
'api/applications/'
+
application
.
id
+
'/configprops'
).
success
(
function
(
configprops
)
{
application
.
capabilities
.
logfile
=
isEndpointEnabled
(
'logfileEndpoint'
,
configprops
);
application
.
capabilities
.
activiti
=
isEndpointEnabled
(
'processEngineEndpoint'
,
configprops
);
application
.
capabilities
.
logfile
=
isEndpointPresent
(
'logfileEndpoint'
,
configprops
);
application
.
capabilities
.
activiti
=
isEndpointPresent
(
'processEngineEndpoint'
,
configprops
);
application
.
capabilities
.
restart
=
isEndpointPresent
(
'restartEndpoint'
,
configprops
);
application
.
capabilities
.
refresh
=
isEndpointPresent
(
'refreshEndpoint'
,
configprops
);
application
.
capabilities
.
pause
=
isEndpointPresent
(
'pauseEndpoint'
,
configprops
);
application
.
capabilities
.
resume
=
isEndpointPresent
(
'resumeEndpoint'
,
configprops
);
});
};
...
...
@@ -67,8 +72,16 @@ module.exports = function ($resource, $http) {
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/metrics'
);
};
Application
.
prototype
.
getEnv
=
function
()
{
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/env'
);
Application
.
prototype
.
getEnv
=
function
(
key
)
{
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/env'
+
(
key
?
'/'
+
key
:
''
));
};
Application
.
prototype
.
setEnv
=
function
(
map
)
{
return
$http
.
post
(
'api/applications/'
+
this
.
id
+
'/env'
,
''
,
{
params
:
map
});
};
Application
.
prototype
.
resetEnv
=
function
()
{
return
$http
.
post
(
'api/applications/'
+
this
.
id
+
'/env/reset'
);
};
Application
.
prototype
.
getThreadDump
=
function
()
{
...
...
spring-boot-admin-server-ui/app/views/apps/environment.html
View file @
c52a06e0
...
...
@@ -3,20 +3,74 @@
<b>
Error:
</b>
{{ error }}
</div>
<div
class=
"row"
>
<accordion
close-others=
"false"
>
<accordion-group
is-open=
"true"
ng-repeat=
"(envkey, envvalue) in env track by envkey"
heading=
"{{envkey}}"
ng-hide=
"envvalue | isEmpty"
>
<small
class=
"pull-right"
><a
href=
"{{ application.managementUrl }}/env"
>
raw JSON
</a></small>
<table
class=
"table table-striped"
>
<col
>
<table
class=
"table table-hover boxed"
>
<thead><tr><th>
Profiles
<small
class=
"pull-right"
><small
class=
"pull-right"
><a
href=
"{{ application.managementUrl }}/env"
>
raw JSON
</a></small></th></tr></thead>
<tbody>
<tr
ng-repeat=
"profile in env.profiles"
>
<td
style=
"word-break: break-all;"
>
{{ profile }}
</td>
</tr>
<tr
ng-hide=
"env.profiles"
>
<td
style=
"word-break: break-all;"
>
No profiles active
</td>
</tr>
</tbody>
</table>
</div>
<div
class=
"row"
ng-show=
"application.capabilities.refresh"
>
<table
class=
"table table-hover boxed"
>
<col
width=
"38%"
>
<col
width=
"62%"
>
<thead><tr><th
colspan=
"2"
>
Overriden properties
</th></tr></thead>
<tbody>
<tr
ng-repeat-end
ng-repeat=
"(key, value) in envvalue
"
>
<tr
ng-repeat=
"(key, value) in env.manager track by key
"
>
<td
style=
"word-break: break-all;"
>
{{ key }}
</td>
<td
style=
"word-break: break-all;"
>
{{ value }}
</td>
</tr>
<tr
ng-repeat=
"item in override.values"
>
<td
>
<input
type=
"text"
class=
"input-xlarge"
list=
"allkeys"
placeholder=
"key"
ng-model=
"item.key"
ng-change=
"onChangeOverrideItem(item)"
></input>
<datalist
id=
"allkeys"
>
<option
ng-repeat=
"key in allKeys | orderBy:'toString()' track by key"
>
{{key}}
</option>
</datalist>
</td>
<td>
<input
type=
"text"
class=
"input-xxlarge"
placeholder=
"value"
ng-model=
"item.value"
></input>
</td>
</tr>
<tr>
</tbody>
<tfoot>
<tr>
<td
colspan=
"2"
>
<div
class=
"control-group pull-right"
>
<button
class=
"btn btn-warning"
ng-click=
"overrideValue()"
>
Overrride Values!
</button>
<button
class=
"btn"
ng-click=
"reset()"
>
Reset Values!
</button>
</div>
<div
class=
"alert alert-error"
ng-if=
"override.error"
>
<b>
Error:
</b>
{{ override.error }}
</div>
</td>
</tr>
</tfoot>
</table>
</div>
<div
class=
"row"
>
<div>
<div
class=
"input-append"
>
<input
placeholder=
"Filter by name/value ..."
class=
"input-xxlarge"
type=
"search"
ng-model=
"searchFilter"
/>
<button
class=
"btn"
title=
"reload list"
ng-click=
"reload()"
><i
class=
"icon-refresh"
></i></button>
</div>
</div>
<table
class=
"table table-hover boxed"
ng-repeat=
"item in envArray track by item.key"
ng-show=
"item.key != 'profiles' && (item.value | filter:searchFilter).length > 0"
>
<col
width=
"38%"
>
<col
width=
"62%"
>
<thead><tr><th
colspan=
"2"
>
{{item.key}}
</th></tr></thead>
<tbody>
<tr
ng-repeat=
"property in item.value | filter:searchFilter track by property.key"
>
<td
style=
"word-break: break-all;"
>
{{ property.key }}
</td>
<td
style=
"word-break: break-all;"
>
{{ property.value }}
</td>
</tr>
</tbody>
</table>
</accordion-group>
</accordion>
</div>
</div>
spring-boot-admin-server-ui/app/views/apps/logging.html
View file @
c52a06e0
...
...
@@ -7,7 +7,7 @@
<span
title=
"filtered / total"
class=
"add-on"
>
{{ filteredLoggers.length }}/{{ loggers.length }}
</span>
</div>
</form>
<table
class=
"table"
>
<table
class=
"table
table-hover
"
>
<tbody>
<tr
ng-repeat=
"logger in (filteredLoggers = (loggers | classNameLoggerOnly:!showPackageLoggers | filter:filterLogger) ) | limitTo: limit track by logger.name"
>
<td>
...
...
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