Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8d8a9563
Commit
8d8a9563
authored
Mar 06, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add helpers for Toggle, Repair and Remove node actions
parent
da3886c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
ee/app/assets/javascripts/geo_nodes/service/geo_nodes_service.js
...assets/javascripts/geo_nodes/service/geo_nodes_service.js
+25
-5
No files found.
ee/app/assets/javascripts/geo_nodes/service/geo_nodes_service.js
View file @
8d8a9563
...
@@ -3,8 +3,7 @@ import axios from '~/lib/utils/axios_utils';
...
@@ -3,8 +3,7 @@ import axios from '~/lib/utils/axios_utils';
import
Api
from
'
~/api
'
;
import
Api
from
'
~/api
'
;
export
default
class
GeoNodesService
{
export
default
class
GeoNodesService
{
constructor
(
nodeDetailsBasePath
)
{
constructor
()
{
this
.
geoNodeDetailsBasePath
=
nodeDetailsBasePath
;
this
.
geoNodesPath
=
Api
.
buildUrl
(
Api
.
geoNodesPath
);
this
.
geoNodesPath
=
Api
.
buildUrl
(
Api
.
geoNodesPath
);
}
}
...
@@ -12,8 +11,29 @@ export default class GeoNodesService {
...
@@ -12,8 +11,29 @@ export default class GeoNodesService {
return
axios
.
get
(
this
.
geoNodesPath
);
return
axios
.
get
(
this
.
geoNodesPath
);
}
}
getGeoNodeDetails
(
nodeId
)
{
// eslint-disable-next-line class-methods-use-this
const
geoNodeDetailsPath
=
`
${
this
.
geoNodeDetailsBasePath
}
/
${
nodeId
}
/status.json`
;
getGeoNodeDetails
(
node
)
{
return
axios
.
get
(
geoNodeDetailsPath
);
return
axios
.
get
(
node
.
statusPath
,
{
params
:
{
refresh
:
true
,
},
});
}
// eslint-disable-next-line class-methods-use-this
toggleNode
(
node
)
{
return
axios
.
put
(
node
.
basePath
,
{
enabled
:
!
node
.
enabled
,
// toggle from existing status
});
}
// eslint-disable-next-line class-methods-use-this
repairNode
(
node
)
{
return
axios
.
post
(
node
.
repairPath
);
}
// eslint-disable-next-line class-methods-use-this
removeNode
(
node
)
{
return
axios
.
delete
(
node
.
basePath
);
}
}
}
}
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