-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: remove unused components/files/slices/types * fix: remove some unused packages and file upload download old api * fix: remove pixi simulator * refactor: change utils folder structure * fix: modify docker-compose file and update README. add 2022 dance configs * fix: update gif of the README.md
- Loading branch information
Showing
258 changed files
with
256 additions
and
1,508,915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import axios from "./axios"; | ||
import { notification } from "core/utils"; | ||
|
||
export const uploadeExportDataApi = async (uploadFile) => { | ||
const formData = new FormData(); | ||
formData.append("data", uploadFile); | ||
const response = await axios.post("/uploadData", formData); | ||
if (response.request.statusText === "OK") | ||
notification.success("Upload Success. Please refresh."); | ||
else notification.error("Upload Failed."); | ||
}; | ||
|
||
export const downloadExportDataApi = async () => { | ||
const response = await axios.get("/exportData.json"); | ||
if (response.request.statusText === "OK") return response.data; | ||
else notification.error("Download Failed."); | ||
}; | ||
|
||
export const uploadLedDataApi = async (ledFile) => { | ||
const formData = new FormData(); | ||
formData.append("data", ledFile); | ||
const response = await axios.post("/uploadLED", formData); | ||
if (response.request.statusText === "OK") | ||
notification.success("Upload Success. Please refresh."); | ||
else notification.error("Upload Failed."); | ||
}; | ||
|
||
export const downloadLedDataApi = async () => { | ||
const response = await axios.get("/exportLED.json"); | ||
if (response.request.statusText === "OK") return response.data; | ||
else notification.error("Download Failed."); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,6 @@ | ||
import store from "../store"; | ||
|
||
//axios for api | ||
import axios from "./axios"; | ||
|
||
import { notification } from "core/utils"; | ||
|
||
export * from "./controlAgent"; | ||
export * from "./positionAgent"; | ||
export * from "./dancerAgent"; | ||
export * from "./ledAgent"; | ||
export * from "./effectListAgent"; | ||
|
||
// TODO add type | ||
export const uploadJson = (file, type) => { | ||
const formData = new FormData(); | ||
|
||
formData.append(type, file); | ||
if (type === "position" && type === "control") { | ||
fetch(`/api/editor/upload/${type}`, { | ||
method: "POST", | ||
body: formData, | ||
}) | ||
.then((response) => response.json()) | ||
.then((data) => { | ||
console.log(data); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
} | ||
}; | ||
|
||
export const uploadeExportDataApi = async (uploadFile) => { | ||
const formData = new FormData(); | ||
formData.append("data", uploadFile); | ||
const response = await axios.post("/uploadData", formData); | ||
if (response.request.statusText === "OK") notification.success("Upload Success. Please refresh."); | ||
else notification.error("Upload Failed."); | ||
}; | ||
export const downloadExportDataApi = async () => { | ||
const response = await axios.get("/exportData.json"); | ||
if (response.request.statusText === "OK") return response.data; | ||
else notification.error("Download Failed."); | ||
}; | ||
export const uploadLedDataApi = async (ledFile) => { | ||
const formData = new FormData(); | ||
formData.append("data", ledFile); | ||
const response = await axios.post("/uploadLED", formData); | ||
if (response.request.statusText === "OK") notification.success("Upload Success. Please refresh."); | ||
else notification.error("Upload Failed."); | ||
}; | ||
export const downloadLedDataApi = async () => { | ||
const response = await axios.get("/exportLED.json"); | ||
if (response.request.statusText === "OK") return response.data; | ||
else notification.error("Download Failed."); | ||
}; | ||
export const uploadImages = (files, path, imagePrefix) => { | ||
const formData = new FormData(); | ||
files.forEach((file, i) => { | ||
formData.append(`image${i}`, file); | ||
}); | ||
|
||
formData.append("filePath", path); | ||
formData.append("imagePrefix", imagePrefix); | ||
|
||
fetch("/api/editor/upload/images", { | ||
method: "POST", | ||
body: formData, | ||
}) | ||
.then((response) => response.json()) | ||
.then((data) => { | ||
console.log(data); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
}; | ||
|
||
export const requestDownload = (control, position, texture) => { | ||
const payload = JSON.stringify({ control, position, texture }); | ||
|
||
fetch("/api/editor/download", { | ||
method: "POST", | ||
body: payload, | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}) | ||
.then((response) => response.text()) | ||
.then((data) => { | ||
console.log(data); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
}; | ||
|
||
export const fetchTexture = () => { | ||
const texturePath = store.getState().load.load.Texture; | ||
return fetch(texturePath, { | ||
method: "GET", | ||
}) | ||
.then((response) => response.json()) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
}; | ||
export * from "./fileAgent"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.