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
90cd25d9
Commit
90cd25d9
authored
May 06, 2015
by
Johannes Stelzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proper endpoint detection for /logfile and /activiti using a single request to /configprops
parent
11a37713
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
54 deletions
+46
-54
appsCtrl.js
spring-boot-admin-server-ui/app/js/controller/appsCtrl.js
+0
-8
overviewCtrl.js
...ng-boot-admin-server-ui/app/js/controller/overviewCtrl.js
+1
-21
application.js
spring-boot-admin-server-ui/app/js/service/application.js
+42
-22
apps.html
spring-boot-admin-server-ui/app/views/apps.html
+1
-1
overview.html
spring-boot-admin-server-ui/app/views/overview.html
+2
-2
No files found.
spring-boot-admin-server-ui/app/js/controller/appsCtrl.js
View file @
90cd25d9
...
...
@@ -17,12 +17,4 @@
module
.
exports
=
function
(
$scope
,
application
)
{
$scope
.
application
=
application
;
application
.
getActiviti
()
.
success
(
function
()
{
$scope
.
application
.
providesActiviti
=
true
;
})
.
error
(
function
()
{
$scope
.
application
.
providesActiviti
=
false
;
});
};
spring-boot-admin-server-ui/app/js/controller/overviewCtrl.js
View file @
90cd25d9
...
...
@@ -60,24 +60,6 @@ module.exports = function ($scope, $location, $interval, $q, $state, Application
}
});
};
var
getLogfile
=
function
(
app
)
{
return
app
.
hasLogfile
()
.
success
(
function
()
{
app
.
providesLogfile
=
true
;
})
.
error
(
function
()
{
app
.
providesLogfile
=
false
;
});
};
var
getActiviti
=
function
(
app
)
{
return
app
.
getActiviti
()
.
success
(
function
()
{
app
.
providesActiviti
=
true
;
})
.
error
(
function
()
{
app
.
providesActiviti
=
false
;
});
};
$scope
.
loadData
=
function
()
{
Application
.
query
(
function
(
applications
)
{
...
...
@@ -88,13 +70,11 @@ module.exports = function ($scope, $location, $interval, $q, $state, Application
app
.
info
=
$scope
.
applications
[
j
].
info
;
app
.
version
=
$scope
.
applications
[
j
].
version
;
app
.
status
=
$scope
.
applications
[
j
].
status
;
app
.
providesLogfile
=
$scope
.
applications
[
j
].
providesLogfile
;
app
.
providesActiviti
=
$scope
.
applications
[
j
].
providesActiviti
;
break
;
}
}
app
.
refreshing
=
true
;
$q
.
all
(
getInfo
(
app
),
getHealth
(
app
)
,
getLogfile
(
app
),
getActiviti
(
app
)
)
$q
.
all
(
getInfo
(
app
),
getHealth
(
app
))
.
finally
(
function
()
{
app
.
refreshing
=
false
;
});
...
...
spring-boot-admin-server-ui/app/js/service/application.js
View file @
90cd25d9
...
...
@@ -14,53 +14,73 @@
* limitations under the License.
*/
'use strict'
;
var
angular
=
require
(
'angular'
);
module
.
exports
=
function
(
$resource
,
$http
)
{
var
isEndpointEnabled
=
function
(
endpoint
,
configprops
)
{
if
(
configprops
[
endpoint
])
{
return
configprops
[
endpoint
].
properties
.
enabled
;
}
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
);
});
};
module
.
exports
=
function
(
$resource
,
$http
,
$rootScope
)
{
var
Application
=
$resource
(
'api/applications/:id'
,
{
id
:
'@id'
},
{
query
:
{
method
:
'GET'
,
isArray
:
true
},
get
:
{
method
:
'GET'
},
query
:
{
method
:
'GET'
,
isArray
:
true
,
transformResponse
:
function
(
data
)
{
var
apps
=
angular
.
fromJson
(
data
);
for
(
var
i
=
0
;
i
<
apps
.
length
;
i
++
)
{
getCapabilities
(
apps
[
i
]);
}
return
apps
;
}
},
get
:
{
method
:
'GET'
,
transformResponse
:
function
(
data
)
{
var
app
=
angular
.
fromJson
(
data
);
getCapabilities
(
app
);
return
app
;
}
},
remove
:
{
method
:
'DELETE'
}
});
var
AuthInterceptor
=
function
(
application
)
{
return
function
(
data
,
status
,
headers
)
{
if
(
status
===
401
)
{
$rootScope
.
$emit
(
'application-auth-required'
,
application
,
headers
(
'WWW-Authenticate'
).
split
(
' '
)[
0
]);
}
};
};
Application
.
prototype
.
getHealth
=
function
()
{
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/health'
)
.
error
(
new
AuthInterceptor
(
this
))
;
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/health'
);
};
Application
.
prototype
.
getInfo
=
function
()
{
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/info'
)
.
error
(
new
AuthInterceptor
(
this
))
;
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/info'
);
};
Application
.
prototype
.
getMetrics
=
function
()
{
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/metrics'
)
.
error
(
new
AuthInterceptor
(
this
))
;
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/metrics'
);
};
Application
.
prototype
.
getEnv
=
function
()
{
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/env'
)
.
error
(
new
AuthInterceptor
(
this
))
;
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/env'
);
};
Application
.
prototype
.
getThreadDump
=
function
()
{
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/dump'
)
.
error
(
new
AuthInterceptor
(
this
))
;
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/dump'
);
};
Application
.
prototype
.
getTraces
=
function
()
{
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/trace'
)
.
error
(
new
AuthInterceptor
(
this
))
;
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/trace'
);
};
Application
.
prototype
.
getActiviti
=
function
()
{
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/activiti'
).
error
(
new
AuthInterceptor
(
this
));
};
Application
.
prototype
.
hasLogfile
=
function
()
{
return
$http
.
head
(
'api/applications/'
+
this
.
id
+
'/logfile'
).
error
(
new
AuthInterceptor
(
this
));
return
$http
.
get
(
'api/applications/'
+
this
.
id
+
'/activiti'
);
};
return
Application
;
...
...
spring-boot-admin-server-ui/app/views/apps.html
View file @
90cd25d9
...
...
@@ -8,7 +8,7 @@
<li
class=
"navbar-link"
ui-sref-active=
"active"
><a
ui-sref=
"apps.jmx({id: application.id})"
>
JMX
</a></li>
<li
class=
"navbar-link"
ui-sref-active=
"active"
><a
ui-sref=
"apps.threads({id: application.id})"
>
Threads
</a></li>
<li
class=
"navbar-link"
ui-sref-active=
"active"
><a
ui-sref=
"apps.trace({id: application.id})"
>
Trace
</a></li>
<li
ng-show=
"application.
providesA
ctiviti"
class=
"navbar-link"
ui-sref-active=
"active"
><a
ui-sref=
"apps.activiti({id: application.id})"
>
Activiti
</a></li>
<li
ng-show=
"application.
capabilities.a
ctiviti"
class=
"navbar-link"
ui-sref-active=
"active"
><a
ui-sref=
"apps.activiti({id: application.id})"
>
Activiti
</a></li>
</ul>
</div>
</div>
...
...
spring-boot-admin-server-ui/app/views/overview.html
View file @
90cd25d9
...
...
@@ -23,7 +23,7 @@
<span
ng-show=
"application.refreshing"
class=
"refresh"
></span></td>
<td
style=
"text-align: right;"
>
<div
class=
"btn-group"
ng-hide=
"application.managementUrl == null || application.status == null || application.status == 'OFFLINE'"
>
<a
ng-disabled=
"!application.
providesLogfile"
target=
"_self"
class=
"btn btn-success"
ng-href=
"{{application.providesLogfile ? application.u
rl + '/logfile' :''}}"
><i
class=
"icon-file icon-white"
></i>
Log
</a>
<a
ng-disabled=
"!application.
capabilities.logfile"
target=
"_self"
class=
"btn btn-success"
ng-href=
"{{application.capabilities.logfile ? application.managementU
rl + '/logfile' :''}}"
><i
class=
"icon-file icon-white"
></i>
Log
</a>
<a
ui-sref=
"apps.details.metrics({id: application.id})"
class=
"btn btn-success"
>
Details
</a>
<a
class=
"btn btn-success dropdown-toggle"
data-toggle=
"dropdown"
>
<span
class=
"caret"
></span>
...
...
@@ -34,7 +34,7 @@
<li><a
ui-sref=
"apps.jmx({id: application.id})"
>
JMX
</a></li>
<li><a
ui-sref=
"apps.threads({id: application.id})"
>
Threads
</a></li>
<li><a
ui-sref=
"apps.trace({id: application.id})"
>
Trace
</a></li>
<li
ng-show=
"application.
providesA
ctiviti"
><a
ui-sref=
"apps.activiti({id: application.id})"
>
Activiti
</a></li>
<li
ng-show=
"application.
capabilities.a
ctiviti"
><a
ui-sref=
"apps.activiti({id: application.id})"
>
Activiti
</a></li>
</ul>
</div>
<div
class=
"btn-group"
title=
"remove"
>
...
...
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