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
6c721d09
Commit
6c721d09
authored
Oct 12, 2016
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add auto refresh for details
Adds a button to enable automatic refresh of the details view. Also fixes the uptime counter, which got currupted by the reload button. closes #262
parent
09b8a956
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
15 deletions
+69
-15
uptime.js
...rver-ui/modules/applications-details/components/uptime.js
+11
-3
detailsCtrl.js
...i/modules/applications-details/controllers/detailsCtrl.js
+30
-3
details.html
...server-ui/modules/applications-details/views/details.html
+9
-4
traceCtrl.js
...er-ui/modules/applications-trace/controllers/traceCtrl.js
+19
-5
No files found.
spring-boot-admin-server-ui/modules/applications-details/components/uptime.js
View file @
6c721d09
...
...
@@ -23,10 +23,18 @@ module.exports = {
'ngInject'
;
var
ctrl
=
this
;
var
start
=
Date
.
now
();
var
timer
=
null
;
var
start
=
0
;
ctrl
.
$onChanges
=
function
()
{
ctrl
.
clock
=
$filter
(
'timeInterval'
)(
ctrl
.
value
+
Date
.
now
()
-
start
);
$interval
(
function
()
{
ctrl
.
clock
=
$filter
(
'timeInterval'
)(
ctrl
.
value
);
start
=
Date
.
now
();
if
(
timer
!==
null
)
{
$interval
.
cancel
(
timer
);
timer
=
null
;
}
timer
=
$interval
(
function
()
{
ctrl
.
clock
=
$filter
(
'timeInterval'
)(
ctrl
.
value
+
Date
.
now
()
-
start
);
},
1000
);
};
...
...
spring-boot-admin-server-ui/modules/applications-details/controllers/detailsCtrl.js
View file @
6c721d09
...
...
@@ -17,13 +17,15 @@
var
angular
=
require
(
'angular'
);
module
.
exports
=
function
(
$scope
,
application
)
{
module
.
exports
=
function
(
$scope
,
application
,
$interval
)
{
'ngInject'
;
$scope
.
application
=
application
;
$scope
.
metrics
=
{};
$scope
.
refreshInterval
=
1
;
$scope
.
refresher
=
null
;
$scope
.
getDetails
=
function
()
{
$scope
.
refresh
=
function
()
{
application
.
getInfo
().
then
(
function
(
response
)
{
$scope
.
info
=
response
.
data
;
}).
catch
(
function
(
response
)
{
...
...
@@ -55,5 +57,30 @@ module.exports = function ($scope, application) {
});
};
$scope
.
getDetails
();
$scope
.
start
=
function
()
{
$scope
.
refresher
=
$interval
(
function
()
{
$scope
.
refresh
();
},
$scope
.
refreshInterval
*
1000
);
};
$scope
.
stop
=
function
()
{
if
(
$scope
.
refresher
!==
null
)
{
$interval
.
cancel
(
$scope
.
refresher
);
$scope
.
refresher
=
null
;
}
};
$scope
.
toggleAutoRefresh
=
function
()
{
if
(
$scope
.
refresher
===
null
)
{
$scope
.
start
();
}
else
{
$scope
.
stop
();
}
};
$scope
.
$on
(
'$destroy'
,
function
()
{
$scope
.
stop
();
});
$scope
.
refresh
();
};
spring-boot-admin-server-ui/modules/applications-details/views/details.html
View file @
6c721d09
...
...
@@ -3,11 +3,16 @@
<b>
Error:
</b>
{{ error }}
</div>
<div
class=
"row"
>
<div
class=
"text-center"
>
<form>
<button
class=
"btn"
ng-click=
"getDetails()"
><i
class=
"fa fa-repeat"
></i>
refresh
</button>
<form
class=
"form-inline"
>
<button
title=
"refresh"
class=
"btn"
ng-click=
"refresh()"
><i
class=
"fa fa-repeat"
></i></button>
<div
class=
"input-prepend input-append"
>
<button
title=
"auto refresh"
class=
"btn"
ng-click=
"toggleAutoRefresh()"
ng-class=
"{'active':refresher != null}"
>
<i
class=
"fa fa-refresh"
ng-class=
"{'fa-spin':refresher != null}"
></i>
</button>
<input
class=
"input-mini"
type=
"number"
min=
"1"
ng-model=
"refreshInterval"
ng-disabled=
"refresher != null"
/>
<span
class=
"add-on"
>
sec
</span>
</div>
</form>
</div>
</div>
<div
style=
"display: flex; flex-wrap: wrap; justify-content: space-around;"
>
<sba-info-panel
class=
"span6"
style=
"margin-left:0px"
panel-title=
"Application"
raw=
"api/applications/{{ application.id }}/info"
>
...
...
spring-boot-admin-server-ui/modules/applications-trace/controllers/traceCtrl.js
View file @
6c721d09
...
...
@@ -34,16 +34,30 @@ module.exports = function ($scope, application, $interval) {
});
};
$scope
.
start
=
function
()
{
$scope
.
refresher
=
$interval
(
function
()
{
$scope
.
refresh
();
},
$scope
.
refreshInterval
*
1000
);
};
$scope
.
stop
=
function
()
{
if
(
$scope
.
refresher
!==
null
)
{
$interval
.
cancel
(
$scope
.
refresher
);
$scope
.
refresher
=
null
;
}
};
$scope
.
toggleAutoRefresh
=
function
()
{
if
(
$scope
.
refresher
===
null
)
{
$scope
.
refresher
=
$interval
(
function
()
{
$scope
.
refresh
();
},
$scope
.
refreshInterval
*
1000
);
$scope
.
start
();
}
else
{
$interval
.
cancel
(
$scope
.
refresher
);
$scope
.
refresher
=
null
;
$scope
.
stop
();
}
};
$scope
.
$on
(
'$destroy'
,
function
()
{
$scope
.
stop
();
});
$scope
.
refresh
();
};
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