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
e0519d7c
Commit
e0519d7c
authored
Jun 05, 2014
by
Thomas Bosch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get details from app
parent
8c45b1df
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
88 deletions
+17
-88
app.js
src/main/webapp/public/scripts/app.js
+0
-8
controllers.js
src/main/webapp/public/scripts/controllers/controllers.js
+11
-41
services.js
src/main/webapp/public/scripts/services/services.js
+4
-6
detail.html
src/main/webapp/public/views/detail.html
+0
-28
main.html
src/main/webapp/public/views/main.html
+2
-5
No files found.
src/main/webapp/public/scripts/app.js
View file @
e0519d7c
...
...
@@ -14,14 +14,6 @@ angular.module('registry', [
templateUrl
:
'views/main.html'
,
controller
:
'MainCtrl'
})
.
when
(
'/add-application'
,
{
templateUrl
:
'views/detail.html'
,
controller
:
'ApplicationCreationCtrl'
})
.
when
(
'/applications/:id'
,
{
templateUrl
:
'views/detail.html'
,
controller
:
'ApplicationDetailCtrl'
})
.
otherwise
({
redirectTo
:
'/'
});
...
...
src/main/webapp/public/scripts/controllers/controllers.js
View file @
e0519d7c
'use strict'
;
angular
.
module
(
'registry'
)
.
controller
(
'MainCtrl'
,
function
(
$scope
,
Application
,
Application
Detail
,
$location
)
{
.
controller
(
'MainCtrl'
,
function
(
$scope
,
Application
,
Application
Info
,
$location
)
{
//Gets the service from /api/services
$scope
.
applications
=
Application
.
query
();
$scope
.
addApplication
=
function
()
{
window
.
location
=
"/#add-applications"
;
};
// callback for ng-click 'editService':
$scope
.
editApplication
=
function
(
id
)
{
$location
.
path
(
'/applications/'
+
id
);
};
// Gets the service from /api/services
$scope
.
applications
=
Application
.
query
({},
function
(
applications
)
{
// callback for ng-click 'deleteService':
$scope
.
deleteApplication
=
function
(
id
)
{
ApplicationDetail
.
delete
({
id
:
id
});
$scope
.
applications
=
Application
.
query
();
};
})
.
controller
(
'ApplicationCreationCtrl'
,
function
(
$scope
,
Application
,
$location
)
{
// callback for ng-click 'saveService':
$scope
.
saveApplication
=
function
()
{
Service
.
create
(
$scope
.
service
);
$location
.
path
(
'/applications'
);
}
// callback for ng-click 'cancel':
$scope
.
cancel
=
function
()
{
$location
.
path
(
'/applications'
);
};
})
.
controller
(
'ApplicationDetailCtrl'
,
function
(
$scope
,
$routeParams
,
Application
,
ApplicationDetail
,
$location
)
{
// callback for ng-click 'updateService':
$scope
.
saveApplication
=
function
()
{
ApplicationDetail
.
update
(
$scope
.
service
);
$location
.
path
(
'/applications'
);
}
// callback for ng-click 'cancel':
$scope
.
cancel
=
function
()
{
$location
.
path
(
'/applications'
);
};
$scope
.
service
=
ApplicationDetail
.
show
({
id
:
$routeParams
.
id
});
// Get details from applications
for
(
var
i
=
0
;
i
<
applications
.
length
;
i
++
)
{
var
app
=
applications
[
i
];
app
.
version
=
ApplicationInfo
.
query
({
url
:
app
.
url
}).
version
;
}
});
});
\ No newline at end of file
src/main/webapp/public/scripts/services/services.js
View file @
e0519d7c
...
...
@@ -9,13 +9,12 @@ angular.module('registry.services', ['ngResource'])
create
:
{
method
:
'POST'
}
});
}])
.
factory
(
'Application
Detail
'
,
[
'$resource'
,
.
factory
(
'Application
Info
'
,
[
'$resource'
,
function
(
$resource
){
return
$resource
(
'
/api/applications/:id
'
,
{
id
:
'@id
'
},
{
show
:
{
method
:
'GET'
},
'
:url
'
,
{
url
:
'@url
'
},
{
query
:
{
method
:
'GET'
},
update
:
{
method
:
'PUT'
,
params
:
{
id
:
'@id'
}
},
delete
:
{
method
:
'DELETE'
,
params
:
{
id
:
'@id'
}
}
});
}]);
\ No newline at end of file
src/main/webapp/public/views/detail.html
deleted
100644 → 0
View file @
8c45b1df
<div
class=
"container"
>
<form
role=
"form"
>
<h2
class=
"form-signin-heading"
>
Service Details
</h2>
<div
class=
"form-group"
>
<label
for=
"inputName"
>
Name
</label>
<input
type=
"text"
id=
"inputName"
ng-model=
"service.name"
class=
"form-control"
placeholder=
"Name of the Service"
required
autofocus
>
</div>
<div
class=
"form-group"
>
<label
for=
"inputVersion"
>
Version
</label>
<input
type=
"text"
id=
"inputVersion"
ng-model=
"service.version"
class=
"form-control"
placeholder=
"Version of the Service"
required
>
</div>
<div
class=
"form-group"
>
<label
for=
"inputUrl"
>
URL
</label>
<input
type=
"text"
id=
"inputUrl"
ng-model=
"service.url"
class=
"form-control"
placeholder=
"URL of the Service"
required
>
</div>
<div
class=
"form-group"
>
<label
for=
"inputMessage"
>
Message
</label>
<input
type=
"text"
id=
"inputMessage"
ng-model=
"service.message"
class=
"form-control"
placeholder=
"Message"
>
</div>
<div
class=
"form-group"
>
<label
for=
"inputActive"
>
Active
</label>
<input
type=
"checkbox"
id=
"inputActive"
ng-model=
"service.active"
class=
"form-control"
>
</div>
<button
ng-click=
"saveService()"
class=
"btn btn-lg btn-primary"
type=
"submit"
>
Save
</button>
<button
ng-click=
"cancel()"
class=
"btn btn-lg btn-primary"
type=
"submit"
>
Cancel
</button>
</form>
</div>
<!-- /.container -->
\ No newline at end of file
src/main/webapp/public/views/main.html
View file @
e0519d7c
...
...
@@ -13,16 +13,14 @@
</thead>
<tbody>
<tr
ng-repeat=
"application in applications"
>
<td>
{{ application.
name
}}
</td>
<td>
{{ application.
version
}}
</td>
<td>
{{ application.
id
}}
</td>
<td>
{{ application.
url
}}
</td>
<td></td>
<td></td>
<td></td>
<td><button
type=
"button"
ng-click=
"editService(service.id)"
class=
"btn btn-success"
>
Edit
</button></td>
<td><button
type=
"button"
ng-click=
"deleteService(service.id)"
class=
"btn btn-danger"
>
Delete
</button></td>
</tr>
</tbody>
</table>
<!-- <button type="button" ng-click="addService()" class="btn btn-primary">Add Service</button> -->
</div>
</div>
<!-- /.container -->
\ No newline at end of file
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