mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 15:27:47 -02:30
Update Mesh.js to allow for running AWX at non-root path (URL prefixing) (#14020)
Co-authored-by: Michael Abashian <mabashia@redhat.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import Base from '../Base';
|
|||||||
class JobEvents extends Base {
|
class JobEvents extends Base {
|
||||||
constructor(http) {
|
constructor(http) {
|
||||||
super(http);
|
super(http);
|
||||||
this.baseUrl = '/api/v2/job_events/';
|
this.baseUrl = 'api/v2/job_events/';
|
||||||
}
|
}
|
||||||
|
|
||||||
readChildren(id, params) {
|
readChildren(id, params) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import Base from '../Base';
|
|||||||
class Mesh extends Base {
|
class Mesh extends Base {
|
||||||
constructor(http) {
|
constructor(http) {
|
||||||
super(http);
|
super(http);
|
||||||
this.baseUrl = '/api/v2/mesh_visualizer/';
|
this.baseUrl = 'api/v2/mesh_visualizer/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default Mesh;
|
export default Mesh;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class Root extends Base {
|
|||||||
constructor(http) {
|
constructor(http) {
|
||||||
super(http);
|
super(http);
|
||||||
this.baseUrl = 'api/';
|
this.baseUrl = 'api/';
|
||||||
this.redirectURL = '/api/v2/config/';
|
this.redirectURL = 'api/v2/config/';
|
||||||
}
|
}
|
||||||
|
|
||||||
async login(username, password, redirect = this.redirectURL) {
|
async login(username, password, redirect = this.redirectURL) {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ describe('RootAPI', () => {
|
|||||||
|
|
||||||
expect(mockHttp.post).toHaveBeenCalledTimes(2);
|
expect(mockHttp.post).toHaveBeenCalledTimes(2);
|
||||||
expect(mockHttp.post.mock.calls[0]).toContainEqual(
|
expect(mockHttp.post.mock.calls[0]).toContainEqual(
|
||||||
'username=foo&password=bar&next=%2Fapi%2Fv2%2Fconfig%2F'
|
'username=foo&password=bar&next=api%2Fv2%2Fconfig%2F'
|
||||||
);
|
);
|
||||||
expect(mockHttp.post.mock.calls[1]).toContainEqual(
|
expect(mockHttp.post.mock.calls[1]).toContainEqual(
|
||||||
'username=foo&password=bar&next=baz'
|
'username=foo&password=bar&next=baz'
|
||||||
|
|||||||
Reference in New Issue
Block a user