Fixed multiple issues with how files are downloaded and uploaded

This commit is contained in:
frikky
2022-08-24 01:01:54 +02:00
parent 41945f79b2
commit 546e752705
7 changed files with 55 additions and 63 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ require (
github.com/h2non/filetype v1.1.3 github.com/h2non/filetype v1.1.3
github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20170819232839-0fbfe93532da // indirect github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20170819232839-0fbfe93532da // indirect
github.com/satori/go.uuid v1.2.0 github.com/satori/go.uuid v1.2.0
github.com/shuffle/shuffle-shared v0.2.79 github.com/shuffle/shuffle-shared v0.2.87
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce
google.golang.org/api v0.65.0 google.golang.org/api v0.65.0
+38 -38
View File
@@ -1,43 +1,43 @@
version: '3' version: '3'
services: services:
#frontend: frontend:
# #build: ./frontend #build: ./frontend
# image: ghcr.io/frikky/shuffle-frontend:nightly image: ghcr.io/frikky/shuffle-frontend:nightly
# container_name: shuffle-frontend container_name: shuffle-frontend
# hostname: shuffle-frontend hostname: shuffle-frontend
# ports: ports:
# - "${FRONTEND_PORT}:80" - "${FRONTEND_PORT}:80"
# - "${FRONTEND_PORT_HTTPS}:443" - "${FRONTEND_PORT_HTTPS}:443"
# networks: networks:
# - shuffle - shuffle
# environment: environment:
# - BACKEND_HOSTNAME=${BACKEND_HOSTNAME} - BACKEND_HOSTNAME=${BACKEND_HOSTNAME}
# restart: unless-stopped restart: unless-stopped
# depends_on: depends_on:
# - backend - backend
#backend: backend:
# #build: ./backend #build: ./backend
# image: ghcr.io/frikky/shuffle-backend:nightly image: ghcr.io/frikky/shuffle-backend:nightly
# container_name: shuffle-backend container_name: shuffle-backend
# hostname: ${BACKEND_HOSTNAME} hostname: ${BACKEND_HOSTNAME}
# # Here for debugging: # Here for debugging:
# ports: ports:
# - "${BACKEND_PORT}:5001" - "${BACKEND_PORT}:5001"
# networks: networks:
# - shuffle - shuffle
# volumes: volumes:
# - /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
# - ${SHUFFLE_APP_HOTLOAD_LOCATION}:/shuffle-apps:z - ${SHUFFLE_APP_HOTLOAD_LOCATION}:/shuffle-apps:z
# - ${SHUFFLE_FILE_LOCATION}:/shuffle-files:z - ${SHUFFLE_FILE_LOCATION}:/shuffle-files:z
# #- ${SHUFFLE_OPENSEARCH_CERTIFICATE_FILE}:/shuffle-files/es_certificate #- ${SHUFFLE_OPENSEARCH_CERTIFICATE_FILE}:/shuffle-files/es_certificate
# env_file: .env env_file: .env
# environment: environment:
# #- DOCKER_HOST=tcp://docker-socket-proxy:2375 #- DOCKER_HOST=tcp://docker-socket-proxy:2375
# - SHUFFLE_APP_HOTLOAD_FOLDER=/shuffle-apps - SHUFFLE_APP_HOTLOAD_FOLDER=/shuffle-apps
# - SHUFFLE_FILE_LOCATION=/shuffle-files - SHUFFLE_FILE_LOCATION=/shuffle-files
# restart: unless-stopped restart: unless-stopped
# #depends_on: #depends_on:
# #- opensearch #Not necessary because dependancy is handled within the backend itself instead #- opensearch #Not necessary because dependancy is handled within the backend itself instead
#- database #- database
orborus: orborus:
image: ghcr.io/frikky/shuffle-orborus:nightly image: ghcr.io/frikky/shuffle-orborus:nightly
+1 -2
View File
@@ -37,7 +37,6 @@ import {
PlayArrow as PlayArrowIcon, PlayArrow as PlayArrowIcon,
} from "@material-ui/icons"; } from "@material-ui/icons";
import WorkflowPaper from "../components/WorkflowPaper.jsx"
const searchClient = algoliasearch("JNSS5CFDZZ", "db08e40265e2941b9a7d8f644b6e5240") const searchClient = algoliasearch("JNSS5CFDZZ", "db08e40265e2941b9a7d8f644b6e5240")
const CreatorGrid = props => { const CreatorGrid = props => {
@@ -174,7 +173,7 @@ const CreatorGrid = props => {
</Typography> </Typography>
</div> </div>
<Typography variant="body1" color="textSecondary" style={{marginTop: 10, }}> <Typography variant="body1" color="textSecondary" style={{marginTop: 10, }}>
<b>10</b> apps <span style={{marginLeft: 15, }}/><b>23</b> workflows <b>{data.apps}</b> apps <span style={{marginLeft: 15, }}/><b>{data.workflows}</b> workflows
</Typography> </Typography>
{data.specialized_apps !== undefined && data.specialized_apps !== null && data.specialized_apps.length > 0 ? {data.specialized_apps !== undefined && data.specialized_apps !== null && data.specialized_apps.length > 0 ?
<AvatarGroup max={10} style={{flexDirection: "row", padding: 0, margin: 0, itemAlign: "left", textAlign: "left",}}> <AvatarGroup max={10} style={{flexDirection: "row", padding: 0, margin: 0, itemAlign: "left", textAlign: "left",}}>
+10 -17
View File
@@ -1338,20 +1338,18 @@ const Admin = (props) => {
const downloadFile = (file) => { const downloadFile = (file) => {
fetch(globalUrl + "/api/v1/files/" + file.id + "/content", { fetch(globalUrl + "/api/v1/files/" + file.id + "/content", {
method: "GET", method: "GET",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
credentials: "include", credentials: "include",
}) })
.then((response) => { .then((response) => {
if (response.status !== 200) { if (response.status !== 200) {
console.log("Status not 200 for apps :O!"); console.log("Status not 200 for apps :O!");
return ""; return "";
} }
return response.text(); console.log("Resp: ", response)
})
return response.blob()
})
.then((respdata) => { .then((respdata) => {
if (respdata.length === 0) { if (respdata.length === 0) {
alert.error("Failed getting file. Is it deleted?"); alert.error("Failed getting file. Is it deleted?");
@@ -1591,18 +1589,13 @@ const Admin = (props) => {
document.title = "Shuffle - admin"; document.title = "Shuffle - admin";
} }
console.log("NEWVALUE: ", newValue);
if (newValue === 6) { if (newValue === 6) {
console.log("Should get apps for categories."); console.log("Should get apps for categories.");
} }
console.log("PROPS: ", props);
navigate(`/admin?tab=${views[newValue]}`); navigate(`/admin?tab=${views[newValue]}`);
setModalUser({}); setModalUser({});
}; }
if (firstRequest) { if (firstRequest) {
setFirstRequest(false); setFirstRequest(false);
+3 -1
View File
@@ -776,7 +776,9 @@ const UsecaseListComponent = ({keys, isCloud, globalUrl, frameworkData, isLogged
var baseTypeInfo = subcase.type !== undefined ? subcase.type : "communication" var baseTypeInfo = subcase.type !== undefined ? subcase.type : "communication"
if (frameworkData !== undefined && frameworkData !== null) { if (frameworkData !== undefined && frameworkData !== null) {
if (frameworkData[baseTypeInfo] !== undefined && frameworkData[baseTypeInfo] !== null && subdata.app !== undefined && subdata.app !== null) { if (frameworkData[baseTypeInfo] !== undefined && frameworkData[baseTypeInfo] !== null && subdata.app !== undefined && subdata.app !== null) {
if (frameworkData[baseTypeInfo].name.toLowerCase().replaceAll("_", " ") === subdata.app.toLowerCase().replaceAll("_", " ")) { console.log("Name: ", frameworkData[baseTypeInfo], baseTypeInfo)
console.log("Name2: ", subdata.app)
if (frameworkData[baseTypeInfo].name !== undefined && frameworkData[baseTypeInfo].name.toLowerCase().replaceAll("_", " ") === subdata.app.toLowerCase().replaceAll("_", " ")) {
highlight = true highlight = true
} }
} }
+1 -1
View File
@@ -164,7 +164,7 @@ const Search = (props) => {
<DocsGrid maxRows={6} parsedXs={12} showSuggestion={true} globalUrl={globalUrl} isMobile={isMobile} userdata={userdata} /> <DocsGrid maxRows={6} parsedXs={12} showSuggestion={true} globalUrl={globalUrl} isMobile={isMobile} userdata={userdata} />
: :
curTab === 3 ? curTab === 3 ?
<CreatorGrid maxRows={3} parsedXs={4} showSuggestion={true} globalUrl={globalUrl} isMobile={isMobile} userdata={userdata} /> <CreatorGrid parsedXs={4} showSuggestion={true} globalUrl={globalUrl} isMobile={isMobile} userdata={userdata} />
: :
null} null}
</div> </div>
+1 -3
View File
@@ -2949,9 +2949,7 @@ const Workflows = (props) => {
const WorkflowView = () => { const WorkflowView = () => {
if (workflows.length === 0) { if (workflows.length === 0) {
console.log("USER: ", userdata) if ((userdata.tutorials !== undefined && userdata.tutorials !== null && !userdata.tutorials.includes("getting-started")) || userdata.tutorials === null) {
console.log("PROPS: ", props)
if (userdata.tutorials !== undefined && userdata.tutorials !== null && !userdata.tutorials.includes("getting-started")) {
return <Navigate to="/getting-started" replace />; return <Navigate to="/getting-started" replace />;
} }