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
d1b2a76e
Commit
d1b2a76e
authored
Oct 03, 2015
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use YAML for infos and shorten them in overview
fixes #107
parent
7fe777db
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
48 deletions
+55
-48
overviewCtrl.js
...ng-boot-admin-server-ui/app/js/controller/overviewCtrl.js
+15
-7
index.js
spring-boot-admin-server-ui/app/js/filter/index.js
+2
-1
limitLines.js
spring-boot-admin-server-ui/app/js/filter/limitLines.js
+24
-0
yaml.js
spring-boot-admin-server-ui/app/js/filter/yaml.js
+4
-33
details.html
spring-boot-admin-server-ui/app/views/apps/details.html
+1
-1
overview.html
spring-boot-admin-server-ui/app/views/overview.html
+4
-2
package.json
spring-boot-admin-server-ui/package.json
+5
-4
No files found.
spring-boot-admin-server-ui/app/js/controller/overviewCtrl.js
View file @
d1b2a76e
...
@@ -15,9 +15,7 @@
...
@@ -15,9 +15,7 @@
*/
*/
'use strict'
;
'use strict'
;
var
angular
=
require
(
'angular'
);
module
.
exports
=
function
(
$scope
,
$location
,
$interval
,
$q
,
$state
,
$filter
,
Application
,
Notification
)
{
module
.
exports
=
function
(
$scope
,
$location
,
$interval
,
$q
,
$state
,
Application
,
Notification
)
{
var
createNote
=
function
(
app
)
{
var
createNote
=
function
(
app
)
{
var
title
=
app
.
name
+
(
app
.
statusInfo
.
status
===
'UP'
?
' is back '
:
' went '
)
+
app
.
statusInfo
.
status
;
var
title
=
app
.
name
+
(
app
.
statusInfo
.
status
===
'UP'
?
' is back '
:
' went '
)
+
app
.
statusInfo
.
status
;
var
options
=
{
tag
:
app
.
id
,
var
options
=
{
tag
:
app
.
id
,
...
@@ -37,8 +35,9 @@ module.exports = function ($scope, $location, $interval, $q, $state, Application
...
@@ -37,8 +35,9 @@ module.exports = function ($scope, $location, $interval, $q, $state, Application
//find application in known applications and copy state --> less flickering
//find application in known applications and copy state --> less flickering
for
(
var
j
=
0
;
$scope
.
applications
!=
null
&&
j
<
$scope
.
applications
.
length
;
j
++
)
{
for
(
var
j
=
0
;
$scope
.
applications
!=
null
&&
j
<
$scope
.
applications
.
length
;
j
++
)
{
if
(
app
.
id
===
$scope
.
applications
[
j
].
id
)
{
if
(
app
.
id
===
$scope
.
applications
[
j
].
id
)
{
app
.
info
=
$scope
.
applications
[
j
].
info
;
app
.
infoShort
=
$scope
.
applications
[
j
].
infoShort
;
app
.
infoDetails
=
$scope
.
applications
[
j
].
infoDetails
;
app
.
version
=
$scope
.
applications
[
j
].
version
;
//issue notifiaction on state change
//issue notifiaction on state change
if
(
app
.
statusInfo
.
status
!==
$scope
.
applications
[
j
].
statusInfo
.
status
)
{
if
(
app
.
statusInfo
.
status
!==
$scope
.
applications
[
j
].
statusInfo
.
status
)
{
createNote
(
app
);
createNote
(
app
);
...
@@ -46,9 +45,18 @@ module.exports = function ($scope, $location, $interval, $q, $state, Application
...
@@ -46,9 +45,18 @@ module.exports = function ($scope, $location, $interval, $q, $state, Application
break
;
break
;
}
}
}
}
app
.
getInfo
().
success
(
function
(
info
)
{
app
.
getInfo
().
success
(
function
(
info
)
{
angular
.
copy
(
info
,
app
.
info
);
app
.
version
=
info
.
version
;
app
.
infoDetails
=
null
;
app
.
infoShort
=
''
;
delete
info
.
version
;
var
infoYml
=
$filter
(
'yaml'
)(
info
);
if
(
infoYml
!==
'{}
\
n'
)
{
app
.
infoShort
=
$filter
(
'limitLines'
)(
infoYml
,
3
);
if
(
app
.
infoShort
!==
infoYml
)
{
app
.
infoDetails
=
$filter
(
'limitLines'
)(
infoYml
,
32000
,
3
);
}
}
}).
finally
(
function
(){
}).
finally
(
function
(){
app
.
refreshing
=
false
;
app
.
refreshing
=
false
;
});
});
...
...
spring-boot-admin-server-ui/app/js/filter/index.js
View file @
d1b2a76e
...
@@ -8,4 +8,5 @@ springBootAdmin.filter('classNameLoggerOnly', require('./classNameLoggerOnly'));
...
@@ -8,4 +8,5 @@ springBootAdmin.filter('classNameLoggerOnly', require('./classNameLoggerOnly'));
springBootAdmin
.
filter
(
'capitalize'
,
require
(
'./capitalize'
));
springBootAdmin
.
filter
(
'capitalize'
,
require
(
'./capitalize'
));
springBootAdmin
.
filter
(
'humanBytes'
,
require
(
'./humanBytes'
));
springBootAdmin
.
filter
(
'humanBytes'
,
require
(
'./humanBytes'
));
springBootAdmin
.
filter
(
'joinArray'
,
require
(
'./joinArray'
));
springBootAdmin
.
filter
(
'joinArray'
,
require
(
'./joinArray'
));
springBootAdmin
.
filter
(
'flatten'
,
require
(
'./flatten'
));
springBootAdmin
.
filter
(
'yaml'
,
require
(
'./yaml'
));
springBootAdmin
.
filter
(
'limitLines'
,
require
(
'./limitLines'
));
spring-boot-admin-server-ui/app/js/filter/limitLines.js
0 → 100644
View file @
d1b2a76e
/*
* 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
(
input
,
limit
,
begin
)
{
begin
=
begin
|
0
;
var
lines
=
input
.
match
(
/
[^\r\n]
+/g
);
return
lines
.
splice
(
begin
,
begin
+
limit
).
join
(
'
\
n'
);
};
};
spring-boot-admin-server-ui/app/js/filter/
flatten
.js
→
spring-boot-admin-server-ui/app/js/filter/
yaml
.js
View file @
d1b2a76e
...
@@ -15,39 +15,10 @@
...
@@ -15,39 +15,10 @@
*/
*/
'use strict'
;
'use strict'
;
var
angular
=
require
(
'angular
'
);
var
yaml
=
require
(
'js-yaml
'
);
module
.
exports
=
function
(
$filter
)
{
module
.
exports
=
function
()
{
var
flatten
=
function
(
obj
,
prefix
)
{
return
function
(
input
)
{
if
(
obj
instanceof
Date
)
{
return
yaml
.
dump
(
input
,
{
skipInvalid
:
true
,
sort
:
true
});
obj
=
$filter
(
'date'
)(
obj
,
'dd.MM.yyyy HH:mm:ss'
);
}
if
(
typeof
obj
===
'boolean'
||
typeof
obj
===
'string'
||
typeof
obj
===
'number'
)
{
return
(
prefix
?
prefix
+
': '
:
''
)
+
obj
;
}
var
result
=
''
;
var
first
=
true
;
angular
.
forEach
(
obj
,
function
(
value
,
key
)
{
if
(
angular
.
isString
(
value
)
&&
(
key
===
'time'
||
key
===
'timestamp'
))
{
if
(
/^
\d
+$/
.
test
(
value
))
{
value
=
new
Date
(
value
*
1000
);
}
else
if
(
/^
\d{4}
-
\d{2}
-
\d{2}
T
\d{2}
:
\d{2}
:
\d{2}\+\d{4}
$/
.
test
(
value
))
{
value
=
new
Date
(
value
);
}
}
if
(
first
)
{
first
=
false
;
}
else
{
result
=
result
+
'
\
n'
;
}
result
=
result
+
flatten
(
value
,
prefix
?
prefix
+
'.'
+
key
:
key
);
});
return
result
;
};
};
return
flatten
;
};
};
spring-boot-admin-server-ui/app/views/apps/details.html
View file @
d1b2a76e
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<thead><tr><th
colspan=
"2"
>
Application
<small
class=
"pull-right"
><a
href=
"api/applications/{{ application.id }}/info"
>
raw JSON
</a></small></th></tr></thead>
<thead><tr><th
colspan=
"2"
>
Application
<small
class=
"pull-right"
><a
href=
"api/applications/{{ application.id }}/info"
>
raw JSON
</a></small></th></tr></thead>
<tbody>
<tbody>
<tr
ng-repeat=
"(key, value) in info"
>
<tr
ng-repeat=
"(key, value) in info"
>
<td>
{{ key }}
</td><td
style=
"white-space: pre
;"
>
{{ value | flatten
}}
</td>
<td>
{{ key }}
</td><td
style=
"white-space: pre
"
>
{{ value | yaml
}}
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
...
spring-boot-admin-server-ui/app/views/overview.html
View file @
d1b2a76e
...
@@ -22,8 +22,10 @@
...
@@ -22,8 +22,10 @@
<tbody>
<tbody>
<tr
ng-repeat=
"application in applications|orderBy:order.column:order.descending|orderBy:'statusInfo.status':false track by application.id"
>
<tr
ng-repeat=
"application in applications|orderBy:order.column:order.descending|orderBy:'statusInfo.status':false track by application.id"
>
<td>
{{ application.name }}
<br/><span
class=
"muted"
>
{{ application.serviceUrl || application.managementUrl || application.healthUrl }}
</span></td>
<td>
{{ application.name }}
<br/><span
class=
"muted"
>
{{ application.serviceUrl || application.managementUrl || application.healthUrl }}
</span></td>
<td>
{{ application.info.version }}
</td>
<td>
{{ application.version }}
</td>
<td><span
ng-repeat=
"(name, value) in application.info track by name"
ng-if=
"name != 'version'"
style=
"white-space: pre"
>
{{value | flatten:name}}
<br/></span></td>
<td><span
style=
"white-space: pre"
ng-init=
"collapsed = true"
>
{{application.infoShort}}
</span>
<a
class=
"btn btn-mini"
ng-show=
"application.infoDetails"
ng-click=
"collapsed = !collapsed"
>
...
</a><br/>
<span
style=
"white-space: pre"
ng-hide=
"collapsed"
>
{{application.infoDetails}}
</span></td>
<td><span
class=
"status-{{application.statusInfo.status}}"
title=
"{{application.statusInfo.timestamp | date:'dd.MM.yyyy HH:mm:ss' }}"
>
{{ application.statusInfo.status }}
</span>
<td><span
class=
"status-{{application.statusInfo.status}}"
title=
"{{application.statusInfo.timestamp | date:'dd.MM.yyyy HH:mm:ss' }}"
>
{{ application.statusInfo.status }}
</span>
<span
ng-show=
"application.refreshing"
class=
"refresh"
></span></td>
<span
ng-show=
"application.refreshing"
class=
"refresh"
></span></td>
<td>
<td>
...
...
spring-boot-admin-server-ui/package.json
View file @
d1b2a76e
...
@@ -7,12 +7,13 @@
...
@@ -7,12 +7,13 @@
"test"
:
"./node_modules/gulp/bin/gulp.js"
"test"
:
"./node_modules/gulp/bin/gulp.js"
},
},
"dependencies"
:
{
"dependencies"
:
{
"es5-shim"
:
"^3.0.2"
,
"angular"
:
"~1.2.27"
,
"jquery"
:
"~2.1.1"
,
"angular-ui-router"
:
"~0.2.11"
,
"angular-resource"
:
"~1.2.27"
,
"angular-resource"
:
"~1.2.27"
,
"angular-route"
:
"~1.2.27"
,
"angular-route"
:
"~1.2.27"
,
"angular"
:
"~1.2.27"
"angular-ui-router"
:
"~0.2.11"
,
"es5-shim"
:
"^3.0.2"
,
"jquery"
:
"~2.1.1"
,
"js-yaml"
:
"^3.4.2"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"browserify"
:
"^3.44.2"
,
"browserify"
:
"^3.44.2"
,
...
...
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