Skip to content

Commit

Permalink
solve issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoud-elghonemy committed Jul 26, 2022
1 parent ff2f266 commit c58363d
Show file tree
Hide file tree
Showing 13 changed files with 21,806 additions and 4,065 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.idea
.idea
venv

8,371 changes: 4,335 additions & 4,036 deletions legacy/tensormap-client/package-lock.json

Large diffs are not rendered by default.

17,329 changes: 17,329 additions & 0 deletions tensormap-client/package-lock.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions tensormap-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"@emotion/core": "^11.0.0",
"@emotion/react": "^11.4.0",
"@emotion/styled": "^11.3.0",
"@material-ui/core": "^4.12.4",
"@projectstorm/react-diagrams": "^6.5.2",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
Expand Down Expand Up @@ -33,8 +34,8 @@
"web-vitals": "^1.1.2"
},
"scripts": {
"start": "react-scripts --openssl-legacy-provider start",
"build": "react-scripts build",
"build": "react-scripts build --openssl-legacy-provider",
"start": "react-scripts start --openssl-legacy-provider",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand All @@ -57,6 +58,7 @@
]
},
"devDependencies": {
"@types/lodash": "^4.14.171"
"@types/lodash": "^4.14.171",
"@types/react": "^18.0.15"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import styled from '@emotion/styled';
import NodeList from "../NodesList/NodeList";
import * as strings from "../../../constants/Strings";
import {subject} from "../../../services";
import { string } from 'mathjs';

export interface BodyWidgetProps {
app: Application;
Expand Down Expand Up @@ -79,9 +80,10 @@ class BodyWidget extends React.Component<BodyWidgetProps> {
<div className="title"> Model Deep neural network</div>
</S.Header>
<S.Content>
<TrayWidget>
<NodeList/>
</TrayWidget>

< TrayWidget childern={<NodeList/>}/>

{/* </TrayWidget> */}
<S.Layer
onDrop={(event) => {
let data = JSON.parse(event.dataTransfer.getData('storm-diagram-node'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ namespace S {
`;
}

export class TrayWidget extends React.Component {
render() {
return <S.Tray>{this.props.children}</S.Tray>;
}
export function TrayWidget(props:any){

const {childern}=props
return <S.Tray>{childern}</S.Tray>;

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import * as React from 'react';
import styled from '@emotion/styled';
import { css, Global } from '@emotion/react';
import { css, Global, PropsOf } from '@emotion/react';

export interface DemoCanvasWidgetProps {
color?: string;
background?: string;
childern? : JSX.Element;
}

namespace S {
Expand Down Expand Up @@ -55,17 +56,18 @@ namespace S {
`;
}

export class DemoCanvasWidget extends React.Component<DemoCanvasWidgetProps> {
render() {
export const DemoCanvasWidget =(props:any)=>{

console.log(props)
return (
<>
<Global styles={S.Expand} />
<S.Container
background={this.props.background || 'rgb(60, 60, 60)'}
color={this.props.color || 'rgba(255,255,255, 0.05)'}>
{this.props.children}
background={props.background || 'rgb(60, 60, 60)'}
color={props.color || 'rgba(255,255,255, 0.05)'}>
{props.childern}
</S.Container>
</>
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ export const DemoButton = styled.button`
}
`;

export class DemoWorkspaceWidget extends React.Component<DemoWorkspaceWidgetProps> {
render() {
export const DemoWorkspaceWidget =(props:any)=>{

return (
<S.Container>
<S.Toolbar>{this.props.buttons}</S.Toolbar>
<S.Content>{this.props.children}</S.Content>
<S.Toolbar>{props.buttons}</S.Toolbar>
<S.Content>{props.children}</S.Content>
</S.Container>
);
}

}
2 changes: 1 addition & 1 deletion tensormap-client/src/containers/DataUpload/DataUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class DataUpload extends Component {
<div>
<Grid columns={2} relaxed='very' stackable>
<Grid.Column >
<Segment textAlign='center' size='huge'>{strings.UPLOAD_NEW_FILE_TITLE}</Segment>
<Segment textAlign='center' size='huge'>{"mdskafjkjdsakfljkl"}</Segment>
<NewFile/>
</Grid.Column>
<Grid.Column >
Expand Down
5 changes: 0 additions & 5 deletions tensormap-server/.env.example

This file was deleted.

14 changes: 14 additions & 0 deletions tensormap-server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,25 @@
from shared.services.config import get_configs
from shared.utils import get_socket_ref

# from flask_sqlalchemy import SQLAlchemy
# from flask_bcrypt import Bcrypt

load_dotenv()
configs = get_configs()

app = Flask(__name__)

# app.config['SECRET_KEY'] = '123456789'
# app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db'
# app.config['db_name'] = 'tensormap_mysql'
# app.config['db_host'] = 'localhost'
# app.config['db_password'] = '123456789'
# app.config['db_user'] = 'tensormap_user'
#
# db = SQLAlchemy(app)
# bcrypt = Bcrypt(app)
# db.create_all()

MainURLRegister(app=app)
SettingUp(app=app)
CORS(app)
Expand Down
95 changes: 95 additions & 0 deletions tensormap-server/migrations/versions/8c0a5e6ec8cf_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
"""empty message
Revision ID: 8c0a5e6ec8cf
Revises: 8f6baba4a236
Create Date: 2022-07-11 23:42:30.547433
"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "8c0a5e6ec8cf"
down_revision = "8f6baba4a236"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"data_file",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("file_name", sa.String(length=100), nullable=False),
sa.Column("file_type", sa.String(length=10), nullable=False),
sa.Column("created_on", sa.DateTime(), server_default=sa.text("now()"), nullable=True),
sa.Column("updated_on", sa.DateTime(), server_default=sa.text("now()"), nullable=True),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"data_process",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("target", sa.String(length=10), nullable=False),
sa.Column("file_id", sa.Integer(), nullable=True),
sa.Column("created_on", sa.DateTime(), server_default=sa.text("now()"), nullable=True),
sa.Column("updated_on", sa.DateTime(), server_default=sa.text("now()"), nullable=True),
sa.ForeignKeyConstraint(
["file_id"],
["data_file.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"model_basic",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("model_name", sa.String(length=50), nullable=False),
sa.Column("model_dataset", sa.Integer(), nullable=True),
sa.Column("model_type", sa.Integer(), nullable=False),
sa.Column("target_class", sa.String(length=50), nullable=False),
sa.Column("created_on", sa.DateTime(), server_default=sa.text("now()"), nullable=True),
sa.Column("updated_on", sa.DateTime(), server_default=sa.text("now()"), nullable=True),
sa.ForeignKeyConstraint(
["model_dataset"],
["data_file.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"model_configs",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("parameter", sa.String(length=50), nullable=False),
sa.Column("value", sa.String(length=50), nullable=False),
sa.Column("model_id", sa.Integer(), nullable=True),
sa.Column("created_on", sa.DateTime(), server_default=sa.text("now()"), nullable=True),
sa.Column("updated_on", sa.DateTime(), server_default=sa.text("now()"), nullable=True),
sa.ForeignKeyConstraint(
["model_id"],
["model_basic.id"],
),
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
"model_results",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("model_id", sa.Integer(), nullable=True),
sa.Column("epoc", sa.Integer(), nullable=False),
sa.Column("iteration", sa.Integer(), nullable=False),
sa.Column("metric", sa.String(length=50), nullable=False),
sa.Column("value", sa.Float(), nullable=False),
sa.ForeignKeyConstraint(
["model_id"],
["model_basic.id"],
),
sa.PrimaryKeyConstraint("id"),
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("model_results")
op.drop_table("model_configs")
op.drop_table("model_basic")
op.drop_table("data_process")
op.drop_table("data_file")
# ### end Alembic commands ###
Empty file added tensormap-server/site.db
Empty file.

0 comments on commit c58363d

Please sign in to comment.