Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Febi Chajadi (fec935)
spaces-dashboard
Commits
e85370a2
Commit
e85370a2
authored
May 10, 2021
by
Febi Chajadi (fec935)
Browse files
Modified uploader field in upload form.
parent
fd004b2f
Changes
4
Hide whitespace changes
Inline
Side-by-side
public/appicon.png
0 → 100644
View file @
e85370a2
24.2 KB
public/index.html
View file @
e85370a2
...
...
@@ -2,14 +2,14 @@
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<link
rel=
"icon"
href=
"%PUBLIC_URL%/
fav
icon.
ico
"
/>
<link
rel=
"icon"
href=
"%PUBLIC_URL%/
app
icon.
png
"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<meta
name=
"theme-color"
content=
"#000000"
/>
<meta
name=
"description"
content=
"Upload 3D assets for later deployment on the AR-enabled Shared Spaces mobile app."
/>
<link
rel=
"apple-touch-icon"
href=
"%PUBLIC_URL%/
logo192
.png"
/>
<link
rel=
"apple-touch-icon"
href=
"%PUBLIC_URL%/
appicon
.png"
/>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
...
...
public/manifest.json
View file @
e85370a2
...
...
@@ -3,17 +3,17 @@
"name"
:
"Create React App Sample"
,
"icons"
:
[
{
"src"
:
"
fav
icon.
ico
"
,
"src"
:
"
app
icon.
png
"
,
"sizes"
:
"64x64 32x32 24x24 16x16"
,
"type"
:
"image/x-icon"
},
{
"src"
:
"
logo192
.png"
,
"src"
:
"
appicon
.png"
,
"type"
:
"image/png"
,
"sizes"
:
"192x192"
},
{
"src"
:
"
logo512
.png"
,
"src"
:
"
appicon
.png"
,
"type"
:
"image/png"
,
"sizes"
:
"512x512"
}
...
...
src/App.js
View file @
e85370a2
...
...
@@ -34,6 +34,8 @@ function App() {
const
[
xRot
,
setRotX
]
=
useState
(
0
);
const
[
yRot
,
setRotY
]
=
useState
(
0
);
const
[
zRot
,
setRotZ
]
=
useState
(
0
);
let
texture
=
""
;
let
filename
=
""
;
const
changeSize
=
(
newsizenum
)
=>
{
unityContent
.
send
(
"
scriptManager
"
,
"
adjustSize
"
,
newsizenum
);
...
...
@@ -96,9 +98,9 @@ function App() {
}
})*/
Promise.all([promise1, promise2, promise3]).then(res => {
res.forEach(element => {
console.log(element);
});
//
res.forEach(element => {
//
console.log(element);
//
});
toast.success(
'
Upload
successful
!
'
);
//var origfn = files[0].name;
//var newname = origfn.split(
'
.
'
).slice(0, -1).join(
'
.
'
);
...
...
@@ -109,12 +111,20 @@ function App() {
} else {
unityContent.send("scriptManager", "loadSimple", newname);
}*/
for (var x = 0; x < files.length; x++){
var thisname = files[x].name.split(
'
.
'
).pop();
if (thisname ===
'
obj
'
){
filename = files[x].name;
}
}
if(baked){
var newname = "";
for (var i = 0; i < files.length; i++){
var poppedName = files[i].name.split(
'
.
'
).pop();
if(poppedName === "mtl" || poppedName === "obj"){
newname = newname + files[i].name + "
\t
";
} else if (poppedName ===
'
png
'
|| poppedName ===
'
jpg
'
|| poppedName ===
'
jpeg
'
){
texture = files[x].name;
}
}
var editedText = newname.slice(0, -1);
...
...
@@ -127,7 +137,7 @@ function App() {
createItem();
})
.catch(err => {
console.log(err);
//
console.log(err);
toast.warn(
'
Upload
failed
.
'
);
});
}
...
...
@@ -141,6 +151,7 @@ function App() {
artistinfo.append(
'
artworks
'
, title);
artistinfo.append(
'
exhibitions
'
,
''
);
artistinfo.append(
'
galleries
'
,
''
);
artistinfo.append(
'
uploader
'
, token);
await axios.post(
"https://sharedspaces-dev.usask.ca/uploadconnect/artistcreate.php",
artistinfo
...
...
@@ -157,15 +168,7 @@ function App() {
}
const createItem = async() => {
let texture = "";
if(baked){
for (var x = 0; x < files.length; x++){
var eName = files[x].name.split(
'
.
'
).pop();
if (eName ===
'
png
'
|| eName ===
'
jpg
'
|| eName ===
'
jpeg
'
){
texture = files[x].name;
}
}
}
//var filename = files.filter(file => file.name.split(
'
.
'
.pop() ===
'
obj
'
));
const iteminfo = new FormData();
iteminfo.append(
'
itemName
'
, title);
iteminfo.append(
'
size
'
, size);
...
...
@@ -182,6 +185,7 @@ function App() {
iteminfo.append(
'
baked
'
, baked);
iteminfo.append(
'
uploader
'
, token);
iteminfo.append(
'
texture
'
, texture);
iteminfo.append(
'
itemfilename
'
, filename);
await axios.post(
"https://sharedspaces-dev.usask.ca/uploadconnect/newinfo.php",
iteminfo
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment