mirror of
https://github.com/ansible/awx.git
synced 2026-01-27 00:21:30 -03:30
Prevent the user from launching multiple jobs by rapidly clicking on buttons
This commit is contained in:
parent
3eaea396be
commit
480aaeace5
@ -47,6 +47,9 @@ function LaunchButton({ resource, children }) {
|
|||||||
const [error, setError] = useState(null);
|
const [error, setError] = useState(null);
|
||||||
|
|
||||||
const handleLaunch = async () => {
|
const handleLaunch = async () => {
|
||||||
|
if (isLaunching) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
setIsLaunching(true);
|
setIsLaunching(true);
|
||||||
const readLaunch =
|
const readLaunch =
|
||||||
resource.type === 'workflow_job_template'
|
resource.type === 'workflow_job_template'
|
||||||
@ -104,6 +107,10 @@ function LaunchButton({ resource, children }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const launchWithParams = async (params) => {
|
const launchWithParams = async (params) => {
|
||||||
|
if (isLaunching) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setIsLaunching(true);
|
||||||
try {
|
try {
|
||||||
let jobPromise;
|
let jobPromise;
|
||||||
|
|
||||||
@ -141,6 +148,9 @@ function LaunchButton({ resource, children }) {
|
|||||||
let readRelaunch;
|
let readRelaunch;
|
||||||
let relaunch;
|
let relaunch;
|
||||||
|
|
||||||
|
if (isLaunching) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
setIsLaunching(true);
|
setIsLaunching(true);
|
||||||
if (resource.type === 'inventory_update') {
|
if (resource.type === 'inventory_update') {
|
||||||
// We'll need to handle the scenario where the src no longer exists
|
// We'll need to handle the scenario where the src no longer exists
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user