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
89109a91
Commit
89109a91
authored
Jun 05, 2014
by
Thomas Bosch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename variable
parent
c825a95c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
35 deletions
+36
-35
app.js
src/main/webapp/public/scripts/app.js
+4
-4
controllers.js
src/main/webapp/public/scripts/controllers/controllers.js
+20
-19
services.js
src/main/webapp/public/scripts/services/services.js
+2
-2
main.html
src/main/webapp/public/views/main.html
+10
-10
No files found.
src/main/webapp/public/scripts/app.js
View file @
89109a91
...
@@ -14,13 +14,13 @@ angular.module('service-registry', [
...
@@ -14,13 +14,13 @@ angular.module('service-registry', [
templateUrl
:
'views/main.html'
,
templateUrl
:
'views/main.html'
,
controller
:
'MainCtrl'
controller
:
'MainCtrl'
})
})
.
when
(
'/add-
service
'
,
{
.
when
(
'/add-
application
'
,
{
templateUrl
:
'views/detail.html'
,
templateUrl
:
'views/detail.html'
,
controller
:
'
Service
CreationCtrl'
controller
:
'
Application
CreationCtrl'
})
})
.
when
(
'/
service
s/:id'
,
{
.
when
(
'/
application
s/:id'
,
{
templateUrl
:
'views/detail.html'
,
templateUrl
:
'views/detail.html'
,
controller
:
'
Service
DetailCtrl'
controller
:
'
Application
DetailCtrl'
})
})
.
otherwise
({
.
otherwise
({
redirectTo
:
'/'
redirectTo
:
'/'
...
...
src/main/webapp/public/scripts/controllers/controllers.js
View file @
89109a91
'use strict'
;
'use strict'
;
angular
.
module
(
'service-registry'
)
angular
.
module
(
'service-registry'
)
.
controller
(
'MainCtrl'
,
function
(
$scope
,
Service
,
Service
Detail
,
$location
)
{
.
controller
(
'MainCtrl'
,
function
(
$scope
,
Application
,
Application
Detail
,
$location
)
{
//Gets the service from /api/services
//Gets the service from /api/services
$scope
.
services
=
Service
.
query
();
$scope
.
applications
=
Application
.
query
();
$scope
.
add
Service
=
function
()
{
$scope
.
add
Application
=
function
()
{
window
.
location
=
"/#add-
service
"
;
window
.
location
=
"/#add-
applications
"
;
};
};
// callback for ng-click 'editService':
// callback for ng-click 'editService':
$scope
.
edit
Service
=
function
(
id
)
{
$scope
.
edit
Application
=
function
(
id
)
{
$location
.
path
(
'/
service
s/'
+
id
);
$location
.
path
(
'/
application
s/'
+
id
);
};
};
// callback for ng-click 'deleteService':
// callback for ng-click 'deleteService':
$scope
.
delete
Service
=
function
(
id
)
{
$scope
.
delete
Application
=
function
(
id
)
{
Service
Detail
.
delete
({
id
:
id
});
Application
Detail
.
delete
({
id
:
id
});
$scope
.
services
=
Service
.
query
();
$scope
.
applications
=
Application
.
query
();
};
};
})
})
.
controller
(
'
ServiceCreationCtrl'
,
function
(
$scope
,
Service
,
$location
)
{
.
controller
(
'
ApplicationCreationCtrl'
,
function
(
$scope
,
Application
,
$location
)
{
// callback for ng-click 'saveService':
// callback for ng-click 'saveService':
$scope
.
save
Service
=
function
()
{
$scope
.
save
Application
=
function
()
{
Service
.
create
(
$scope
.
service
);
Service
.
create
(
$scope
.
service
);
$location
.
path
(
'/
service
s'
);
$location
.
path
(
'/
application
s'
);
}
}
// callback for ng-click 'cancel':
// callback for ng-click 'cancel':
$scope
.
cancel
=
function
()
{
$scope
.
cancel
=
function
()
{
$location
.
path
(
'/
service
s'
);
$location
.
path
(
'/
application
s'
);
};
};
})
})
.
controller
(
'
ServiceDetailCtrl'
,
function
(
$scope
,
$routeParams
,
Service
,
Service
Detail
,
$location
)
{
.
controller
(
'
ApplicationDetailCtrl'
,
function
(
$scope
,
$routeParams
,
Application
,
Application
Detail
,
$location
)
{
// callback for ng-click 'updateService':
// callback for ng-click 'updateService':
$scope
.
save
Service
=
function
()
{
$scope
.
save
Application
=
function
()
{
Service
Detail
.
update
(
$scope
.
service
);
Application
Detail
.
update
(
$scope
.
service
);
$location
.
path
(
'/
service
s'
);
$location
.
path
(
'/
application
s'
);
}
}
// callback for ng-click 'cancel':
// callback for ng-click 'cancel':
$scope
.
cancel
=
function
()
{
$scope
.
cancel
=
function
()
{
$location
.
path
(
'/
service
s'
);
$location
.
path
(
'/
application
s'
);
};
};
$scope
.
service
=
Service
Detail
.
show
({
id
:
$routeParams
.
id
});
$scope
.
service
=
Application
Detail
.
show
({
id
:
$routeParams
.
id
});
});
});
\ No newline at end of file
src/main/webapp/public/scripts/services/services.js
View file @
89109a91
'use strict'
;
'use strict'
;
angular
.
module
(
'service-registry.services'
,
[
'ngResource'
])
angular
.
module
(
'service-registry.services'
,
[
'ngResource'
])
.
factory
(
'
Service
'
,
[
'$resource'
,
.
factory
(
'
Application
'
,
[
'$resource'
,
function
(
$resource
){
function
(
$resource
){
return
$resource
(
return
$resource
(
'/api/applications'
,
{},
{
'/api/applications'
,
{},
{
...
@@ -9,7 +9,7 @@ angular.module('service-registry.services', ['ngResource'])
...
@@ -9,7 +9,7 @@ angular.module('service-registry.services', ['ngResource'])
create
:
{
method
:
'POST'
}
create
:
{
method
:
'POST'
}
});
});
}])
}])
.
factory
(
'
Service
Detail'
,
[
'$resource'
,
.
factory
(
'
Application
Detail'
,
[
'$resource'
,
function
(
$resource
){
function
(
$resource
){
return
$resource
(
return
$resource
(
'/api/applications/:id'
,
'/api/applications/:id'
,
...
...
src/main/webapp/public/views/main.html
View file @
89109a91
...
@@ -5,19 +5,19 @@
...
@@ -5,19 +5,19 @@
<tr>
<tr>
<th>
Service
</th>
<th>
Service
</th>
<th>
Version
</th>
<th>
Version
</th>
<th>
URL
</th>
<th></th>
<th>
Message
</th>
<th></th>
<th>
Active
</th>
<th></th>
<th>
Actions
</th>
<th></th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
ng-repeat=
"
service in service
s"
>
<tr
ng-repeat=
"
application in application
s"
>
<td>
{{
service
.name }}
</td>
<td>
{{
application
.name }}
</td>
<td>
{{
service
.version }}
</td>
<td>
{{
application
.version }}
</td>
<td>
{{ service.url }}
</td>
<td></td>
<td>
{{ service.message }}
</td>
<td></td>
<td>
{{ service.active }}
</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=
"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>
<td><button
type=
"button"
ng-click=
"deleteService(service.id)"
class=
"btn btn-danger"
>
Delete
</button></td>
</tr>
</tr>
...
...
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