|
|
|
@ -13,18 +13,49 @@ function callback(response) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getSCurveData(){ |
|
|
|
|
$.ajax({ |
|
|
|
|
headers: { |
|
|
|
|
"Content-Type": "application/json", |
|
|
|
|
"Authorization": `Bearer ${token}` |
|
|
|
|
}, |
|
|
|
|
url: `${base_url}project/get-s-curve`, |
|
|
|
|
type: "POST", |
|
|
|
|
data:JSON.stringify(sCurvePayload), |
|
|
|
|
success: function (data) { |
|
|
|
|
callback(data) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Send a message to the parent window requesting the URL
|
|
|
|
|
window.parent.postMessage({ action: 'getUrl' }, '*'); |
|
|
|
|
|
|
|
|
|
// Listen for messages from the parent window
|
|
|
|
|
window.addEventListener('message', function(event) { |
|
|
|
|
if (event.data && event.data.action === 'sendUrl') { |
|
|
|
|
const parentUrl = event.data.url; |
|
|
|
|
|
|
|
|
|
// Remove the base URL and hash
|
|
|
|
|
const path = parentUrl.replace("http://localhost:3000/#/dashboard-project/", ""); |
|
|
|
|
|
|
|
|
|
// Split the remaining path by "/"
|
|
|
|
|
const parts = path.split("/"); |
|
|
|
|
if (parts[2] && parts[2] == "1") { |
|
|
|
|
$.ajax({ |
|
|
|
|
headers: { |
|
|
|
|
"Content-Type": "application/json", |
|
|
|
|
"Authorization": `Bearer ${token}` |
|
|
|
|
}, |
|
|
|
|
url: `${base_url}project/get-linear-s-curve`, |
|
|
|
|
type: "POST", |
|
|
|
|
data:JSON.stringify(sCurvePayload), |
|
|
|
|
success: function (data) { |
|
|
|
|
callback(data) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
$.ajax({ |
|
|
|
|
headers: { |
|
|
|
|
"Content-Type": "application/json", |
|
|
|
|
"Authorization": `Bearer ${token}` |
|
|
|
|
}, |
|
|
|
|
url: `${base_url}project/get-s-curve`, |
|
|
|
|
type: "POST", |
|
|
|
|
data:JSON.stringify(sCurvePayload), |
|
|
|
|
success: function (data) { |
|
|
|
|
callback(data) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function toggleOverlay() { |
|
|
|
@ -189,12 +220,7 @@ var lineOverlay = overlayControl.addOverlay(function(container) {
|
|
|
|
|
ticks: { |
|
|
|
|
display: true, |
|
|
|
|
min: 0, |
|
|
|
|
max: 100, |
|
|
|
|
stepSize: 10, |
|
|
|
|
callback: function(current) { |
|
|
|
|
if (current > 100) {return "";} |
|
|
|
|
return current + "%"; |
|
|
|
|
} |
|
|
|
|
stepSize: 100, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|