bigbeard
bigbeard
WWindmill
Created by bigbeard on 11/29/2023 in #help
Best practices for Importing React app in development and production environments
one thing I wanted to add here: If I can white label this application as well individually, I'm trying to put together a demo and would be happy to pay for a public license to remove any branding (1-3 months depending on how long I need to keep it up) and allow anyone to publicly interact with it if they have the link (similar to the windmill app UI)
20 replies
WWindmill
Created by bigbeard on 11/29/2023 in #help
Best practices for Importing React app in development and production environments
excellent! If you need help testing let me know. would love to have this one working 🙂
20 replies
WWindmill
Created by bigbeard on 11/29/2023 in #help
Best practices for Importing React app in development and production environments
No description
20 replies
WWindmill
Created by bigbeard on 11/29/2023 in #help
Best practices for Importing React app in development and production environments
So I never did find a solution for this (callling an external API) however, switching to executeWorkspaceScript fixed my issue 🙂
20 replies
WWindmill
Created by bigbeard on 11/29/2023 in #help
Best practices for Importing React app in development and production environments
No description
20 replies
WWindmill
Created by bigbeard on 11/29/2023 in #help
Best practices for Importing React app in development and production environments
No description
20 replies
WWindmill
Created by bigbeard on 11/29/2023 in #help
Best practices for Importing React app in development and production environments
@rubenf on a related topic to the react template .. are there timeouts that can be adjusted on windmill-hosted scripts? Not for one step in a flow, but when calling a single script. Some of these larger PDFs timeout when uploading (only when calling from the React app, not from the Windmill App Builder UI). I can send a more detailed video/screenshot in a bit if this does not make aense
20 replies
WWindmill
Created by bigbeard on 11/29/2023 in #help
Best practices for Importing React app in development and production environments
awesome, TYVM!
20 replies
WWindmill
Created by bigbeard on 11/29/2023 in #help
Best practices for Importing React app in development and production environments
aha, aka: /api/w/automation-architech/jobs/run_wait_result/p/u/doug/brisk_script
20 replies
WWindmill
Created by bigbeard on 11/29/2023 in #help
Best practices for Importing React app in development and production environments
ere's a snippet of the code I'm using to handle the file upload:
async function handleFileUpload(event: React.ChangeEvent<HTMLInputElement>) {
if (event.target.files) {
const file = event.target.files[0];
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onloadend = async function() {
if (reader.result) {
const base64data = typeof reader.result === 'string' ? reader.result.split(',')[1] : '';
const body = JSON.stringify({
"file_": base64data
});
const endpoint = `https://app.windmill.dev/api/w/automation-architech/jobs/run_wait_result/p/u/doug/brisk_script`;

try {
const response = await fetch(endpoint, {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer {token}"
},
body
});

if (!response.ok) {
throw new Error('Network response was not ok');
}

const data = await response.json();
console.log(data);
} catch (error) {
console.error('Error:', error);
}
}
}
}
}
async function handleFileUpload(event: React.ChangeEvent<HTMLInputElement>) {
if (event.target.files) {
const file = event.target.files[0];
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onloadend = async function() {
if (reader.result) {
const base64data = typeof reader.result === 'string' ? reader.result.split(',')[1] : '';
const body = JSON.stringify({
"file_": base64data
});
const endpoint = `https://app.windmill.dev/api/w/automation-architech/jobs/run_wait_result/p/u/doug/brisk_script`;

try {
const response = await fetch(endpoint, {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer {token}"
},
body
});

if (!response.ok) {
throw new Error('Network response was not ok');
}

const data = await response.json();
console.log(data);
} catch (error) {
console.error('Error:', error);
}
}
}
}
}
20 replies