Old changes

feature/2_forms
TBS093A 2021-05-17 21:20:22 +02:00
parent 74a68fb6b4
commit 03f8d7292e
11 changed files with 93 additions and 55 deletions

View File

@ -1,3 +1,2 @@
node_modules/ node_modules/
.cache/ .cache/
public/

View File

@ -1,12 +1,8 @@
FROM node:14.4.0 FROM nginx:1.19.0-alpine
WORKDIR /usr/src/app COPY ./public /app/public
COPY package*.json ./ RUN mkdir -p /var/www/work_front/html && \
RUN npm install cp -r /app/public/* /var/www/work_front/html/
COPY . . COPY ./default.conf /etc/nginx/conf.d/default.conf
RUN npm install -g gatsby-cli
CMD ['gatsby', 'develop', '-H', '0.0.0.0:8000']

13
default.conf 100644
View File

@ -0,0 +1,13 @@
server {
listen 80;
listen [::]:80;
root /var/www/work_front/html;
index index.html index.htm index.nginx-debian.html;
server_name work_front www.work_front;
location / {
try_files $uri $uri/ =404;
}
}

View File

@ -56,6 +56,12 @@ const ModelUploadForm = () => {
refList={ [] } refList={ [] }
action={ handleModelUpload } action={ handleModelUpload }
/> />
<p>
{ 'info' in upload_blend_file_status
? upload_blend_file_status.info
: ''
}
</p>
</div> </div>
) )
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 KiB

View File

@ -30,7 +30,7 @@ const CanvasBackgroundAnimation = () => {
line_linked: { line_linked: {
enable: true, enable: true,
distance: 150, distance: 150,
color: menuColor, color: darkGreen,
opacity: 0.4, opacity: 0.4,
width: 1 width: 1
}, },

View File

@ -1,5 +1,4 @@
import React from 'react'; import React from 'react';
// import ReactDOM from 'react-dom';
import '../styles/general.scss' import '../styles/general.scss'
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
@ -11,11 +10,17 @@ import Root from './func_group/root';
// echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p // echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
const IndexPage = () => { const IndexPage = () => {
return ( if (typeof window !== `undefined` && store !== 0)
<Provider store={store}> return (
<Root /> <Provider store={ store }>
</Provider> <Root />
) </Provider>
)
else
return (
<>
</>
)
} }
export default IndexPage export default IndexPage

View File

@ -1,3 +1,4 @@
let API = 'localhost:9090' // let API = 'localhost:9090'
let API = 'render_app_backend:9090'
export const GeneralAddress = 'http://' + API export const GeneralAddress = 'http://' + API
export const GeneralAddressWS = 'ws://' + API + '/render' export const GeneralAddressWS = 'ws://' + API + '/render'

View File

@ -1,32 +1,36 @@
export const loadState = () => { export const loadState = () => {
try { if ( typeof window !== 'undefined' ) {
const serializedState = localStorage.getItem('state') try {
const serializedState = localStorage.getItem('state')
if (serializedState === undefined || serializedState === null) { if (serializedState === undefined || serializedState === null) {
return {} return {}
} else { } else {
return JSON.parse(serializedState) return JSON.parse(serializedState)
}
} catch (err) {
console.log(err)
return undefined
} }
} catch (err) {
console.log(err)
return undefined
} }
}; };
export const saveState = (state) => { export const saveState = (state) => {
try { if ( typeof window !== 'undefined' ) {
try {
const serializedState = JSON.stringify(state) const serializedState = JSON.stringify(state)
if (serializedState === null) { if (serializedState === null) {
return undefined return undefined
} else { } else {
localStorage.setItem('state', serializedState) localStorage.setItem('state', serializedState)
}
} catch (err) {
console.log('save in local storage error')
} }
} catch (err) {
console.log('save in local storage error')
} }
}; };

View File

@ -10,23 +10,33 @@ import { userAuthReducer } from './slices/userAuthSlice'
import { userCrudReducer } from './slices/userCrudSlice' import { userCrudReducer } from './slices/userCrudSlice'
let persistedState = loadState() let persistedState = null
export const store = configureStore({ if (typeof window !== `undefined`) {
reducer: { persistedState = loadState()
modelCrudReducer, }
renderCrudReducer,
renderWebsocketReducer,
userAuthReducer,
userCrudReducer
},
preloadedState: persistedState
})
store.subscribe(() => { export const store = typeof window !== `undefined`
saveState(store.getState()); ? configureStore({
}); reducer: {
modelCrudReducer,
renderCrudReducer,
renderWebsocketReducer,
userAuthReducer,
userCrudReducer
},
preloadedState: persistedState
})
: 0
store.subscribe(lodash.throttle(() => { if (typeof window !== `undefined`) {
saveState(store.getState())
}, 100)) store.subscribe(() => {
saveState(store.getState());
});
store.subscribe(lodash.throttle(() => {
saveState(store.getState())
}, 100))
}

View File

@ -2,7 +2,11 @@
body { body {
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
background-color: rgba(0,128,0,1); // background-color: rgba(0,128,0,1);
background:
url("../images/background.jpg")
rgba(0,128,0,1) 100%;
background-size: 100% auto;
width: 100%; width: 100%;
height: 100%; height: 100%;