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 = () => {
if (typeof window !== `undefined` && store !== 0)
return ( return (
<Provider store={store}> <Provider store={ store }>
<Root /> <Root />
</Provider> </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,4 +1,5 @@
export const loadState = () => { export const loadState = () => {
if ( typeof window !== 'undefined' ) {
try { try {
const serializedState = localStorage.getItem('state') const serializedState = localStorage.getItem('state')
@ -13,9 +14,11 @@ export const loadState = () => {
console.log(err) console.log(err)
return undefined return undefined
} }
}
}; };
export const saveState = (state) => { export const saveState = (state) => {
if ( typeof window !== 'undefined' ) {
try { try {
const serializedState = JSON.stringify(state) const serializedState = JSON.stringify(state)
@ -29,4 +32,5 @@ export const saveState = (state) => {
} catch (err) { } catch (err) {
console.log('save in local storage error') console.log('save in local storage error')
} }
}
}; };

View File

@ -10,9 +10,14 @@ 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`) {
persistedState = loadState()
}
export const store = typeof window !== `undefined`
? configureStore({
reducer: { reducer: {
modelCrudReducer, modelCrudReducer,
renderCrudReducer, renderCrudReducer,
@ -21,12 +26,17 @@ export const store = configureStore({
userCrudReducer userCrudReducer
}, },
preloadedState: persistedState preloadedState: persistedState
}) })
: 0
store.subscribe(() => { if (typeof window !== `undefined`) {
store.subscribe(() => {
saveState(store.getState()); saveState(store.getState());
}); });
store.subscribe(lodash.throttle(() => { store.subscribe(lodash.throttle(() => {
saveState(store.getState()) saveState(store.getState())
}, 100)) }, 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%;