├── .elasticbeanstalk
└── config.yml
├── .gitignore
├── .vscode
└── settings.json
├── LICENSE
├── README.md
├── __tests__
├── leftPanelTests
│ ├── compareTest.jsx
│ └── historyTest.jsx
├── rightPanelTests
│ ├── schemaChildrenTests
│ │ ├── dataChildrenTests
│ │ │ └── dataTableTest.jsx
│ │ └── dataTest.jsx
│ └── tabsChildrenTests
│ │ └── tabTest.jsx
├── setupTests.js
└── splashTest.jsx
├── assets
└── icons
│ ├── mac
│ └── seeqr.icns
│ ├── png
│ ├── 128x128.png
│ ├── 16x16.png
│ ├── 256x256.png
│ ├── 32x32.png
│ ├── 48x48.png
│ └── 64x64.png
│ └── win
│ └── seeqr.ico
├── babel.config.js
├── backend
├── dbController.ts
├── dbRouter.ts
├── dummyDataMain.ts
├── foreign_key_info.ts
├── models.ts
├── queryController.ts
├── queryRouter.ts
└── server.ts
├── buildspec.yml
├── dist
├── 447ae718e8d58c1c86342db7d43708ff.png
├── bundle.js
├── e56674964778f35b6d253c59f04da235.png
└── index.html
├── frontend
├── assets
│ ├── images
│ │ ├── caseyescovedo.png
│ │ ├── caseywalker.png
│ │ ├── catherinechiu.png
│ │ ├── chrisakinrinade.png
│ │ ├── comparisons.png
│ │ ├── data.png
│ │ ├── dummy_data_demo.gif
│ │ ├── franknorton.png
│ │ ├── graph_demo.gif
│ │ ├── history.png
│ │ ├── jameskolotouros.png
│ │ ├── jennifercourtner.png
│ │ ├── justinduryagri.png
│ │ ├── katieklochan.png
│ │ ├── logo_color.png
│ │ ├── logo_monochrome.png
│ │ ├── logo_readme.png
│ │ ├── mercerstronck.png
│ │ ├── muhammadtrad.png
│ │ ├── query_demo.gif
│ │ ├── samfrakes.png
│ │ ├── schema_input.png
│ │ ├── seeqr_dock.png
│ │ ├── serenakuo.png
│ │ ├── splash_page.png
│ │ └── web_app_interface.png
│ └── stylesheets
│ │ ├── css
│ │ ├── components.css
│ │ ├── layout.css
│ │ ├── modal.css
│ │ ├── style.css
│ │ └── variables.css
│ │ └── scss
│ │ ├── components.scss
│ │ ├── layout.scss
│ │ ├── modal.scss
│ │ ├── style.scss
│ │ └── variables.scss
├── components
│ ├── App.tsx
│ ├── LoadingModal.tsx
│ ├── MainPanel.tsx
│ ├── Splash.tsx
│ ├── leftPanel
│ │ ├── Compare.tsx
│ │ └── History.tsx
│ └── rightPanel
│ │ ├── SchemaContainer.tsx
│ │ ├── Tabs.tsx
│ │ ├── schemaChildren
│ │ ├── Data.tsx
│ │ ├── DummyDataPanel.tsx
│ │ ├── Query.tsx
│ │ ├── SchemaModal.tsx
│ │ └── dataChildren
│ │ │ └── DataTable.tsx
│ │ └── tabsChildren
│ │ └── Tab.tsx
└── index.tsx
├── package.json
├── tsCompiled
├── babel.config.js
├── babel.config.js.map
├── backend
│ ├── dbController.js
│ ├── dbController.js.map
│ ├── dbRouter.js
│ ├── dbRouter.js.map
│ ├── dummyDataMain.js
│ ├── dummyDataMain.js.map
│ ├── foreign_key_info.js
│ ├── foreign_key_info.js.map
│ ├── models.js
│ ├── models.js.map
│ ├── queryController.js
│ ├── queryController.js.map
│ ├── queryRouter.js
│ ├── queryRouter.js.map
│ ├── server.js
│ └── server.js.map
├── frontend
│ ├── ModelProvider.js
│ ├── ModelProvider.js.map
│ ├── components
│ │ ├── App.js
│ │ ├── App.js.map
│ │ ├── LoadingModal.js
│ │ ├── LoadingModal.js.map
│ │ ├── MainPanel.js
│ │ ├── MainPanel.js.map
│ │ ├── Splash.js
│ │ ├── Splash.js.map
│ │ ├── leftPanel
│ │ │ ├── Compare.js
│ │ │ ├── Compare.js.map
│ │ │ ├── History.js
│ │ │ └── History.js.map
│ │ └── rightPanel
│ │ │ ├── SchemaContainer.js
│ │ │ ├── SchemaContainer.js.map
│ │ │ ├── Tabs.js
│ │ │ ├── Tabs.js.map
│ │ │ ├── schemaChildren
│ │ │ ├── Data.js
│ │ │ ├── Data.js.map
│ │ │ ├── DummyDataPanel.js
│ │ │ ├── DummyDataPanel.js.map
│ │ │ ├── Query.js
│ │ │ ├── Query.js.map
│ │ │ ├── SchemaModal.js
│ │ │ ├── SchemaModal.js.map
│ │ │ └── dataChildren
│ │ │ │ ├── DataTable.js
│ │ │ │ └── DataTable.js.map
│ │ │ └── tabsChildren
│ │ │ ├── Tab.js
│ │ │ └── Tab.js.map
│ ├── index.js
│ └── index.js.map
├── webpack.config.js
└── webpack.config.js.map
├── tsconfig.json
└── webpack.config.js
/.elasticbeanstalk/config.yml:
--------------------------------------------------------------------------------
1 | branch-defaults:
2 | aws_version:
3 | environment: Seeqr-env
4 | environment-defaults:
5 | Seeqr-env:
6 | branch: null
7 | repository: null
8 | global:
9 | application_name: SeeQR
10 | default_ec2_keyname: null
11 | default_platform: Node.js 12 running on 64bit Amazon Linux 2
12 | default_region: us-east-2
13 | include_git_submodules: true
14 | instance_profile: null
15 | platform_name: null
16 | platform_version: null
17 | profile: eb-cli
18 | sc: git
19 | workspace_type: Application
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | */.DS_Store
3 | .DS_Store
4 | package-lock.json
5 | # Elastic Beanstalk Files
6 | .elasticbeanstalk/*
7 | !.elasticbeanstalk/*.cfg.yml
8 | !.elasticbeanstalk/*.global.yml
9 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "liveSassCompile.settings.formats": [
3 | {
4 | "format": "expanded",
5 | "savePath": "/frontend/assets/stylesheets/css",
6 | "extensionName": ".css"
7 | }
8 | ],
9 | "liveSassCompile.settings.generateMap": false
10 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Serena Kuo
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/__tests__/leftPanelTests/compareTest.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Compare } from "../../frontend/components/leftPanel/Compare";
3 | import { shallow } from "enzyme";
4 |
5 | describe ("Comparison feature tests", () => {
6 | // wrapper will be assigned the evaluation of the shallow render
7 | let wrapper;
8 |
9 | const props = {
10 | queries: [],
11 | currentSchema: '',
12 | }
13 | // shallow render the component before running tests
14 | beforeAll(() => {
15 | wrapper = shallow()
16 | })
17 |
18 | it('Should render a div', () => {
19 | expect(wrapper.type()).toEqual('div');
20 | })
21 |
22 | it('Should render correct h3 element', () => {
23 | expect(wrapper.containsMatchingElement(
24 |
Comparisons
)).toBeTruthy();
25 | })
26 |
27 | it('Should render query label', () => {
28 | expect(wrapper.containsMatchingElement(
29 | {'Query Label'} | )).toBeTruthy();
30 | })
31 |
32 | })
--------------------------------------------------------------------------------
/__tests__/leftPanelTests/historyTest.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { History } from "../../frontend/components/leftPanel/History";
3 | import { shallow } from "enzyme";
4 |
5 | describe ("History feature tests", () => {
6 | // wrapper will be assigned the evaluation of the shallow render
7 | let wrapper;
8 |
9 | const props = {
10 | queries: [],
11 | currentSchema: '',
12 |
13 | }
14 | // shallow render the component before running tests
15 | beforeAll(() => {
16 | wrapper = shallow()
17 | })
18 |
19 | it('Should render a div', () => {
20 | expect(wrapper.type()).toEqual('div');
21 | })
22 |
23 | it('Should render correct h3 element', () => {
24 | expect(wrapper.containsMatchingElement(
25 | History
)).toBeTruthy();
26 | })
27 |
28 | it('Should render query label', () => {
29 | expect(wrapper.containsMatchingElement(
30 | {'Query Label'} | )).toBeTruthy();
31 | })
32 |
33 | })
--------------------------------------------------------------------------------
/__tests__/rightPanelTests/schemaChildrenTests/dataChildrenTests/dataTableTest.jsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { mount, shallow } from 'enzyme';
3 | import { Table } from '../../../../frontend/components/rightPanel/schemaChildren/dataChildren/DataTable';
4 |
5 | const dummyRowData = [{"header0":"input0", "header1":1}]
6 |
7 | const dummyTableProps = {
8 | queries: [{
9 | queryString: "string",
10 | queryData: dummyRowData,
11 | queryStatistics: 7,
12 | querySchema: "string",
13 | queryLabel: "string"
14 | }]
15 | };
16 |
17 | describe('Testing the data table', () => {
18 | let wrapper;
19 | beforeAll(() => {
20 | wrapper = mount();
21 | })
22 |
23 | it('should render Table headers', () => {
24 | expect(wrapper.find('#dataTableHead').type()).toBe('thead');
25 | expect(wrapper.find('#dataTableHead').childAt(0).childAt(0).text()).toBe('HEADER0');
26 | expect(wrapper.find('#dataTableHead').childAt(0).childAt(1).text()).toBe('HEADER1');
27 | })
28 |
29 | it('should render data Table body element', () => {
30 | expect(wrapper.find('#dataTableBody').type()).toBe('tbody');
31 | })
32 | })
33 |
34 |
--------------------------------------------------------------------------------
/__tests__/rightPanelTests/schemaChildrenTests/dataTest.jsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { shallow } from 'enzyme';
3 | import { Data } from '../../../frontend/components/rightPanel/schemaChildren/Data';
4 |
5 |
6 | const dummyTableProps = {
7 | queries: [{
8 | queryString: "string",
9 | queryData: [{}],
10 | queryStatistics: 7,
11 | querySchema: "string",
12 | queryLabel: "string"
13 | }]
14 | };
15 |
16 | describe ("Data tests", () => {
17 | const { queries } = dummyTableProps;
18 |
19 | // shallow render the component before running tests
20 | let wrapper;
21 | beforeAll(() => {
22 | wrapper = shallow()
23 | })
24 |
25 | it('Should render a div', () => {
26 | expect(wrapper.type()).toEqual('div');
27 | })
28 |
29 | it('Should render h3 tag', () => {
30 | expect(wrapper.containsMatchingElement(
31 | Data Table
)).toBeTruthy();
32 | })
33 |
34 | it('Should render div to contain the data table', () => {
35 | expect(wrapper.find('#data-table').type()).toBe('div');
36 | })
37 | })
38 |
--------------------------------------------------------------------------------
/__tests__/rightPanelTests/tabsChildrenTests/tabTest.jsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { shallow } from 'enzyme';
3 | import { Tab } from '../../../frontend/components/rightPanel/tabsChildren/Tab';
4 |
5 | const dummyTabProps = {
6 | onClickTabItem: 'string',
7 | currentSchema: "string",
8 | label: "string",
9 | };
10 |
11 | describe ("Tab tests", () => {
12 | // shallow render the component before running tests
13 | let wrapper;
14 | beforeAll(() => {
15 | wrapper = shallow()
16 | })
17 |
18 | it('Should render a list item', () => {
19 | expect(wrapper.type()).toEqual('li');
20 | })
21 | })
22 |
--------------------------------------------------------------------------------
/__tests__/setupTests.js:
--------------------------------------------------------------------------------
1 | import { configure } from "enzyme";
2 | import React16Adapter from "enzyme-adapter-react-16";
3 |
4 | configure({ adapter: new React16Adapter() });
5 |
6 | describe('Setup', () => {
7 | it('should run before all tests', () => {
8 | expect(true).toBe(true);
9 | })
10 | })
--------------------------------------------------------------------------------
/__tests__/splashTest.jsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import { Splash } from "../frontend/components/Splash";
3 | import { shallow } from "enzyme";
4 |
5 | describe ("Splash page tests", () => {
6 | // mock functions to pass to handlers
7 | const mockFileClick = jest.fn(() => console.log("click"));
8 | const mockSkipClick = jest.fn(() => console.log("skipClick"));
9 | // props to be passed to the shallow render of the component
10 | const props = {
11 | openSplash: true,
12 | handleSkipClick: mockSkipClick,
13 | handleFileClick: mockFileClick
14 | };
15 |
16 | let wrapper;
17 | // shallow render the component before running tests
18 | beforeAll(() => {
19 | wrapper = shallow()
20 | });
21 |
22 | it('should find the correct elements by id', () => {
23 | expect(wrapper.find('#skip_button').type()).toBe('button');
24 | expect(wrapper.find('#yes_button').type()).toBe('button');
25 | });
26 |
27 | it('The functions passed down should be invoked on click', () => {
28 | // testing the skip button
29 | wrapper.find('#skip_button').simulate('click');
30 | expect(mockSkipClick).toHaveBeenCalled();
31 | // testing the import button
32 | wrapper.find('#yes_button').simulate('click');
33 | expect(mockFileClick).toHaveBeenCalled();
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/assets/icons/mac/seeqr.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/assets/icons/mac/seeqr.icns
--------------------------------------------------------------------------------
/assets/icons/png/128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/assets/icons/png/128x128.png
--------------------------------------------------------------------------------
/assets/icons/png/16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/assets/icons/png/16x16.png
--------------------------------------------------------------------------------
/assets/icons/png/256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/assets/icons/png/256x256.png
--------------------------------------------------------------------------------
/assets/icons/png/32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/assets/icons/png/32x32.png
--------------------------------------------------------------------------------
/assets/icons/png/48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/assets/icons/png/48x48.png
--------------------------------------------------------------------------------
/assets/icons/png/64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/assets/icons/png/64x64.png
--------------------------------------------------------------------------------
/assets/icons/win/seeqr.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/assets/icons/win/seeqr.ico
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | [
4 | '@babel/preset-env',
5 | {
6 | targets: {
7 | node: 'current',
8 | },
9 | },
10 | ],
11 | ],
12 | };
--------------------------------------------------------------------------------
/backend/dbController.ts:
--------------------------------------------------------------------------------
1 | const fetch = require('node-fetch');
2 | const { Pool } = require('pg');
3 | const users = {};
4 | const url = 'https://customer.elephantsql.com/api/instances';
5 | const key = '6f319a52-93f7-4608-9441-c53c9577d410';
6 | const password = "Basic " + Buffer.from(":" + key).toString("base64");
7 | let dbnum = 0;
8 |
9 | const options = str => ({
10 | method: str,
11 | headers: {
12 | Authorization: password,
13 | },
14 | })
15 |
16 | const deleteDB = async id => await fetch(`${url}/${id}`, options('DELETE'));
17 |
18 | const dbController = {
19 | makeDB: async (req, res, next) => {
20 | try {
21 | if (!('session_id' in req.cookies)) {
22 | const response = await fetch(
23 | `${url}?name=tempDB${++dbnum}9&plan=turtle®ion=amazon-web-services::us-east-1`,
24 | options('POST')
25 | );
26 | const data = await response.json();
27 | const { id, connectStr } = data;
28 | const expiry = 1800000; //30 minutes
29 | users[id] = new Pool({ connectionString: connectStr });
30 | res.cookie('session_id', id, { maxAge: expiry });
31 | setTimeout(() => deleteDB(id), expiry);
32 | } else {
33 | const response = await fetch(
34 | `${url}/${req.cookies.session_id}`,
35 | options('GET')
36 | );
37 | const data = await response.json();
38 | const { connectStr } = data;
39 | users[req.cookies.session_id] = new Pool({ connectionString: connectStr });
40 | }
41 | } catch {
42 | next();
43 | }
44 | next();
45 | },
46 | };
47 |
48 | export default dbController;
49 |
--------------------------------------------------------------------------------
/backend/dbRouter.ts:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 |
3 | const router = express.Router();
4 |
5 | const dbController = require('./dbController');
6 |
7 | router.get('return-db-list', dbController.returnDbList, (req, res) => {
8 | res.status(200).json(res.locals);
9 | });
10 |
11 | router.get('change-db', dbController.changeDb, (req, res) => {
12 | res.status(200).json(res.locals);
13 | });
14 |
15 | export default router;
16 |
--------------------------------------------------------------------------------
/backend/foreign_key_info.ts:
--------------------------------------------------------------------------------
1 | module.exports= {
2 | // This query lists each table that has a foreign key, the name of the table that key points to, and the name of the column at which the foreign key constraint resides
3 | getForeignKeys:
4 | `select kcu.table_name as foreign_table,
5 | rel_kcu.table_name as primary_table,
6 | kcu.column_name as fk_column
7 | from information_schema.table_constraints tco
8 | join information_schema.key_column_usage kcu
9 | on tco.constraint_name = kcu.constraint_name
10 | join information_schema.referential_constraints rco
11 | on tco.constraint_name = rco.constraint_name
12 | join information_schema.key_column_usage rel_kcu
13 | on rco.unique_constraint_name = rel_kcu.constraint_name
14 | where tco.constraint_type = 'FOREIGN KEY'
15 | order by kcu.table_schema,
16 | kcu.table_name,
17 | kcu.ordinal_position;`,
18 |
19 | // This query lists each table and the column name at which there is a primary key
20 | getPrimaryKeys:
21 | `select kcu.table_name as table_name,
22 | kcu.column_name as pk_column
23 | from information_schema.key_column_usage as kcu
24 | join information_schema.table_constraints as tco
25 | on tco.constraint_name = kcu.constraint_name
26 | where tco.constraint_type = 'PRIMARY KEY'
27 | order by kcu.table_name;`,
28 | }
29 |
30 |
31 |
32 | // structure of the key object for generating key compliant data
33 | // const KeyObject = {
34 | // // people:
35 | // Table_1: {
36 | // primaryKeyColumns: {
37 | // // id: true
38 | // _id: true
39 | // }
40 | // foreignKeyColumns: {
41 | // // species_id: n where n is the number of rows asked for in the primary table the key points to
42 | // foreignKeyColumnName_1: numOfRows,
43 | // foreignKeyColumnName_2: numOfRows
44 | // }
45 | // }
46 | // .
47 | // .
48 | // .
49 | // }
--------------------------------------------------------------------------------
/backend/queryController.ts:
--------------------------------------------------------------------------------
1 | const db = require('./models');
2 | const fetch = require('node-fetch');
3 | const { Pool } = require('pg');
4 | const key = '6f319a52-93f7-4608-9441-c53c9577d410';
5 | const password = "Basic " + Buffer.from(":" + key).toString("base64");
6 |
7 | const queryController = {
8 | executeQueryUntracked: (req, res, next) => {
9 | // event.sender.send('async-started');
10 |
11 | // destructure object from frontend
12 | const { queryString } = req.body;
13 | // run query on db
14 | db.query(queryString)
15 | .then(() => {
16 | (async function getListAsync() {
17 | let listObj = await db.getLists();
18 | // event.sender.send('db-lists', listObj);
19 | // event.sender.send('async-complete');
20 | })();
21 | })
22 | .then(next())
23 | .catch((error: string) => {
24 | // event.sender.send('query-error', 'Error executing query.');
25 | });
26 | },
27 |
28 | executeQueryTracked: async (req, res, next) => {
29 | // extract query string from client request
30 | const { queryString, queryLabel } = req.body.query;
31 | // declare a user object to hold connection string
32 | const users = {};
33 |
34 | const options = {
35 | method: 'GET',
36 | headers: {
37 | Authorization: password,
38 | },
39 | };
40 | const response = await fetch(
41 | `https://customer.elephantsql.com/api/instances/${req.cookies.session_id}`,
42 | options
43 | );
44 | const data = await response.json();
45 | const { url } = data;
46 | users[req.cookies.session_id] = new Pool({ connectionString: url });
47 |
48 | // match the connection pool based on cookies
49 | const pool = users[req.cookies['session_id']];
50 |
51 | const rows = await pool.query(queryString);
52 | res.locals.queryData = rows.rows;
53 | // Run EXPLAIN (FORMAT JSON, ANALYZE)
54 | if (!queryString.match(/create/i)) {
55 | const queryStats = await pool.query(
56 | 'EXPLAIN (FORMAT JSON, ANALYZE) ' + queryString
57 | );
58 | res.locals.queryStats = queryStats.rows;
59 | res.locals.queryLabel = queryLabel;
60 | }
61 |
62 | // send back to client
63 | return next();
64 | },
65 | generateDummyData: (req, res, next) => {
66 | next();
67 | },
68 | };
69 |
70 | export default queryController;
71 |
--------------------------------------------------------------------------------
/backend/queryRouter.ts:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 |
3 | const router = express.Router();
4 |
5 | import queryController from './queryController';
6 |
7 | router.get(
8 | '/execute-query-untracked',
9 | queryController.executeQueryUntracked,
10 | (req, res) => {
11 | res.status(200).json(res.locals);
12 | }
13 | );
14 |
15 | router.put(
16 | '/execute-query-tracked',
17 | queryController.executeQueryTracked,
18 | (req, res) => {
19 | res.status(200).json(res.locals);
20 | }
21 | );
22 |
23 | router.get(
24 | '/generate-dummy-data',
25 | queryController.generateDummyData,
26 | (req, res) => {
27 | res.status(200).json(res.locals);
28 | }
29 | );
30 |
31 | export default router;
32 |
--------------------------------------------------------------------------------
/backend/server.ts:
--------------------------------------------------------------------------------
1 | import queryRouter from './queryRouter';
2 |
3 | const express = require('express');
4 | const path = require('path');
5 | // const fetch = require('node-fetch');
6 | const cookieParser = require('cookie-parser');
7 |
8 | import dbController from './dbController';
9 |
10 | const server = express();
11 |
12 | //Parsing Middleware
13 | server.use(express.json());
14 | server.use(express.urlencoded({ extended: true }));
15 | server.use(cookieParser());
16 |
17 | server.get('/', dbController.makeDB, (req, res) => {
18 | return res.sendFile(path.join(__dirname, '../../dist/index.html'));
19 | });
20 |
21 | server.use(express.static('dist'));
22 |
23 | server.use('/query', queryRouter);
24 |
25 | // default error handler
26 | server.use((err, req, res, next) => {
27 | const defaultErr = {
28 | log: 'Express error handler caught unknown middleware error',
29 | status: 400,
30 | message: { err: 'An error occurred' },
31 | };
32 | const errorObj = Object.assign({}, defaultErr, err);
33 | console.log(errorObj.log);
34 | return res.status(errorObj.status).json(errorObj.message);
35 | });
36 |
37 | server.listen(process.env.PORT || 3000, () => console.log('listening on port 3000'));
38 |
39 | export default server;
40 |
--------------------------------------------------------------------------------
/buildspec.yml:
--------------------------------------------------------------------------------
1 | version: 0.2
2 |
3 | env:
4 | variables:
5 | NODE_ENV: "production"
6 |
7 |
8 | phases:
9 | install:
10 | runtime-versions:
11 | nodejs: 12
12 | commands:
13 | - npm install
14 | # pre_build:
15 | # commands:
16 | # - npm run test
17 | # build:
18 | # commands:
19 | # - npm run build
20 | artifacts:
21 | files:
22 | - package.json
23 | - tsCompiled/backend/*
24 | - tsCompiled/babel.config.js
25 | - tsCompiled/babel.config.js.map
26 | - tsCompiled/webpack.config.js
27 | - tsCompiled/webpack.config.js.map
28 | - dist/*
29 | - assets/*
30 | - __tests__/*
--------------------------------------------------------------------------------
/dist/447ae718e8d58c1c86342db7d43708ff.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/dist/447ae718e8d58c1c86342db7d43708ff.png
--------------------------------------------------------------------------------
/dist/e56674964778f35b6d253c59f04da235.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/dist/e56674964778f35b6d253c59f04da235.png
--------------------------------------------------------------------------------
/dist/index.html:
--------------------------------------------------------------------------------
1 | SeeQR
--------------------------------------------------------------------------------
/frontend/assets/images/caseyescovedo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/caseyescovedo.png
--------------------------------------------------------------------------------
/frontend/assets/images/caseywalker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/caseywalker.png
--------------------------------------------------------------------------------
/frontend/assets/images/catherinechiu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/catherinechiu.png
--------------------------------------------------------------------------------
/frontend/assets/images/chrisakinrinade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/chrisakinrinade.png
--------------------------------------------------------------------------------
/frontend/assets/images/comparisons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/comparisons.png
--------------------------------------------------------------------------------
/frontend/assets/images/data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/data.png
--------------------------------------------------------------------------------
/frontend/assets/images/dummy_data_demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/dummy_data_demo.gif
--------------------------------------------------------------------------------
/frontend/assets/images/franknorton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/franknorton.png
--------------------------------------------------------------------------------
/frontend/assets/images/graph_demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/graph_demo.gif
--------------------------------------------------------------------------------
/frontend/assets/images/history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/history.png
--------------------------------------------------------------------------------
/frontend/assets/images/jameskolotouros.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/jameskolotouros.png
--------------------------------------------------------------------------------
/frontend/assets/images/jennifercourtner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/jennifercourtner.png
--------------------------------------------------------------------------------
/frontend/assets/images/justinduryagri.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/justinduryagri.png
--------------------------------------------------------------------------------
/frontend/assets/images/katieklochan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/katieklochan.png
--------------------------------------------------------------------------------
/frontend/assets/images/logo_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/logo_color.png
--------------------------------------------------------------------------------
/frontend/assets/images/logo_monochrome.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/logo_monochrome.png
--------------------------------------------------------------------------------
/frontend/assets/images/logo_readme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/logo_readme.png
--------------------------------------------------------------------------------
/frontend/assets/images/mercerstronck.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/mercerstronck.png
--------------------------------------------------------------------------------
/frontend/assets/images/muhammadtrad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/muhammadtrad.png
--------------------------------------------------------------------------------
/frontend/assets/images/query_demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/query_demo.gif
--------------------------------------------------------------------------------
/frontend/assets/images/samfrakes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/samfrakes.png
--------------------------------------------------------------------------------
/frontend/assets/images/schema_input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/schema_input.png
--------------------------------------------------------------------------------
/frontend/assets/images/seeqr_dock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/seeqr_dock.png
--------------------------------------------------------------------------------
/frontend/assets/images/serenakuo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/serenakuo.png
--------------------------------------------------------------------------------
/frontend/assets/images/splash_page.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/splash_page.png
--------------------------------------------------------------------------------
/frontend/assets/images/web_app_interface.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/open-source-labs/SeeQR-Web/2fd83fcbfa0633400ce112100c6da3eecc27baaf/frontend/assets/images/web_app_interface.png
--------------------------------------------------------------------------------
/frontend/assets/stylesheets/css/components.css:
--------------------------------------------------------------------------------
1 | @import url("https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap");
2 | @import url("https://fonts.googleapis.com/css2?family=PT+Mono&display=swap");
3 | #query-window .text-field {
4 | width: 100%;
5 | height: 200px;
6 | }
7 |
8 | .label-field,
9 | .schema-label {
10 | font-family: "PT Mono", monospace;
11 | color: #6cbba9;
12 | margin-left: 8px;
13 | }
14 |
15 | #splash-menu button {
16 | border: 0.5px #444c50 solid;
17 | background-color: #596368;
18 | border-radius: 3px;
19 | padding: 5px;
20 | border: none;
21 | font-size: 1em;
22 | outline: none;
23 | }
24 | #splash-menu button:hover {
25 | background-color: #c6d2d5;
26 | }
27 |
28 | #query-panel {
29 | max-width: 90%;
30 | }
31 | #query-panel button {
32 | border: 0.5px #444c50 solid;
33 | background-color: #596368;
34 | border-radius: 3px;
35 | padding: 5px;
36 | border: none;
37 | font-size: 0.8em;
38 | outline: none;
39 | }
40 | #query-panel button:hover {
41 | background-color: #c6d2d5;
42 | }
43 |
44 | #main-right button {
45 | border: 0.5px #444c50 solid;
46 | background-color: #596368;
47 | border-radius: 3px;
48 | border: none;
49 | outline: none;
50 | }
51 | #main-right button:hover {
52 | background-color: #6cbba9;
53 | }
54 |
55 | textarea {
56 | min-height: 300px;
57 | background-color: #444c50;
58 | margin: 10px 0;
59 | width: 90%;
60 | padding: 8px;
61 | outline: none;
62 | border: none;
63 | color: #6cbba9;
64 | font-family: "PT Mono", monospace;
65 | }
66 |
67 | table.scroll-box {
68 | border: 0.5px solid #444c50;
69 | background: none;
70 | overflow-y: scroll;
71 | padding: 5px;
72 | font-size: 1em;
73 | line-height: 1.5em;
74 | }
75 |
76 | tbody .top-row {
77 | border-bottom: 1px solid #444c50;
78 | }
79 | tbody .top-row td {
80 | font-weight: bold;
81 | }
82 |
83 | input {
84 | border-top-style: hidden;
85 | border-right-style: hidden;
86 | border-left-style: hidden;
87 | border-bottom-style: groove;
88 | background-color: #444c50;
89 | border: none;
90 | padding: 7px;
91 | min-width: 20em;
92 | outline: none;
93 | }
94 | input *:focus {
95 | outline: none;
96 | }
97 |
98 | .dummy-data-select {
99 | display: flex;
100 | flex-direction: row;
101 | padding: 1rem;
102 | align-items: center;
103 | }
104 |
105 | #dummy-rows-input {
106 | min-width: 10em;
107 | margin-left: 1.5em;
108 | margin-right: 1.5em;
109 | }
110 |
111 | .dummy-data-table-container {
112 | height: 10rem;
113 | overflow-y: auto;
114 | }
115 |
116 | .dummy-data-table {
117 | margin-left: auto;
118 | margin-right: auto;
119 | border: 1px solid #444c50;
120 | }
121 | .dummy-data-table th, .dummy-data-table tr {
122 | padding: 0.5rem;
123 | border-bottom: 1px solid #444c50;
124 | }
125 |
126 | .dummy-table-row td {
127 | padding: 0.5rem;
128 | text-align: center;
129 | }
130 |
131 | #generate-dummy-data {
132 | padding: 0.2rem;
133 | margin: 0.5rem;
134 | }
135 |
136 | #label-option {
137 | min-width: 60%;
138 | }
139 |
140 | .query-label {
141 | display: flex;
142 | flex-direction: row;
143 | align-items: center;
144 | justify-content: space-between;
145 | }
146 |
147 | #track {
148 | min-width: 10px;
149 | margin-left: 0.5rem;
150 | width: 1.2rem;
151 | height: 1.2rem;
152 | }
153 |
154 | #chart-option {
155 | display: flex;
156 | flex-direction: row;
157 | align-items: center;
158 | justify-content: space-around;
159 | }
160 |
161 | #data-table {
162 | overflow: auto;
163 | height: 25em;
164 | max-width: 90%;
165 | }
166 |
167 | .query-data {
168 | width: 1000px;
169 | }
170 |
171 | .codemirror {
172 | max-width: 90%;
173 | }
174 |
175 | .CodeMirror-scroll {
176 | overflow-x: scroll;
177 | }
178 |
179 | .ReactCodeMirror {
180 | max-width: 50rem;
181 | }
182 |
183 | #codemirror {
184 | padding: 15px 0;
185 | max-width: 30rem;
186 | }
187 |
188 | #data-table::-webkit-scrollbar-track {
189 | background: #c6d2d5;
190 | }
191 |
192 | #data-table::-webkit-scrollbar-thumb {
193 | background-color: #444c50;
194 | }
195 |
196 | .input-schema {
197 | display: block;
198 | }
199 |
200 | /* width */
201 | ::-webkit-scrollbar {
202 | width: 15px;
203 | }
204 |
205 | /* Track */
206 | ::-webkit-scrollbar-track {
207 | box-shadow: inset 0px 0px 5px grey;
208 | border-radius: 10px;
209 | }
210 |
211 | /* Handle */
212 | ::-webkit-scrollbar-thumb {
213 | background: #c6d2d5;
214 | border-radius: 15px;
215 | }
216 |
217 | .DD-Dropdown {
218 | max-height: 15rem;
219 | min-height: 10rem;
220 | min-width: 8rem;
221 | overflow-y: scroll;
222 | }
223 |
224 | /*# sourceMappingURL=components.css.map */
225 |
--------------------------------------------------------------------------------
/frontend/assets/stylesheets/css/layout.css:
--------------------------------------------------------------------------------
1 | @import url("https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap");
2 | @import url("https://fonts.googleapis.com/css2?family=PT+Mono&display=swap");
3 | #splash-page {
4 | display: flex;
5 | flex: 1;
6 | flex-direction: column;
7 | justify-content: center;
8 | align-items: center;
9 | height: 100vh;
10 | color: #c6d2d5;
11 | }
12 | #splash-page .splash-prompt {
13 | display: flex;
14 | flex-direction: column;
15 | margin-top: 30px;
16 | text-align: center;
17 | }
18 | #splash-page .splash-buttons {
19 | display: flex;
20 | flex-direction: row;
21 | margin-top: 50px;
22 | justify-content: space-around;
23 | }
24 | #splash-page .splash-buttons button {
25 | border: 0.5px #444c50 solid;
26 | background-color: #596368;
27 | border-radius: 3px;
28 | padding: 10px 25px 10px 25px;
29 | border: none;
30 | font-size: 1em;
31 | font-weight: bold;
32 | color: #2b2d35;
33 | outline: none;
34 | margin-top: 10px;
35 | }
36 | #splash-page .splash-buttons button:hover {
37 | background-color: #6cbba9;
38 | }
39 | #splash-page img {
40 | width: 300px;
41 | height: auto;
42 | margin-bottom: 30px;
43 | }
44 | #splash-page .logo {
45 | background-image: url("../../images/logo_color.png");
46 | width: 360px;
47 | height: 362px;
48 | }
49 |
50 | #custom-schema {
51 | display: flex;
52 | flex-direction: column;
53 | align-items: center;
54 | margin: 25px;
55 | }
56 |
57 | #import-schema {
58 | display: flex;
59 | flex-direction: column;
60 | align-items: center;
61 | margin: 25px;
62 | }
63 |
64 | #main-panel {
65 | display: flex;
66 | flex-direction: row;
67 | height: 100vh;
68 | overflow: hidden;
69 | background-image: url("../../images/logo_monochrome.png");
70 | background-repeat: no-repeat;
71 | background-position-x: right;
72 | background-position-y: bottom;
73 | }
74 |
75 | #main-left {
76 | width: 50%;
77 | display: flex;
78 | flex-direction: column;
79 | padding: 15px;
80 | background-color: #292a30;
81 | }
82 |
83 | #history-panel {
84 | height: 250px;
85 | display: flex;
86 | flex-direction: column;
87 | }
88 |
89 | .history-container {
90 | display: flex;
91 | flex-direction: column;
92 | height: 250px;
93 | overflow-y: auto;
94 | }
95 |
96 | #compare-panel {
97 | display: flex;
98 | flex-grow: 1;
99 | }
100 |
101 | #main-right {
102 | display: flex;
103 | flex-direction: column;
104 | flex-grow: 1;
105 | height: 100%;
106 | }
107 |
108 | #test-panels {
109 | display: flex;
110 | flex-direction: row;
111 | height: 100%;
112 | }
113 |
114 | #schema-left {
115 | display: flex;
116 | flex-direction: column;
117 | width: 50%;
118 | flex: 1;
119 | padding: 15px;
120 | border-right: 0.5px solid #444c50;
121 | }
122 |
123 | #query-panel {
124 | display: flex;
125 | flex-direction: column;
126 | height: 50%;
127 | z-index: 1000;
128 | }
129 |
130 | #data-panel {
131 | display: flex;
132 | flex-direction: column;
133 | flex-grow: 1;
134 | }
135 |
136 | #schema-right {
137 | display: flex;
138 | flex-direction: column;
139 | width: 50%;
140 | padding: 15px;
141 | height: 100%;
142 | }
143 |
144 | #results-panel {
145 | display: flex;
146 | flex-grow: 1;
147 | flex-direction: column;
148 | }
149 |
150 | .results-container {
151 | display: flex;
152 | flex-direction: column;
153 | height: 300px;
154 | overflow-y: auto;
155 | }
156 |
157 | /*# sourceMappingURL=layout.css.map */
158 |
--------------------------------------------------------------------------------
/frontend/assets/stylesheets/css/modal.css:
--------------------------------------------------------------------------------
1 | @import url("https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap");
2 | @import url("https://fonts.googleapis.com/css2?family=PT+Mono&display=swap");
3 | .modal {
4 | width: 350px;
5 | height: 400px;
6 | background-color: #30353a;
7 | border: 0.5px solid #c6d2d5;
8 | transition: 1.1s ease-out;
9 | box-shadow: -1rem 1rem 1rem rgba(0, 0, 0, 0.2);
10 | filter: blur(0);
11 | transform: scale(1);
12 | opacity: 1;
13 | visibility: visible;
14 | padding: 40px;
15 | z-index: 1010;
16 | position: fixed;
17 | top: 100px;
18 | }
19 | .modal button {
20 | padding: 10px;
21 | margin: 10px 0;
22 | }
23 |
24 | .modal.off {
25 | opacity: 0;
26 | visibility: hidden;
27 | filter: blur(8px);
28 | transform: scale(0.33);
29 | box-shadow: 1rem 0 0 rgba(0, 0, 0, 0.2);
30 | }
31 |
32 | .modal h2 {
33 | border-bottom: 1px solid #ccc;
34 | padding: 1rem;
35 | margin: 0;
36 | }
37 |
38 | .modal .content {
39 | padding: 1rem;
40 | }
41 |
42 | .modal input {
43 | margin: 10px 0;
44 | display: block;
45 | color: #6cbba9;
46 | font-family: "PT Mono", monospace;
47 | }
48 |
49 | .schema-text-field {
50 | height: 300px;
51 | width: 600px;
52 | }
53 |
54 | .modal-buttons {
55 | display: flex;
56 | flex-direction: row;
57 | }
58 |
59 | #horizontal {
60 | height: 1px;
61 | background-color: #ccc;
62 | }
63 |
64 | .load-schema {
65 | display: flex;
66 | flex-direction: row;
67 | align-items: baseline;
68 | }
69 |
70 | #load-button {
71 | margin-left: 20px;
72 | }
73 |
74 | .separator {
75 | display: flex;
76 | align-items: center;
77 | text-align: center;
78 | }
79 |
80 | .separator::before, .separator::after {
81 | content: "";
82 | flex: 1;
83 | border-bottom: 1px solid #ccc;
84 | }
85 |
86 | .separator::before {
87 | margin-right: 0.25em;
88 | }
89 |
90 | .separator::after {
91 | margin-left: 0.25em;
92 | }
93 |
94 | .copy-instance {
95 | display: flex;
96 | flex-direction: row;
97 | align-items: baseline;
98 | }
99 |
100 | #select-dropdown {
101 | margin-left: 20px;
102 | }
103 |
104 | #copy-data-checkbox {
105 | min-width: 10px;
106 | margin-left: 0.5rem;
107 | width: 1.2rem;
108 | height: 1.2rem;
109 | }
110 |
111 | .data-checkbox {
112 | display: flex;
113 | flex-direction: row;
114 | align-items: center;
115 | }
116 |
117 | #copy-button {
118 | margin-top: 20px;
119 | }
120 |
121 | #loading-modal {
122 | display: flex;
123 | flex-direction: column;
124 | align-items: center;
125 | justify-content: center;
126 | width: 100px;
127 | height: 50px;
128 | position: absolute;
129 | top: 50%;
130 | right: 50%;
131 | bottom: 50%;
132 | left: 50%;
133 | z-index: 1020;
134 | }
135 |
136 | /*# sourceMappingURL=modal.css.map */
137 |
--------------------------------------------------------------------------------
/frontend/assets/stylesheets/css/variables.css:
--------------------------------------------------------------------------------
1 | @import url("https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap");
2 | @import url("https://fonts.googleapis.com/css2?family=PT+Mono&display=swap");
3 |
4 | /*# sourceMappingURL=variables.css.map */
5 |
--------------------------------------------------------------------------------
/frontend/assets/stylesheets/scss/components.scss:
--------------------------------------------------------------------------------
1 | @import './variables.scss';
2 |
3 | #query-window {
4 | .text-field {
5 | width: 100%;
6 | height: 200px;
7 | }
8 | }
9 |
10 | .label-field,
11 | .schema-label {
12 | font-family: $font-input;
13 | color: $mint-green;
14 | margin-left: 8px;
15 | }
16 |
17 | #splash-menu {
18 | button {
19 | border: 0.5px $border-darkmode solid;
20 | background-color: $button-darkmode;
21 | border-radius: 3px;
22 | padding: 5px;
23 | border: none;
24 | font-size: 1em;
25 | outline: none;
26 | }
27 | button:hover {
28 | background-color: $primary-color-darkmode;
29 | }
30 | }
31 |
32 | #query-panel {
33 | max-width: 90%;
34 | button {
35 | border: 0.5px $border-darkmode solid;
36 | background-color: $button-darkmode;
37 | border-radius: 3px;
38 | padding: 5px;
39 | border: none;
40 | font-size: 0.8em;
41 | outline: none;
42 | }
43 | button:hover {
44 | background-color: $primary-color-darkmode;
45 | }
46 | }
47 | #main-right {
48 | button {
49 | border: 0.5px $border-darkmode solid;
50 | background-color: $button-darkmode;
51 | border-radius: 3px;
52 | border: none;
53 | // font-size: 0.8em;
54 | outline: none;
55 | }
56 | button:hover {
57 | background-color: $mint-green;
58 | }
59 | }
60 | textarea {
61 | min-height: 300px;
62 | background-color: $border-darkmode;
63 | margin: 10px 0;
64 | width: 90%;
65 | padding: 8px;
66 | outline: none;
67 | border: none;
68 | color: $mint-green;
69 | font-family: $font-input;
70 | }
71 |
72 | table.scroll-box {
73 | border: 0.5px solid $border-darkmode;
74 | background: none;
75 | overflow-y: scroll;
76 | padding: 5px;
77 | font-size: $default-text;
78 | line-height: 1.5em;
79 | }
80 |
81 | tbody {
82 | .top-row {
83 | border-bottom: 1px solid $border-darkmode;
84 | td {
85 | font-weight: bold;
86 | }
87 | }
88 | }
89 |
90 | input {
91 | border-top-style: hidden;
92 | border-right-style: hidden;
93 | border-left-style: hidden;
94 | border-bottom-style: groove;
95 | background-color: $border-darkmode;
96 | border: none;
97 | padding: 7px;
98 | min-width: 20em;
99 | outline: none;
100 | *:focus {
101 | outline: none;
102 | }
103 | }
104 |
105 | .dummy-data-select {
106 | display: flex;
107 | flex-direction: row;
108 | padding: 1rem;
109 | align-items: center;
110 | }
111 |
112 | #dummy-rows-input {
113 | min-width: 10em;
114 | margin-left: 1.5em;
115 | margin-right: 1.5em;
116 | }
117 |
118 | .dummy-data-table-container {
119 | // display: flex;
120 | // flex-direction: row;
121 | // align-items: center;
122 | // justify-content: center;
123 | height: 10rem;
124 | overflow-y: auto;
125 | }
126 |
127 | .dummy-data-table {
128 | margin-left: auto;
129 | margin-right: auto;
130 | border: 1px solid $border-darkmode;
131 | th, tr {
132 | padding: 0.5rem;
133 | border-bottom: 1px solid $border-darkmode;
134 | }
135 | }
136 |
137 | .dummy-table-row {
138 | td {
139 | padding: 0.5rem;
140 | text-align: center;
141 | }
142 | }
143 |
144 | #generate-dummy-data {
145 | padding: 0.2rem;
146 | margin: 0.5rem;
147 | }
148 |
149 | #label-option {
150 | min-width: 60%;
151 | }
152 |
153 | .query-label {
154 | display: flex;
155 | flex-direction: row;
156 | align-items: center;
157 | justify-content: space-between;
158 | }
159 |
160 | #track {
161 | min-width: 10px;
162 | margin-left: 0.5rem;
163 | width: 1.2rem;
164 | height: 1.2rem;
165 | }
166 |
167 | #chart-option {
168 | display: flex;
169 | flex-direction: row;
170 | align-items: center;
171 | justify-content: space-around;
172 | }
173 |
174 | #data-table {
175 | overflow: auto;
176 | height: 25em;
177 | max-width: 90%;
178 | }
179 |
180 | .query-data {
181 | width: 1000px;
182 | }
183 |
184 | .codemirror {
185 | max-width: 90%;
186 | }
187 |
188 | .CodeMirror-scroll {
189 | overflow-x: scroll;
190 | }
191 |
192 | .ReactCodeMirror {
193 | max-width: 50rem;
194 | }
195 |
196 | #codemirror {
197 | padding: 15px 0;
198 | max-width: 30rem;
199 | }
200 |
201 | #data-table::-webkit-scrollbar-track {
202 | background: $primary-color-darkmode;
203 | }
204 |
205 | #data-table::-webkit-scrollbar-thumb {
206 | background-color: $border-darkmode;
207 | }
208 |
209 |
210 |
211 | .input-schema {
212 | display:block;
213 | }
214 |
215 | /* width */
216 | ::-webkit-scrollbar {
217 | width: 15px;
218 | }
219 |
220 | /* Track */
221 | ::-webkit-scrollbar-track {
222 | box-shadow: inset 0px 0px 5px grey;
223 | border-radius: 10px;
224 | }
225 |
226 | /* Handle */
227 | ::-webkit-scrollbar-thumb {
228 | background: $primary-color-darkmode;
229 | border-radius: 15px;
230 | }
231 |
232 | .DD-Dropdown {
233 | max-height: 15rem;
234 | min-height: 10rem;
235 | min-width: 8rem;
236 | overflow-y: scroll;
237 | }
--------------------------------------------------------------------------------
/frontend/assets/stylesheets/scss/layout.scss:
--------------------------------------------------------------------------------
1 | @import './variables.scss';
2 |
3 | #splash-page {
4 | display: flex;
5 | flex: 1;
6 | flex-direction: column;
7 | justify-content: center;
8 | align-items: center;
9 | height: 100vh;
10 | // overflow: hidden;
11 | color: $primary-color-darkmode;
12 | .splash-prompt {
13 | display: flex;
14 | flex-direction: column;
15 | margin-top: 30px;
16 | text-align: center;
17 | }
18 | .splash-buttons {
19 | display: flex;
20 | flex-direction: row;
21 | margin-top: 50px;
22 | justify-content: space-around;
23 | button {
24 | border: 0.5px $border-darkmode solid;
25 | background-color: $button-darkmode;
26 | border-radius: 3px;
27 | padding: 10px 25px 10px 25px;
28 | border: none;
29 | font-size: 1em;
30 | font-weight: bold;
31 | color: $background-darkmode;
32 | outline: none;
33 | // margin: 0 5px;
34 | margin-top: 10px;
35 | }
36 | button:hover {
37 | background-color: $mint-green;
38 | }
39 | }
40 | img {
41 | width: 300px;
42 | height: auto;
43 | margin-bottom: 30px;
44 | }
45 | .logo {
46 | background-image: url('../../images/logo_color.png');
47 | width: 360px;
48 | height: 362px;
49 | }
50 | }
51 |
52 | #custom-schema {
53 | display: flex;
54 | flex-direction: column;
55 | align-items: center;
56 | margin: 25px;
57 | }
58 |
59 | #import-schema {
60 | display: flex;
61 | flex-direction: column;
62 | align-items: center;
63 | margin: 25px;
64 | }
65 |
66 | #main-panel {
67 | display: flex;
68 | flex-direction: row;
69 | height: 100vh;
70 | overflow: hidden;
71 | background-image: url('../../images/logo_monochrome.png');
72 | background-repeat: no-repeat;
73 | background-position-x: right;
74 | background-position-y: bottom;
75 | }
76 |
77 | #main-left {
78 | width: 50%;
79 | display: flex;
80 | flex-direction: column;
81 | padding: 15px;
82 | background-color: $background-darkmode-darker;
83 | }
84 | #history-panel {
85 | height: 250px;
86 | display: flex;
87 | flex-direction: column;
88 | }
89 |
90 | .history-container{
91 | display: flex;
92 | flex-direction: column;
93 | height: 250px;
94 | overflow-y: auto;
95 | }
96 |
97 | #compare-panel {
98 | display: flex;
99 | flex-grow: 1;
100 | }
101 |
102 | #main-right {
103 | display: flex;
104 | flex-direction: column;
105 | flex-grow: 1;
106 | height: 100%;
107 | }
108 |
109 | #test-panels {
110 | display: flex;
111 | flex-direction: row;
112 | height: 100%;
113 | }
114 |
115 | #schema-left {
116 | display: flex;
117 | flex-direction: column;
118 | width: 50%;
119 | flex: 1;
120 | padding: 15px;
121 | border-right: 0.5px solid $border-darkmode;
122 | }
123 | #query-panel {
124 | display: flex;
125 | flex-direction: column;
126 | height: 50%;
127 | z-index: 1000;
128 | }
129 | #data-panel {
130 | display: flex;
131 | flex-direction: column;
132 | flex-grow: 1;
133 | }
134 | #schema-right {
135 | display: flex;
136 | flex-direction: column;
137 | width: 50%;
138 | padding: 15px;
139 | height: 100%;
140 | }
141 |
142 | #results-panel {
143 | display: flex;
144 | flex-grow: 1;
145 | flex-direction: column;
146 | }
147 |
148 | .results-container{
149 | display:flex;
150 | flex-direction: column;
151 | height: 300px;
152 | overflow-y: auto;
153 | }
154 |
--------------------------------------------------------------------------------
/frontend/assets/stylesheets/scss/modal.scss:
--------------------------------------------------------------------------------
1 | @import './variables.scss';
2 | .modal {
3 | width: 350px;
4 | height: 400px;
5 | background-color: $background-modal-darkmode;
6 | border: 0.5px solid $primary-color-darkmode;
7 | transition: 1.1s ease-out;
8 | box-shadow: -1rem 1rem 1rem rgba(0, 0, 0, 0.2);
9 | filter: blur(0);
10 | transform: scale(1);
11 | opacity: 1;
12 | visibility: visible;
13 | padding: 40px;
14 | z-index: 1010;
15 | position: fixed;
16 | top: 100px;
17 | button {
18 | padding: 10px;
19 | margin: 10px 0;
20 | }
21 | }
22 | .modal.off {
23 | opacity: 0;
24 | visibility: hidden;
25 | filter: blur(8px);
26 | transform: scale(0.33);
27 | box-shadow: 1rem 0 0 rgba(0, 0, 0, 0.2);
28 | }
29 | // @supports (offset-rotation: 0deg) {
30 | // offset-rotation: 0deg;
31 | // offset-path: path("M 250,100 S -300,500 -700,-200");
32 | // .modal.off {
33 | // offset-distance: 100%;
34 | // }
35 | // }
36 | // @media (prefers-reduced-motion) {
37 | // .modal {
38 | // offset-path: none;
39 | // }
40 | // }
41 | .modal h2 {
42 | border-bottom: 1px solid #ccc;
43 | padding: 1rem;
44 | margin: 0;
45 | }
46 | .modal .content {
47 | padding: 1rem;
48 | }
49 | .modal input {
50 | margin: 10px 0;
51 | display: block;
52 | color: $mint-green;
53 | font-family: $font-input;
54 | }
55 | .schema-text-field {
56 | height: 300px;
57 | width: 600px;
58 | }
59 | .modal-buttons {
60 | display: flex;
61 | flex-direction: row;
62 | }
63 |
64 | #horizontal {
65 | height: 1px;
66 | background-color: #ccc;
67 | }
68 |
69 | .load-schema {
70 | display: flex;
71 | flex-direction: row;
72 | align-items: baseline;
73 |
74 | }
75 |
76 | #load-button {
77 | margin-left: 20px;
78 | }
79 |
80 | .separator {
81 | display: flex;
82 | align-items: center;
83 | text-align: center;
84 | }
85 | .separator::before, .separator::after {
86 | content: '';
87 | flex: 1;
88 | border-bottom: 1px solid #ccc;
89 | }
90 | .separator::before {
91 | margin-right: .25em;
92 | }
93 | .separator::after {
94 | margin-left: .25em;
95 | }
96 |
97 | .copy-instance {
98 | display: flex;
99 | flex-direction: row;
100 | align-items: baseline;
101 | }
102 |
103 | #select-dropdown {
104 | margin-left: 20px;
105 | }
106 |
107 | #copy-data-checkbox {
108 | min-width: 10px;
109 | margin-left: 0.5rem;
110 | width: 1.2rem;
111 | height: 1.2rem;
112 | }
113 |
114 | .data-checkbox {
115 | display: flex;
116 | flex-direction: row;
117 | align-items: center;
118 | }
119 |
120 | #copy-button {
121 | margin-top: 20px;
122 | }
123 |
124 | #loading-modal {
125 | display: flex;
126 | flex-direction: column;
127 | align-items: center;
128 | justify-content: center;
129 | width: 100px;
130 | height: 50px;
131 | position: absolute;
132 | top: 50%;
133 | right: 50%;
134 | bottom: 50%;
135 | left: 50%;
136 | z-index: 1020;
137 | }
--------------------------------------------------------------------------------
/frontend/assets/stylesheets/scss/style.scss:
--------------------------------------------------------------------------------
1 | @import './variables.scss';
2 | @import './components.scss';
3 | @import './layout.scss';
4 | @import './modal.scss';
5 |
6 | * {
7 | margin: 0;
8 | padding: 0;
9 | }
10 |
11 | body {
12 | background-color: $background-darkmode;
13 | font-family: $font-stack;
14 | font-weight: $p-weight;
15 | font-size: $default-text;
16 | line-height: 1/5;
17 | color: $primary-color-darkmode;
18 | height: 100%;
19 | }
20 |
21 | h3 {
22 | font-weight: bold;
23 | text-transform: uppercase;
24 | margin-bottom: 10px;
25 | }
26 |
27 | h4 {
28 | font-weight: $p-weight;
29 | font-size: 18px;
30 | }
31 |
32 | .compare-box {
33 | border: 0.5px solid #444c50;
34 | background: none;
35 | overflow: scroll;
36 | padding: 5px;
37 | font-size: 1em;
38 | line-height: 1.5em;
39 | }
40 | #compare-panel {
41 | display: -webkit-box;
42 | display: -ms-flexbox;
43 | display: flex;
44 | -webkit-box-orient: vertical;
45 | -webkit-box-direction: normal;
46 | -ms-flex-direction: column;
47 | flex-direction: column;
48 | margin-top: 2rem;
49 | }
50 |
51 | .compare-container {
52 | display: -webkit-box;
53 | display: -ms-flexbox;
54 | display: flex;
55 | -webkit-box-orient: vertical;
56 | -webkit-box-direction: normal;
57 | -ms-flex-direction: column;
58 | flex-direction: column;
59 | overflow-y: auto;
60 | height: 200px;
61 | }
62 |
63 |
64 | #add-query-button {
65 | width: 120px;
66 | margin-bottom: 15px;
67 | background-color: #596368;
68 | border-radius: 3px;
69 | padding: 5px;
70 | border: none;
71 | font-size: 0.8em;
72 | outline: none;
73 | }
74 |
75 | #add-query-button:hover {
76 | background-color: #c6d2d5;
77 | }
78 |
79 | .delete-query-button {
80 | width: 15px;
81 | background-color: transparent;
82 | font-size: 0.8em;
83 | outline: none;
84 | color: #c6d2d5;
85 | box-shadow: none;
86 | background-repeat: no-repeat;
87 | border: none;
88 | cursor: pointer;
89 | overflow: hidden;
90 | }
91 |
92 | .delete-query-button:hover {
93 | color: rgb(255, 0, 0);
94 | }
95 |
96 | .queryItem {
97 | background-color: #30353a;
98 | width: 100px;
99 | color: #c6d2d5;
100 | display: block;
101 | align-content: center;
102 | padding: 10px;
103 | text-decoration: none;
104 | font-family: 'PT Mono', monospace;
105 | }
106 |
107 | .queryItem:hover {
108 | background-color: #c6d2d5;
109 | color: #30353a;
110 | }
111 |
112 | .line-chart {
113 | margin-top: 2rem;
114 | }
115 |
116 | .bar-chart {
117 | margin-top: 3rem;
118 | height: 300px;
119 | display: block;
120 | }
121 |
122 | .tab-list {
123 | border-bottom: 2px solid #c6d2d5;
124 | // padding-left: 0 30 0 0;
125 | margin-right: 10px;
126 | display: flex;
127 | // justify-content: space-between;
128 | }
129 |
130 | .tab-list-item {
131 | display: inline-block;
132 | list-style: none;
133 | margin-bottom: -1px;
134 | padding: 0.5rem 0.75rem;
135 | font-weight: 500;
136 | letter-spacing: 0.5px;
137 | cursor: pointer;
138 |
139 | border: solid #ccc;
140 | border-width: 1px 1px 0 1px;
141 | border-radius: 15px 15px 0px 0px;
142 | }
143 |
144 | .tab-list-item:hover{
145 | // background-color: #c6d2d5;
146 | color:#c6d2d5;
147 | }
148 |
149 | .tab-list-active {
150 | background-color:rgb(108, 187, 169);
151 | border: solid #ccc;
152 | border-width: 1px 1px 0 1px;
153 | border-radius: 15px 15px 0px 0px;
154 | font-weight: 500;
155 | color: $background-darkmode-darker;
156 | }
157 | .close-button {
158 | top: 20px;
159 | right: 30px;
160 | position: fixed;
161 | background-color: transparent;
162 | font-weight: bold;
163 | }
164 |
165 | #input-schema-button {
166 | // padding: px;
167 | width: 50px;
168 | margin-bottom: 5px;
169 | font-size: 2em;
170 | font-weight: bold;
171 | margin-left: 5px;
172 | }
173 |
174 | #input-schema-button:hover {
175 | // background-color: #c6d2d5;
176 | color:#c6d2d5;
177 | }
178 |
179 | button:hover {
180 | cursor: pointer;
181 | }
182 |
183 | // #generate-data-button {
184 | // margin-top: 30px;
185 | // }
--------------------------------------------------------------------------------
/frontend/assets/stylesheets/scss/variables.scss:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');
2 | @import url('https://fonts.googleapis.com/css2?family=PT+Mono&display=swap');
3 |
4 | // typography
5 | $font-stack: 'PT Sans', sans-serif;
6 | $font-input: 'PT Mono', monospace;
7 | $p-weight: 100;
8 | $title-weight: 300;
9 | $default-text: 1em;
10 |
11 | // colors
12 | $background-darkmode: #2b2d35;
13 | $background-modal-darkmode: #30353a;
14 | $background-lightmode: #9abacc;
15 | $primary-color-lightmode: #1a1a1a;
16 | $primary-color-darkmode: #c6d2d5;
17 | $border-darkmode: #444c50;
18 | $button-darkmode: #596368;
19 | $background-darkmode-darker: #292a30;
20 | $mint-green: #6cbba9;
21 |
--------------------------------------------------------------------------------
/frontend/components/App.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Splash } from './Splash';
3 | import MainPanel from './MainPanel';
4 |
5 | // const { dialog } = require('electron').remote;
6 | // const { ipcRenderer } = window.require('electron');
7 |
8 | // type ClickEvent = React.MouseEvent;
9 |
10 | type state = {
11 | openSplash: boolean;
12 | };
13 |
14 | type AppProps = {};
15 |
16 | export class App extends Component {
17 | constructor(props: AppProps) {
18 | super(props);
19 | this.handleFileClick = this.handleFileClick.bind(this);
20 | this.handleSkipClick = this.handleSkipClick.bind(this);
21 | }
22 |
23 | // Splash page will always render upon opening App
24 | state: state = {
25 | openSplash: false,
26 | };
27 |
28 | async handleFileClick(event) {
29 | const files = event.target.files;
30 | const formData = new FormData();
31 | formData.append('myFile', files[0]);
32 | console.log(files);
33 |
34 | const response = await fetch('/schema/upload-file', {
35 | method: 'POST',
36 | body: formData,
37 | });
38 |
39 | this.setState({ openSplash: false });
40 | // dialog
41 | // .showOpenDialog({
42 | // properties: ['openFile'],
43 | // filters: [{ name: 'Custom File Type', extensions: ['tar', 'sql'] }],
44 | // message: 'Please upload .sql or .tar database file',
45 | // })
46 | // .then((result: object) => {
47 | // const filePathArr = result['filePaths'];
48 | // // send via channel to main process
49 | // if (!result['canceled']) {
50 | // ipcRenderer.send('upload-file', filePathArr);
51 | // this.setState({ openSplash: false });
52 | // }
53 | // })
54 | // .catch((err: object) => {
55 | // });
56 | }
57 |
58 | // Skips file upload and moves to main page.
59 | handleSkipClick(event) {
60 | // ipcRenderer.send('skip-file-upload');
61 | this.setState({ openSplash: false });
62 | }
63 |
64 | render() {
65 | // listen for menu to invoke handleFileClick
66 | // ipcRenderer.on('menu-upload-file', () => {
67 | // this.handleFileClick;
68 | // });
69 |
70 | return (
71 |
72 | {this.state.openSplash ? (
73 |
78 | ) : (
79 |
80 | )}
81 |
82 | );
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/frontend/components/LoadingModal.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import ReactLoading from 'react-loading';
3 |
4 | // "Loading" pop up renders whenever async functions are called
5 | const LoadingModal = (props) => {
6 | if (props.show) {
7 | return(
8 |
9 |
LOADING...
10 |
11 |
12 | );
13 | }
14 | else return null;
15 | }
16 |
17 | export default LoadingModal;
--------------------------------------------------------------------------------
/frontend/components/MainPanel.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Compare } from './leftPanel/Compare';
3 | import History from './leftPanel/History';
4 | import { Tabs } from './rightPanel/Tabs';
5 |
6 | type MainState = {
7 | queries: {
8 | queryString: string;
9 | queryData: {}[];
10 | queryStatistics: any;
11 | queryLabel: string;
12 | }[];
13 | loading: boolean;
14 | dbSize: string;
15 | };
16 | type MainProps = {};
17 | class MainPanel extends Component {
18 | constructor(props: MainProps) {
19 | super(props);
20 | // this.onClickTabItem = this.onClickTabItem.bind(this);
21 | this.submitQuery = this.submitQuery.bind(this);
22 | }
23 | state: MainState = {
24 | queries: [],
25 | // currentSchema will change depending on which Schema Tab user selects
26 | loading: false,
27 | dbSize: '',
28 | };
29 |
30 | submitQuery = async (event, query: String) => {
31 | event.preventDefault();
32 | const response = await fetch('/query/execute-query-tracked', {
33 | method: 'PUT',
34 | headers: { 'Content-Type': 'application/json' },
35 | body: JSON.stringify({ query }),
36 | });
37 | const returnedData = await response.json();
38 | const { queryData, queryStats, queryLabel } = returnedData;
39 |
40 | const newQuery = {
41 | queryString: '',
42 | queryData: queryData,
43 | queryStatistics: queryStats,
44 | queryLabel: queryLabel,
45 | };
46 |
47 | // create copy of current queries array
48 | let queries = this.state.queries.slice();
49 | // push new query object into copy of queries array
50 | queries.push(newQuery);
51 | this.setState({ queries });
52 | };
53 |
54 | render() {
55 | return (
56 |
57 |
63 |
64 |
65 |
66 |
67 |
68 | );
69 | }
70 | }
71 | export default MainPanel;
72 |
--------------------------------------------------------------------------------
/frontend/components/Splash.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | type SplashProps = {
4 | openSplash: boolean;
5 | handleFileClick: any;
6 | handleSkipClick: any;
7 | };
8 |
9 | export function Splash(props: SplashProps) {
10 | // a dialogue menu with retrieve the file path
11 | return (
12 |
13 |
14 |
15 |
Welcome!
16 |
17 |
18 |
Create custom schema
19 |
22 |
23 |
24 |
Import database in .sql or .tar
25 |
26 | {/* */}
29 |
30 |
31 |
32 | );
33 | }
34 |
--------------------------------------------------------------------------------
/frontend/components/leftPanel/History.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | type HistoryProps = {
4 | queries: {
5 | queryString: string;
6 | queryData: {}[];
7 | queryStatistics: any;
8 | // querySchema: string;
9 | queryLabel: string;
10 | }[];
11 | };
12 |
13 | // Top left panel component displaying previously run queries
14 | export class History extends Component {
15 | constructor(props: HistoryProps) {
16 | super(props);
17 | }
18 |
19 | renderTableHistory() {
20 | return this.props.queries.map((query, index) => {
21 | console.log('this is the props in history.tsx', this.props);
22 | const { queryStatistics, queryLabel } = query;
23 |
24 | const { ['QUERY PLAN']: queryPlan } = queryStatistics[0];
25 |
26 | const {
27 | Plan,
28 | ['Planning Time']: planningTime,
29 | ['Execution Time']: executionTime,
30 | } = queryPlan[0];
31 | const {
32 | ['Actual Rows']: actualRows,
33 | ['Actual Total Time']: actualTotalTime,
34 | } = Plan;
35 |
36 | return (
37 |
38 | {queryLabel} |
39 | {/* {querySchema} | */}
40 | {actualRows} |
41 | {actualTotalTime} |
42 |
43 | );
44 | });
45 | }
46 |
47 | render() {
48 | const { queries } = this.props;
49 |
50 | return (
51 |
52 |
History
53 |
54 |
55 |
56 |
57 | {'Query Label'} |
58 | {'Schema'} |
59 | {'Total Rows'} |
60 | {'Total Time'} |
61 |
62 | {this.renderTableHistory()}
63 |
64 |
65 |
66 |
67 | );
68 | }
69 | }
70 |
71 | export default History;
72 |
--------------------------------------------------------------------------------
/frontend/components/rightPanel/SchemaContainer.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Data } from './schemaChildren/Data';
3 | import Query from './schemaChildren/Query';
4 |
5 | type SchemaContainerProps = {
6 | queries: any;
7 | databaseSize: string;
8 | submit: Function;
9 | };
10 |
11 | type state = {
12 | currentSchema: string;
13 | };
14 |
15 | export class SchemaContainer extends Component {
16 | constructor(props: SchemaContainerProps) {
17 | super(props);
18 | }
19 |
20 | state: state = {
21 | currentSchema: '',
22 | };
23 |
24 | render() {
25 | return (
26 |
27 |
28 |
29 |
30 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/frontend/components/rightPanel/Tabs.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { SchemaContainer } from './SchemaContainer';
3 | // import SchemaModal from './schemaChildren/SchemaModal';
4 | // import { Tab } from './tabsChildren/Tab';
5 |
6 | // const { ipcRenderer } = window.require('electron');
7 |
8 | type TabsProps = {
9 | queries: any;
10 | databaseSize: string;
11 | submit: Function;
12 | };
13 |
14 | type state = {
15 | show: boolean;
16 | };
17 | export class Tabs extends Component {
18 | constructor(props: TabsProps) {
19 | super(props);
20 | this.showModal = this.showModal.bind(this);
21 | }
22 | state: state = {
23 | show: false,
24 | };
25 |
26 | showModal = (event: any) => {
27 | this.setState({ show: true });
28 | };
29 |
30 | // componentDidMount() {
31 | // // After schema is successfully sent to backend, backend spins up new database with inputted schemaName.
32 | // // It will send the frontend an updated variable 'lists' that is an array of updated lists of all the tabs (which is the same
33 | // // thing as all the databases). We open a channel to listen for it here inside of componentDidMount, then
34 | // // we invoke onClose to close schemaModal ONLY after we are sure that backend has created that channel.
35 | // ipcRenderer.on('db-lists', (
36 | // event: any,
37 | // returnedLists: any /*returnedDbSize: string*/
38 | // ) => {
39 | // this.setState({
40 | // currentSchema: returnedLists,
41 | // // databaseSize: returnedDbSize,
42 | // });
43 | // this.onClose(event);
44 | // });
45 | // }
46 |
47 | onClose = (event: any) => {
48 | this.setState({ show: false });
49 | };
50 |
51 | render() {
52 | const { queries, databaseSize } = this.props;
53 |
54 | return (
55 |
56 |
57 | {/*
58 | {tabList.map((tab, index) => {
59 | return (
60 |
66 | );
67 | })}
68 | */}
69 |
70 | {/* */}
78 |
79 |
80 | {/*
*/}
86 |
87 |
93 |
94 |
95 | );
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/frontend/components/rightPanel/schemaChildren/Data.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Table } from './dataChildren/DataTable';
3 |
4 | type DataProps = {
5 | queries: {
6 | queryString: string;
7 | queryData: {}[];
8 | queryStatistics: any;
9 | // querySchema: string;
10 | queryLabel: string;
11 | }[];
12 | };
13 |
14 | export class Data extends Component {
15 | constructor(props) {
16 | super(props);
17 | }
18 |
19 | // Rendering results of tracked query from Query panel.
20 | render() {
21 | const { queries } = this.props;
22 |
23 | return (
24 |
25 |
Data Table
26 |
27 | {queries.length === 0 ? null :
}
28 |
29 |
30 | );
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/frontend/components/rightPanel/schemaChildren/DummyDataPanel.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import DropdownButton from 'react-bootstrap/DropdownButton';
3 | import Dropdown from 'react-bootstrap/Dropdown';
4 |
5 | // const { dialog } = require('electron').remote;
6 | // const { ipcRenderer } = window.require('electron');
7 |
8 | type ClickEvent = React.MouseEvent;
9 |
10 | type DummyDataPanelProps = {
11 | currentSchema: string;
12 | tableList: string[];
13 | };
14 |
15 | type state = {
16 | currentTable: string,
17 | dataInfo: {},
18 | rowNumber: string
19 | }
20 |
21 | class DummyDataPanel extends Component {
22 |
23 | constructor(props: DummyDataPanelProps) {
24 | super(props);
25 | this.dropDownList = this.dropDownList.bind(this);
26 | this.selectHandler = this.selectHandler.bind(this);
27 | this.addToTable = this.addToTable.bind(this);
28 | this.changeRowNumber = this.changeRowNumber.bind(this);
29 | this.deleteRow = this.deleteRow.bind(this);
30 | this.submitDummyData = this.submitDummyData.bind(this);
31 | }
32 |
33 | state: state = {
34 | currentTable: 'select table',
35 | dataInfo: {},
36 | rowNumber: ''
37 | }
38 |
39 | //handler to change the dropdown display to the selected table name
40 | selectHandler = (eventKey, e: React.SyntheticEvent) => {
41 | if (eventKey !== 'none') {
42 | this.setState({currentTable: eventKey});
43 | }
44 | };
45 |
46 | //function to generate the dropdown optiosn from the table names in state
47 | dropDownList = () => {
48 | const result: any = [];
49 | let tableName;
50 | // Checks to make sure tables are available to generate dummy data to.
51 | // Allows user to choose a specific table, or to write dummy data to all tables.
52 | if (this.props.tableList.length > 0) {
53 | for (let i = 0; i <= this.props.tableList.length; i++) {
54 | if(this.props.tableList[i]) tableName = this.props.tableList[i];
55 | else tableName = 'all';
56 | result.push({tableName});
57 | }
58 | } else {
59 | // Adds message in dropdown list to show that not tables are available
60 | // Went this route because we couldn't get the dropdown to disappear if there were no tables in tableList
61 | result.push(No tables available!);
62 | }
63 | return result;
64 | };
65 |
66 | //submit listener to add table name and rows to the dataInfo object in state
67 | addToTable = (event: any) => {
68 | // event.preventDefault();
69 | // //if no number is entered
70 | // if (!this.state.rowNumber) {
71 | // dialog.showErrorBox('Please enter a number of rows.', '');
72 | // }
73 | // if (this.state.currentTable === 'select table') {
74 | // dialog.showErrorBox('Please select a table.', '');
75 | // }
76 | // //reset input fields and update nested object in state
77 | // else {
78 | // let table = this.state.currentTable;
79 | // let number = Number(this.state.rowNumber);
80 | // if (table !== 'all') {
81 | // this.setState(prevState => ({
82 | // ...prevState,
83 | // currentTable: 'select table',
84 | // rowNumber: '',
85 | // dataInfo: {
86 | // ...prevState.dataInfo,
87 | // [table]: number
88 | // }
89 | // }))
90 | // }
91 | // else {
92 | // const dataInfo = {};
93 | // this.props.tableList.forEach(table => {
94 | // if (table !== 'all') {
95 | // dataInfo[table] = number;
96 | // }
97 | // })
98 | // this.setState(prevState => ({
99 | // ...prevState,
100 | // currentTable: 'select table',
101 | // rowNumber: '',
102 | // dataInfo
103 | // }))
104 | // }
105 | // }
106 | }
107 |
108 | //onclick listener to delete row from table
109 | deleteRow = (event: any) => {
110 | let name = event.target.id;
111 | this.setState(prevState => ({
112 | ...prevState,
113 | dataInfo: {
114 | ...prevState.dataInfo,
115 | [name]: undefined
116 | }
117 | }))
118 | }
119 |
120 | //onchange listener to update the rowNumber string in state
121 | changeRowNumber = (event: any) => {
122 | this.setState({ rowNumber: event.target.value })
123 | }
124 |
125 | createRow = () => {
126 | //once state updates on click, render the table row from the object
127 | const newRows: JSX.Element[] = [];
128 | for (let key in this.state.dataInfo) {
129 | if (this.state.dataInfo[key]) {
130 | newRows.push(
131 |
132 | {key} |
133 | {this.state.dataInfo[key]} |
134 | |
135 |
136 | )
137 | }
138 | }
139 | return newRows;
140 | }
141 |
142 | submitDummyData = (event: any) => {
143 | // //check if there are requested dummy data values
144 | // if (Object.keys(this.state.dataInfo).length) {
145 | // //creates a dummyDataRequest object with schema name and table name/rows
146 | // const dummyDataRequest = {
147 | // schemaName: this.props.currentSchema,
148 | // dummyData: this.state.dataInfo
149 | // }
150 | // ipcRenderer.send('generate-dummy-data', dummyDataRequest);
151 | // //reset state to clear the dummy data panel's table
152 | // this.setState({dataInfo: {}});
153 | // }
154 | // else dialog.showErrorBox('Please add table and row numbers', '');
155 | }
156 |
157 | render() {
158 |
159 | return (
160 |
161 |
Generate Dummy Data
162 |
Select table and number of rows:
163 |
164 |
165 |
166 | {this.state.currentTable}
167 |
168 |
169 | {this.dropDownList()}
170 |
171 |
172 |
175 |
176 |
180 |
181 |
182 |
183 |
184 |
185 | table |
186 | # of rows |
187 | delete |
188 |
189 | {this.createRow()}
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 | )
198 | }
199 | }
200 |
201 | export default DummyDataPanel;
--------------------------------------------------------------------------------
/frontend/components/rightPanel/schemaChildren/Query.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | //delete before pull request
3 | import DummyDataPanel from './DummyDataPanel';
4 |
5 | // const { ipcRenderer } = window.require('electron');
6 | // const { dialog } = require('electron').remote;
7 |
8 | // Codemirror configuration
9 | import 'codemirror/lib/codemirror.css'; // Styline
10 | import 'codemirror/mode/sql/sql'; // Language (Syntax Highlighting)
11 | import 'codemirror/theme/lesser-dark.css'; // Theme
12 | import CodeMirror from '@skidding/react-codemirror';
13 | import { json } from 'express';
14 |
15 | /************************************************************
16 | *********************** TYPESCRIPT: TYPES ***********************
17 | ************************************************************/
18 |
19 | type QueryProps = {
20 | dbSize: string;
21 | submit: Function;
22 | };
23 |
24 | type state = {
25 | queryString: string;
26 | queryLabel: string;
27 | show: boolean;
28 | //if true, will add query results to the bar chart
29 | trackQuery: boolean;
30 | };
31 |
32 | class Query extends Component {
33 | constructor(props: QueryProps) {
34 | super(props);
35 | this.handleQuerySubmit = this.handleQuerySubmit.bind(this);
36 | this.updateCode = this.updateCode.bind(this);
37 | this.handleTrackQuery = this.handleTrackQuery.bind(this);
38 | // this.submitQuery = this.submitQuery.bind(this);
39 | }
40 |
41 | state: state = {
42 | queryString: '',
43 | queryLabel: '',
44 | show: false,
45 | trackQuery: false,
46 | };
47 |
48 | // componentDidMount() {
49 | // ipcRenderer.on('query-error', (event: any, message: string) => {
50 | // // dialog.showErrorBox('Error', message);
51 | // });
52 | // }
53 |
54 | // Updates state.queryString as user inputs query label
55 | handleLabelEntry(event: any) {
56 | this.setState({ queryLabel: event.target.value });
57 | }
58 |
59 | // Updates state.trackQuery as user checks or unchecks box
60 | handleTrackQuery(event: any) {
61 | this.setState({ trackQuery: event.target.checked });
62 | }
63 |
64 | // Updates state.queryString as user inputs query string
65 | updateCode(newQueryString: string) {
66 | this.setState({
67 | queryString: newQueryString,
68 | });
69 | }
70 |
71 | // Submits query to backend on 'execute-query' channel
72 | handleQuerySubmit(event: any) {
73 | // event.preventDefault();
74 | // // if query string is empty, show error
75 | // if (!this.state.queryString) {
76 | // dialog.showErrorBox('Please enter a Query.', '');
77 | // }
78 | // if (!this.state.trackQuery) {
79 | // //functionality to send query but not return stats and track
80 | // const queryAndSchema = {
81 | // queryString: this.state.queryString,
82 | // queryCurrentSchema: this.props.currentSchema,
83 | // queryLabel: this.state.queryLabel,
84 | // };
85 | // ipcRenderer.send('execute-query-untracked', queryAndSchema);
86 | // //reset frontend inputs to display as empty and unchecked
87 | // this.setState({ queryLabel: '', trackQuery: false, queryString: '' });
88 | // }
89 | // if (this.state.trackQuery && !this.state.queryLabel) {
90 | // dialog.showErrorBox('Please enter a label for the Query.', '');
91 | // } else if (this.state.trackQuery) {
92 | // // send query and return stats from explain/analyze
93 | // const queryAndSchema = {
94 | // queryString: this.state.queryString,
95 | // queryCurrentSchema: this.props.currentSchema,
96 | // queryLabel: this.state.queryLabel,
97 | // };
98 | // ipcRenderer.send('execute-query-tracked', queryAndSchema);
99 | // //reset frontend inputs to display as empty and unchecked
100 | // this.setState({ queryLabel: '', trackQuery: false, queryString: '' });
101 | // }
102 | }
103 |
104 | render() {
105 | // Codemirror module configuration options
106 | var options = {
107 | lineNumbers: true,
108 | mode: 'sql',
109 | theme: 'lesser-dark',
110 | };
111 |
112 | return (
113 |
114 | {/*
Database Size: {this.props.dbSize}
*/}
115 |
Query
116 |
152 |
153 | );
154 | }
155 | }
156 |
157 | export default Query;
158 |
--------------------------------------------------------------------------------
/frontend/components/rightPanel/schemaChildren/SchemaModal.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Dropdown } from 'react-bootstrap';
3 | // import GenerateData from './GenerateData';
4 |
5 | const { dialog } = require('electron').remote;
6 | const { ipcRenderer } = window.require('electron');
7 |
8 | type ClickEvent = React.MouseEvent;
9 |
10 | type SchemaModalProps = {
11 | tabList: string[];
12 | show: boolean;
13 | showModal: any;
14 | onClose: any;
15 | };
16 |
17 | type state = {
18 | schemaName: string;
19 | schemaFilePath: string;
20 | schemaEntry: string;
21 | redirect: boolean;
22 | dbCopyName: string;
23 | copy: boolean;
24 | };
25 |
26 | class SchemaModal extends Component {
27 | constructor(props: SchemaModalProps) {
28 | super(props);
29 | this.handleSchemaSubmit = this.handleSchemaSubmit.bind(this);
30 | this.handleSchemaFilePath = this.handleSchemaFilePath.bind(this);
31 | this.handleSchemaEntry = this.handleSchemaEntry.bind(this);
32 | this.handleSchemaName = this.handleSchemaName.bind(this);
33 | this.selectHandler = this.selectHandler.bind(this);
34 | this.handleCopyData = this.handleCopyData.bind(this);
35 | this.dropDownList = this.dropDownList.bind(this);
36 | this.handleCopyFilePath = this.handleCopyFilePath.bind(this);
37 |
38 | // this.handleQueryPrevious = this.handleQueryPrevious.bind(this);
39 | // this.handleQuerySubmit = this.handleQuerySubmit.bind(this);
40 | }
41 |
42 | state: state = {
43 | schemaName: '',
44 | schemaFilePath: '',
45 | schemaEntry: '',
46 | redirect: false,
47 | dbCopyName: 'Select Instance',
48 | copy: false,
49 | };
50 |
51 | // Set schema name
52 | handleSchemaName(event: any) {
53 | // convert input label name to lowercase only with no spacing to comply with db naming convention.
54 | const schemaNameInput = event.target.value;
55 | let dbSafeName = schemaNameInput.toLowerCase();
56 | dbSafeName = dbSafeName.replace(/[^A-Z0-9]/gi, '');
57 | this.setState({ schemaName: dbSafeName });
58 | }
59 |
60 | // Load schema file path
61 | // When file path is uploaded, query entry is cleared.
62 | handleSchemaFilePath(event: ClickEvent) {
63 | event.preventDefault();
64 | dialog
65 | .showOpenDialog({
66 | properties: ['openFile'],
67 | filters: [{ name: 'Custom File Type', extensions: ['tar', 'sql'] }],
68 | message: 'Please upload .sql or .tar database file',
69 | })
70 | .then((result: object) => {
71 | const filePath = result['filePaths'];
72 | this.setState({ schemaFilePath: filePath });
73 | const schemaObj = {
74 | schemaName: this.state.schemaName,
75 | schemaFilePath: this.state.schemaFilePath,
76 | schemaEntry: '',
77 | };
78 | if (!result['canceled']) {
79 | ipcRenderer.send('input-schema', schemaObj);
80 | this.setState({ schemaName: '' });
81 | }
82 | this.setState({ dbCopyName: 'Select Instance' });
83 | this.props.showModal(event);
84 | })
85 |
86 | .catch((err: object) => {});
87 | }
88 |
89 | // When schema script is inserted, file path is cleared set dialog to warn user.
90 | handleSchemaEntry(event: any) {
91 | this.setState({ schemaEntry: event.target.value, schemaFilePath: '' });
92 | // this.setState({ schemaFilePath: '' });
93 | }
94 |
95 | handleSchemaSubmit(event: any) {
96 | event.preventDefault();
97 |
98 | const schemaObj = {
99 | schemaName: this.state.schemaName,
100 | schemaFilePath: this.state.schemaFilePath,
101 | schemaEntry: this.state.schemaEntry,
102 | };
103 | ipcRenderer.send('input-schema', schemaObj);
104 | }
105 |
106 | selectHandler = (eventKey, e: React.SyntheticEvent) => {
107 | this.setState({ dbCopyName: eventKey }); //
108 | };
109 |
110 | handleCopyData(event: any) {
111 | if (!this.state.copy) this.setState({ copy: true });
112 | else this.setState({ copy: false });
113 | }
114 |
115 | dropDownList = () => {
116 | return this.props.tabList.map((db, index) => (
117 |
118 | {db}
119 |
120 | ));
121 | };
122 |
123 | handleCopyFilePath(event: any) {
124 | event.preventDefault();
125 | const schemaObj = {
126 | schemaName: this.state.schemaName,
127 | schemaFilePath: '',
128 | schemaEntry: '',
129 | dbCopyName: this.state.dbCopyName,
130 | copy: this.state.copy,
131 | };
132 |
133 | ipcRenderer.send('input-schema', schemaObj);
134 | this.setState({ dbCopyName: `Select Instance` });
135 | this.setState({ schemaName: '' });
136 | this.props.showModal(event);
137 | }
138 |
139 | render() {
140 | if (this.props.show === false) {
141 | return null;
142 | }
143 |
144 | return (
145 |
146 | {/*
Upload or Make a Copy of Schema
*/}
147 |
Enter New Schema Name (required): {this.state.schemaName}
148 |
this.handleSchemaName(e)}
153 | />
154 |
155 |
156 |
Upload New Schema:
157 |
158 |
161 |
162 |
163 |
164 |
OR
165 |
166 |
167 |
Copy Existing Schema:
168 |
169 | {this.state.dbCopyName}
170 | {this.dropDownList()}
171 |
172 |
173 |
174 |
175 |
176 | With Data?
177 |
178 |
184 |
191 |
192 |
193 |
203 |
204 | );
205 | }
206 | }
207 |
208 | export default SchemaModal;
209 |
210 | {
211 | /*
212 | {this.dropDownList()}
213 | */
214 | }
215 |
--------------------------------------------------------------------------------
/frontend/components/rightPanel/schemaChildren/dataChildren/DataTable.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | type TableProps = {
4 | queries: {
5 | queryString: string;
6 | queryData: {}[];
7 | queryStatistics: any;
8 | // querySchema: string;
9 | queryLabel: string;
10 | }[];
11 | };
12 | export class Table extends Component {
13 | constructor(props) {
14 | super(props);
15 | this.getKeys = this.getKeys.bind(this);
16 | this.getHeader = this.getHeader.bind(this);
17 | this.getRowsData = this.getRowsData.bind(this);
18 | }
19 |
20 | // Returns list of headings that should be displayed @ top of table
21 | getKeys() {
22 | const { queries } = this.props;
23 |
24 | // All keys will be consistent across each object in queryData,
25 | // so we only need to list keys of first object in data returned
26 | // from backend.
27 | return Object.keys(queries[queries.length - 1].queryData[0]);
28 | }
29 |
30 | // Create Header by generating a element for each key.
31 | getHeader() {
32 | var keys = this.getKeys();
33 | return keys.map((key, index) => {
34 | return | {key.toUpperCase()} | ;
35 | });
36 | }
37 |
38 | // Iterate through queryData array to return the body part of the table.
39 | getRowsData() {
40 | const { queries } = this.props;
41 |
42 | var items = queries[queries.length - 1].queryData;
43 | var keys = this.getKeys(); // actor_id, firstName, lastName, lastUpdated
44 |
45 | return items.map((row, index) => {
46 | return (
47 |
48 |
49 |
50 | );
51 | });
52 | }
53 |
54 | render() {
55 | return (
56 |
57 |
58 |
59 | {this.getHeader()}
60 |
61 | {this.getRowsData()}
62 |
63 |
64 | );
65 | }
66 | }
67 |
68 | type RenderRowProps = {
69 | data: any;
70 | keys: any;
71 | key: any;
72 | };
73 |
74 | // Returns each cell within table
75 | const RenderRow = (props: RenderRowProps) => {
76 | const { data, keys } = props;
77 | return keys.map((header, index) => {
78 | // if the value of a row is undefined, then go to next iteration
79 | if (data[header] == undefined) return;
80 | // turn all values in data object to string or number
81 | data[header] = data[header].toString();
82 | return {data[header]} | ;
83 | });
84 | };
85 |
--------------------------------------------------------------------------------
/frontend/components/rightPanel/tabsChildren/Tab.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 |
3 | type TabProps = {
4 | onClickTabItem: any,
5 | currentSchema: string,
6 | label: string,
7 | };
8 | export class Tab extends Component {
9 |
10 | render() {
11 | const {
12 | onClickTabItem,
13 | currentSchema,
14 | label,
15 | } = this.props;
16 |
17 | let className = "tab-list-item";
18 | if (currentSchema === label) {
19 | className += " tab-list-active";
20 | }
21 |
22 | return (
23 | onClickTabItem(label)}>
24 | {label}
25 |
26 | );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/frontend/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from 'react-dom';
3 | import { App } from './components/App';
4 | import './assets/stylesheets/css/style.css';
5 | import 'codemirror/lib/codemirror.css';
6 |
7 | const root = document.createElement('div');
8 | root.id = 'root';
9 | document.body.appendChild(root);
10 |
11 | render(
12 | ,
15 | document.getElementById('root')
16 | );
17 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "SeeQR",
3 | "version": "2.0.0",
4 | "description": "SeeQR",
5 | "main": "./tsCompiled/backend/server",
6 | "babel": {
7 | "presets": [
8 | "@babel/preset-env",
9 | "@babel/preset-react"
10 | ]
11 | },
12 | "scripts": {
13 | "build": "tsc && webpack",
14 | "start": "NODE_ENV=production node ./tsCompiled/backend/server",
15 | "dev": "tsc && NODE_ENV=development nodemon ./backend/server.ts & webpack-dev-server --hot",
16 | "test": "jest --verbose"
17 | },
18 | "repository": {
19 | "type": "git",
20 | "url": "git+https://github.com/oslabs-beta/SeeQR"
21 | },
22 | "keywords": [],
23 | "author": "Team SeeQR",
24 | "license": "MIT",
25 | "dependencies": {
26 | "@skidding/react-codemirror": "^1.0.2",
27 | "@types/react-router-dom": "^5.1.5",
28 | "autoprefixer": "^9.8.5",
29 | "chart.js": "^2.9.3",
30 | "codemirror": "^5.57.0",
31 | "concurrently": "^5.3.0",
32 | "cookie-parser": "^1.4.5",
33 | "cookie-session": "^1.4.0",
34 | "cross-env": "^7.0.3",
35 | "electron-store": "^6.0.0",
36 | "express": "^4.17.1",
37 | "faker": "^5.1.0",
38 | "fix-path": "^3.0.0",
39 | "fs": "0.0.1-security",
40 | "node-fetch": "^2.6.1",
41 | "path": "^0.12.7",
42 | "pg": "^8.3.2",
43 | "react": "^16.13.1",
44 | "react-bootstrap": "^1.3.0",
45 | "react-chartjs-2": "^2.10.0",
46 | "react-codemirror": "^1.0.0",
47 | "react-dom": "^16.13.1",
48 | "react-loading": "^2.0.3",
49 | "react-router-dom": "^5.2.0",
50 | "sass": "^1.26.10"
51 | },
52 | "engines": {
53 | "node": "12.13.0"
54 | },
55 | "devDependencies": {
56 | "@babel/core": "^7.10.5",
57 | "@babel/preset-env": "^7.10.4",
58 | "@babel/preset-react": "^7.10.4",
59 | "@types/enzyme": "^3.10.7",
60 | "@types/enzyme-adapter-react-16": "^1.0.6",
61 | "@types/jest": "^26.0.14",
62 | "@types/node": "^14.6.0",
63 | "@types/react": "^16.9.46",
64 | "@types/react-dom": "^16.9.8",
65 | "@types/react-router-dom": "^5.1.5",
66 | "babel-loader": "^8.1.0",
67 | "babel-minify-webpack-plugin": "^0.3.1",
68 | "csp-html-webpack-plugin": "^4.0.0",
69 | "css-loader": "^3.5.3",
70 | "electron": "^9.3.1",
71 | "electron-devtools-installer": "^3.0.0",
72 | "electron-packager": "^14.2.1",
73 | "electron-reloader": "^1.1.0",
74 | "enzyme": "^3.11.0",
75 | "enzyme-adapter-react-16": "^1.15.5",
76 | "file-loader": "^6.0.0",
77 | "html-webpack-plugin": "^4.3.0",
78 | "image-webpack-loader": "^6.0.0",
79 | "jest": "^26.4.2",
80 | "mini-css-extract-plugin": "^0.9.0",
81 | "nodemon": "^2.0.4",
82 | "postcss-loader": "^3.0.0",
83 | "react-router-dom": "^5.2.0",
84 | "sass-loader": "^9.0.2",
85 | "source-map-loader": "^1.0.1",
86 | "style-loader": "^1.2.1",
87 | "ts-jest": "^26.4.0",
88 | "ts-loader": "^8.0.2",
89 | "ts-node": "^8.10.2",
90 | "typescript": "^3.9.7",
91 | "webpack": "^4.44.2",
92 | "webpack-cli": "^3.3.12",
93 | "webpack-dev-server": "^3.11.0"
94 | },
95 | "bugs": {
96 | "url": "https://github.com/oslabs-beta/SeeQR/issues"
97 | },
98 | "homepage": "https://github.com/oslabs-beta/SeeQR",
99 | "jest": {
100 | "transform": {
101 | "^.+\\.tsx?$": "ts-jest",
102 | "^.+\\.jsx?$": "babel-jest"
103 | },
104 | "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
105 | "moduleFileExtensions": [
106 | "ts",
107 | "tsx",
108 | "js",
109 | "jsx",
110 | "json",
111 | "node"
112 | ],
113 | "setupFilesAfterEnv": [
114 | "/__tests__/setupTests.js"
115 | ]
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/tsCompiled/babel.config.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | module.exports = {
3 | presets: [
4 | [
5 | '@babel/preset-env',
6 | {
7 | targets: {
8 | node: 'current',
9 | },
10 | },
11 | ],
12 | ],
13 | };
14 | //# sourceMappingURL=babel.config.js.map
--------------------------------------------------------------------------------
/tsCompiled/babel.config.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"babel.config.js","sourceRoot":"","sources":["../babel.config.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,OAAO,EAAE;QACP;YACE,mBAAmB;YACnB;gBACE,OAAO,EAAE;oBACP,IAAI,EAAE,SAAS;iBAChB;aACF;SACF;KACF;CACF,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/backend/dbController.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4 | return new (P || (P = Promise))(function (resolve, reject) {
5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8 | step((generator = generator.apply(thisArg, _arguments || [])).next());
9 | });
10 | };
11 | var __generator = (this && this.__generator) || function (thisArg, body) {
12 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14 | function verb(n) { return function (v) { return step([n, v]); }; }
15 | function step(op) {
16 | if (f) throw new TypeError("Generator is already executing.");
17 | while (_) try {
18 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19 | if (y = 0, t) op = [op[0] & 2, t.value];
20 | switch (op[0]) {
21 | case 0: case 1: t = op; break;
22 | case 4: _.label++; return { value: op[1], done: false };
23 | case 5: _.label++; y = op[1]; op = [0]; continue;
24 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
25 | default:
26 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30 | if (t[2]) _.ops.pop();
31 | _.trys.pop(); continue;
32 | }
33 | op = body.call(thisArg, _);
34 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36 | }
37 | };
38 | Object.defineProperty(exports, "__esModule", { value: true });
39 | var fetch = require('node-fetch');
40 | var Pool = require('pg').Pool;
41 | var users = {};
42 | var url = 'https://customer.elephantsql.com/api/instances';
43 | var key = '6f319a52-93f7-4608-9441-c53c9577d410';
44 | var password = "Basic " + Buffer.from(":" + key).toString("base64");
45 | var dbnum = 0;
46 | var options = function (str) { return ({
47 | method: str,
48 | headers: {
49 | Authorization: password,
50 | },
51 | }); };
52 | var deleteDB = function (id) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
53 | switch (_a.label) {
54 | case 0: return [4 /*yield*/, fetch(url + "/" + id, options('DELETE'))];
55 | case 1: return [2 /*return*/, _a.sent()];
56 | }
57 | }); }); };
58 | var dbController = {
59 | makeDB: function (req, res, next) { return __awaiter(void 0, void 0, void 0, function () {
60 | var response, data, id_1, connectStr, expiry, response, data, connectStr, _a;
61 | return __generator(this, function (_b) {
62 | switch (_b.label) {
63 | case 0:
64 | _b.trys.push([0, 7, , 8]);
65 | if (!!('session_id' in req.cookies)) return [3 /*break*/, 3];
66 | return [4 /*yield*/, fetch(url + "?name=tempDB" + ++dbnum + "9&plan=turtle®ion=amazon-web-services::us-east-1", options('POST'))];
67 | case 1:
68 | response = _b.sent();
69 | return [4 /*yield*/, response.json()];
70 | case 2:
71 | data = _b.sent();
72 | id_1 = data.id, connectStr = data.connectStr;
73 | expiry = 1800000;
74 | users[id_1] = new Pool({ connectionString: connectStr });
75 | res.cookie('session_id', id_1, { maxAge: expiry });
76 | setTimeout(function () { return deleteDB(id_1); }, expiry);
77 | return [3 /*break*/, 6];
78 | case 3: return [4 /*yield*/, fetch(url + "/" + req.cookies.session_id, options('GET'))];
79 | case 4:
80 | response = _b.sent();
81 | console.log('pulling up db. response: ', response);
82 | return [4 /*yield*/, response.json()];
83 | case 5:
84 | data = _b.sent();
85 | connectStr = data.connectStr;
86 | users[req.cookies.session_id] = new Pool({ connectionString: connectStr });
87 | _b.label = 6;
88 | case 6: return [3 /*break*/, 8];
89 | case 7:
90 | _a = _b.sent();
91 | next();
92 | return [3 /*break*/, 8];
93 | case 8:
94 | next();
95 | return [2 /*return*/];
96 | }
97 | });
98 | }); },
99 | };
100 | exports.default = dbController;
101 | //# sourceMappingURL=dbController.js.map
--------------------------------------------------------------------------------
/tsCompiled/backend/dbController.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"dbController.js","sourceRoot":"","sources":["../../backend/dbController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAC5B,IAAA,IAAI,GAAK,OAAO,CAAC,IAAI,CAAC,KAAlB,CAAmB;AAC/B,IAAM,KAAK,GAAG,EAAE,CAAC;AACjB,IAAM,GAAG,GAAG,gDAAgD,CAAC;AAC7D,IAAM,GAAG,GAAG,sCAAsC,CAAC;AACnD,IAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACtE,IAAI,KAAK,GAAG,CAAC,CAAC;AAEd,IAAM,OAAO,GAAG,UAAA,GAAG,IAAI,OAAA,CAAC;IACtB,MAAM,EAAE,GAAG;IACX,OAAO,EAAE;QACP,aAAa,EAAE,QAAQ;KACxB;CACF,CAAC,EALqB,CAKrB,CAAA;AAEF,IAAM,QAAQ,GAAG,UAAM,EAAE;;gBAAI,qBAAM,KAAK,CAAI,GAAG,SAAI,EAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAA;gBAA9C,sBAAA,SAA8C,EAAA;;SAAA,CAAC;AAE5E,IAAM,YAAY,GAAG;IACnB,MAAM,EAAE,UAAO,GAAG,EAAE,GAAG,EAAE,IAAI;;;;;;yBAErB,CAA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outer.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var express = require('express');
4 | var router = express.Router();
5 | var dbController = require('./dbController');
6 | router.get('return-db-list', dbController.returnDbList, function (req, res) {
7 | res.status(200).json(res.locals);
8 | });
9 | router.get('change-db', dbController.changeDb, function (req, res) {
10 | res.status(200).json(res.locals);
11 | });
12 | exports.default = router;
13 | //# sourceMappingURL=dbRouter.js.map
--------------------------------------------------------------------------------
/tsCompiled/backend/dbRouter.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"dbRouter.js","sourceRoot":"","sources":["../../backend/dbRouter.ts"],"names":[],"mappings":";;AAAA,IAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEnC,IAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;AAEhC,IAAM,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE/C,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,YAAY,CAAC,YAAY,EAAE,UAAC,GAAG,EAAE,GAAG;IAC/D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,YAAY,CAAC,QAAQ,EAAE,UAAC,GAAG,EAAE,GAAG;IACtD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/backend/dummyDataMain.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"dummyDataMain.js","sourceRoot":"","sources":["../../backend/dummyDataMain.ts"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,oCAAoC;AACpC,kCAAkC;AAElC,wEAAwE;AACx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B;AAChB,+FAA+F;AAC/F,qBAAqB;AACrB,oEAAoE;AACpE,sCAAsC;AACtC,iFAAiF;AACjF,yCAAyC;AACzC,0CAA0C;AAC1C,0BAA0B;AAC1B,kBAAkB;AAClB,gBAAgB;AAChB,cAAc;AACd,6FAA6F;AAC7F,mBAAmB;AACnB,kEAAkE;AAClE,oCAAoC;AACpC,+EAA+E;AAC/E,uCAAuC;AACvC,wCAAwC;AACxC,wBAAwB;AACxB,gBAAgB;AAChB,cAAc;AAEd,qDAAqD;AACrD,0CAA0C;AAC1C,qDAAqD;AACrD,6BAA6B;AAC7B,YAAY;AACZ,2FAA2F;AAC3F,8DAA8D;AAC9D,UAAU;AACV,QAAQ;AACR,qCAAqC;AACrC,0BAA0B;AAC1B,OAAO;AACP,KAAK"}
--------------------------------------------------------------------------------
/tsCompiled/backend/foreign_key_info.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | module.exports = {
3 | // This query lists each table that has a foreign key, the name of the table that key points to, and the name of the column at which the foreign key constraint resides
4 | getForeignKeys: "select kcu.table_name as foreign_table,\n rel_kcu.table_name as primary_table,\n kcu.column_name as fk_column\n from information_schema.table_constraints tco\n join information_schema.key_column_usage kcu\n on tco.constraint_name = kcu.constraint_name\n join information_schema.referential_constraints rco\n on tco.constraint_name = rco.constraint_name\n join information_schema.key_column_usage rel_kcu\n on rco.unique_constraint_name = rel_kcu.constraint_name\n where tco.constraint_type = 'FOREIGN KEY'\n order by kcu.table_schema,\n kcu.table_name,\n kcu.ordinal_position;",
5 | // This query lists each table and the column name at which there is a primary key
6 | getPrimaryKeys: "select kcu.table_name as table_name,\n kcu.column_name as pk_column\n from information_schema.key_column_usage as kcu\n join information_schema.table_constraints as tco\n on tco.constraint_name = kcu.constraint_name\n where tco.constraint_type = 'PRIMARY KEY'\n order by kcu.table_name;",
7 | };
8 | // structure of the key object for generating key compliant data
9 | // const KeyObject = {
10 | // // people:
11 | // Table_1: {
12 | // primaryKeyColumns: {
13 | // // id: true
14 | // _id: true
15 | // }
16 | // foreignKeyColumns: {
17 | // // species_id: n where n is the number of rows asked for in the primary table the key points to
18 | // foreignKeyColumnName_1: numOfRows,
19 | // foreignKeyColumnName_2: numOfRows
20 | // }
21 | // }
22 | // .
23 | // .
24 | // .
25 | // }
26 | //# sourceMappingURL=foreign_key_info.js.map
--------------------------------------------------------------------------------
/tsCompiled/backend/foreign_key_info.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"foreign_key_info.js","sourceRoot":"","sources":["../../backend/foreign_key_info.ts"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAE;IACd,uKAAuK;IACvK,cAAc,EACZ,mqBAa8B;IAEhC,kFAAkF;IAClF,cAAc,EACZ,sTAMyB;CAC5B,CAAA;AAID,gEAAgE;AAChE,sBAAsB;AACtB,eAAe;AACf,eAAe;AACf,6BAA6B;AAC7B,wBAAwB;AACxB,sBAAsB;AACtB,UAAU;AACV,6BAA6B;AAC7B,4GAA4G;AAC5G,+CAA+C;AAC/C,8CAA8C;AAC9C,UAAU;AACV,MAAM;AACN,MAAM;AACN,MAAM;AACN,MAAM;AACN,IAAI"}
--------------------------------------------------------------------------------
/tsCompiled/backend/queryController.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4 | return new (P || (P = Promise))(function (resolve, reject) {
5 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8 | step((generator = generator.apply(thisArg, _arguments || [])).next());
9 | });
10 | };
11 | var __generator = (this && this.__generator) || function (thisArg, body) {
12 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14 | function verb(n) { return function (v) { return step([n, v]); }; }
15 | function step(op) {
16 | if (f) throw new TypeError("Generator is already executing.");
17 | while (_) try {
18 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19 | if (y = 0, t) op = [op[0] & 2, t.value];
20 | switch (op[0]) {
21 | case 0: case 1: t = op; break;
22 | case 4: _.label++; return { value: op[1], done: false };
23 | case 5: _.label++; y = op[1]; op = [0]; continue;
24 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
25 | default:
26 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30 | if (t[2]) _.ops.pop();
31 | _.trys.pop(); continue;
32 | }
33 | op = body.call(thisArg, _);
34 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36 | }
37 | };
38 | Object.defineProperty(exports, "__esModule", { value: true });
39 | var db = require('./models');
40 | var fetch = require('node-fetch');
41 | var Pool = require('pg').Pool;
42 | var key = '6f319a52-93f7-4608-9441-c53c9577d410';
43 | var password = "Basic " + Buffer.from(":" + key).toString("base64");
44 | var queryController = {
45 | executeQueryUntracked: function (req, res, next) {
46 | // event.sender.send('async-started');
47 | // destructure object from frontend
48 | var queryString = req.body.queryString;
49 | // run query on db
50 | db.query(queryString)
51 | .then(function () {
52 | (function getListAsync() {
53 | return __awaiter(this, void 0, void 0, function () {
54 | var listObj;
55 | return __generator(this, function (_a) {
56 | switch (_a.label) {
57 | case 0: return [4 /*yield*/, db.getLists()];
58 | case 1:
59 | listObj = _a.sent();
60 | return [2 /*return*/];
61 | }
62 | });
63 | });
64 | })();
65 | })
66 | .then(next())
67 | .catch(function (error) {
68 | // event.sender.send('query-error', 'Error executing query.');
69 | });
70 | },
71 | executeQueryTracked: function (req, res, next) { return __awaiter(void 0, void 0, void 0, function () {
72 | var _a, queryString, queryLabel, users, options, response, data, url, pool, rows, queryStats;
73 | return __generator(this, function (_b) {
74 | switch (_b.label) {
75 | case 0:
76 | _a = req.body.query, queryString = _a.queryString, queryLabel = _a.queryLabel;
77 | users = {};
78 | options = {
79 | method: 'GET',
80 | headers: {
81 | Authorization: password,
82 | },
83 | };
84 | return [4 /*yield*/, fetch("https://customer.elephantsql.com/api/instances/" + req.cookies.session_id, options)];
85 | case 1:
86 | response = _b.sent();
87 | return [4 /*yield*/, response.json()];
88 | case 2:
89 | data = _b.sent();
90 | url = data.url;
91 | users[req.cookies.session_id] = new Pool({ connectionString: url });
92 | pool = users[req.cookies['session_id']];
93 | return [4 /*yield*/, pool.query(queryString)];
94 | case 3:
95 | rows = _b.sent();
96 | res.locals.queryData = rows.rows;
97 | if (!!queryString.match(/create/i)) return [3 /*break*/, 5];
98 | return [4 /*yield*/, pool.query('EXPLAIN (FORMAT JSON, ANALYZE) ' + queryString)];
99 | case 4:
100 | queryStats = _b.sent();
101 | res.locals.queryStats = queryStats.rows;
102 | res.locals.queryLabel = queryLabel;
103 | _b.label = 5;
104 | case 5:
105 | // send back to client
106 | return [2 /*return*/, next()];
107 | }
108 | });
109 | }); },
110 | generateDummyData: function (req, res, next) {
111 | next();
112 | },
113 | };
114 | exports.default = queryController;
115 | //# sourceMappingURL=queryController.js.map
--------------------------------------------------------------------------------
/tsCompiled/backend/queryController.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"queryController.js","sourceRoot":"","sources":["../../backend/queryController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;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CACR,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBACY,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;oBAA5B,IAAI,GAAG,SAAqB;oBAC1B,GAAG,GAAK,IAAI,IAAT,CAAU;oBACrB,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC;oBAG9D,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;oBAEjC,qBAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAA;;oBAApC,IAAI,GAAG,SAA6B;oBAC1C,GAAG,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC;yBAE7B,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,EAA7B,wBAA6B;oBACZ,qBAAM,IAAI,CAAC,KAAK,CACjC,iCAAiC,GAAG,WAAW,CAChD,EAAA;;oBAFK,UAAU,GAAG,SAElB;oBACD,GAAG,CAAC,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC;oBACxC,GAAG,CAAC,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;;;gBAGrC,sBAAsB;gBACtB,sBAAO,IAAI,EAAE,EAAC;;;SACf;IACD,iBAAiB,EAAE,UAAC,GAAG,EAAE,GAAG,EAAE,IAAI;QAChC,IAAI,EAAE,CAAC;IACT,CAAC;CACF,CAAC;AAEF,kBAAe,eAAe,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/backend/queryRouter.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
4 | };
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | var express = require('express');
7 | var router = express.Router();
8 | var queryController_1 = __importDefault(require("./queryController"));
9 | router.get('/execute-query-untracked', queryController_1.default.executeQueryUntracked, function (req, res) {
10 | res.status(200).json(res.locals);
11 | });
12 | router.put('/execute-query-tracked', queryController_1.default.executeQueryTracked, function (req, res) {
13 | res.status(200).json(res.locals);
14 | });
15 | router.get('/generate-dummy-data', queryController_1.default.generateDummyData, function (req, res) {
16 | res.status(200).json(res.locals);
17 | });
18 | exports.default = router;
19 | //# sourceMappingURL=queryRouter.js.map
--------------------------------------------------------------------------------
/tsCompiled/backend/queryRouter.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"queryRouter.js","sourceRoot":"","sources":["../../backend/queryRouter.ts"],"names":[],"mappings":";;;;;AAAA,IAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEnC,IAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;AAEhC,sEAAgD;AAEhD,MAAM,CAAC,GAAG,CACR,0BAA0B,EAC1B,yBAAe,CAAC,qBAAqB,EACrC,UAAC,GAAG,EAAE,GAAG;IACP,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,GAAG,CACR,wBAAwB,EACxB,yBAAe,CAAC,mBAAmB,EACnC,UAAC,GAAG,EAAE,GAAG;IACP,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,GAAG,CACR,sBAAsB,EACtB,yBAAe,CAAC,iBAAiB,EACjC,UAAC,GAAG,EAAE,GAAG;IACP,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC,CACF,CAAC;AAEF,kBAAe,MAAM,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/backend/server.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
4 | };
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | var queryRouter_1 = __importDefault(require("./queryRouter"));
7 | var express = require('express');
8 | var path = require('path');
9 | // const fetch = require('node-fetch');
10 | var cookieParser = require('cookie-parser');
11 | var dbController_1 = __importDefault(require("./dbController"));
12 | var server = express();
13 | //Parsing Middleware
14 | server.use(express.json());
15 | server.use(express.urlencoded({ extended: true }));
16 | server.use(cookieParser());
17 | server.get('/', dbController_1.default.makeDB, function (req, res) {
18 | return res.sendFile(path.join(__dirname, '../../dist/index.html'));
19 | });
20 | server.use(express.static('dist'));
21 | server.use('/query', queryRouter_1.default);
22 | // default error handler
23 | server.use(function (err, req, res, next) {
24 | var defaultErr = {
25 | log: 'Express error handler caught unknown middleware error',
26 | status: 400,
27 | message: { err: 'An error occurred' },
28 | };
29 | var errorObj = Object.assign({}, defaultErr, err);
30 | console.log(errorObj.log);
31 | return res.status(errorObj.status).json(errorObj.message);
32 | });
33 | server.listen(process.env.PORT || 3000, function () { return console.log('listening on port 3000'); });
34 | exports.default = server;
35 | //# sourceMappingURL=server.js.map
--------------------------------------------------------------------------------
/tsCompiled/backend/server.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"server.js","sourceRoot":"","sources":["../../backend/server.ts"],"names":[],"mappings":";;;;;AAAA,8DAAwC;AAExC,IAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,IAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,uCAAuC;AACvC,IAAM,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAE9C,gEAA0C;AAE1C,IAAM,MAAM,GAAG,OAAO,EAAE,CAAC;AAEzB,oBAAoB;AACpB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAC3B,MAAM,CAAC,G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ModelProvider.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3 | if (k2 === undefined) k2 = k;
4 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5 | }) : (function(o, m, k, k2) {
6 | if (k2 === undefined) k2 = k;
7 | o[k2] = m[k];
8 | }));
9 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10 | Object.defineProperty(o, "default", { enumerable: true, value: v });
11 | }) : function(o, v) {
12 | o["default"] = v;
13 | });
14 | var __importStar = (this && this.__importStar) || function (mod) {
15 | if (mod && mod.__esModule) return mod;
16 | var result = {};
17 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18 | __setModuleDefault(result, mod);
19 | return result;
20 | };
21 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23 | return new (P || (P = Promise))(function (resolve, reject) {
24 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27 | step((generator = generator.apply(thisArg, _arguments || [])).next());
28 | });
29 | };
30 | var __generator = (this && this.__generator) || function (thisArg, body) {
31 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
32 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
33 | function verb(n) { return function (v) { return step([n, v]); }; }
34 | function step(op) {
35 | if (f) throw new TypeError("Generator is already executing.");
36 | while (_) try {
37 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
38 | if (y = 0, t) op = [op[0] & 2, t.value];
39 | switch (op[0]) {
40 | case 0: case 1: t = op; break;
41 | case 4: _.label++; return { value: op[1], done: false };
42 | case 5: _.label++; y = op[1]; op = [0]; continue;
43 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
44 | default:
45 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
46 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
47 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
48 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
49 | if (t[2]) _.ops.pop();
50 | _.trys.pop(); continue;
51 | }
52 | op = body.call(thisArg, _);
53 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
54 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
55 | }
56 | };
57 | Object.defineProperty(exports, "__esModule", { value: true });
58 | exports.ModelProvider = exports.useModel = void 0;
59 | var react_1 = __importStar(require("react"));
60 | var db = require('../backend/models');
61 | var ModelContext = react_1.default.createContext('');
62 | var QueryContext = react_1.default.createContext('');
63 | function useModel() {
64 | return react_1.useContext(ModelContext);
65 | }
66 | exports.useModel = useModel;
67 | function ModelProvider(_a) {
68 | var children = _a.children;
69 | var _b = react_1.useState(''), size = _b[0], setSize = _b[1];
70 | function getDBSize(dbName) {
71 | return __awaiter(this, void 0, void 0, function () {
72 | var queryStats;
73 | return __generator(this, function (_a) {
74 | switch (_a.label) {
75 | case 0: return [4 /*yield*/, db.query("SELECT pg_size_pretty(pg_database_size('" + dbName + "'));")];
76 | case 1:
77 | queryStats = _a.sent();
78 | setSize(queryStats.rows[0].pg_size_pretty);
79 | return [2 /*return*/];
80 | }
81 | });
82 | });
83 | }
84 | return (react_1.default.createElement(ModelContext.Provider, { value: size }, children));
85 | }
86 | exports.ModelProvider = ModelProvider;
87 | //# sourceMappingURL=ModelProvider.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/ModelProvider.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"ModelProvider.js","sourceRoot":"","sources":["../../frontend/ModelProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAoD;AACpD,IAAM,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAExC,IAAM,YAAY,GAAG,eAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;AAC7C,IAAM,YAAY,GAAG,eAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;AAE7C,SAAgB,QAAQ;IACtB,OAAO,kBAAU,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC;AAFD,4BAEC;AAED,SAAgB,aAAa,CAAC,EAAY;QAAV,QAAQ,cAAA;IAChC,IAAA,KAAkB,gBAAQ,CAAC,EAAE,CAAC,EAA7B,IAAI,QAAA,EAAE,OAAO,QAAgB,CAAC;IAErC,SAAe,SAAS,CAAC,MAAM;;;;;4BACV,qBAAM,EAAE,CAAC,KAAK,CAAC,6CAA2C,MAAM,SAAM,CAAC,EAAA;;wBAApF,UAAU,GAAG,SAAuE;wBAC1F,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;;;;;KAG5C;IAED,OAAO,CACL,8BAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,IAE7B,QAAQ,CAEW,CACzB,CAAA;AACH,CAAC;AAjBD,sCAiBC"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/App.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16 | if (k2 === undefined) k2 = k;
17 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18 | }) : (function(o, m, k, k2) {
19 | if (k2 === undefined) k2 = k;
20 | o[k2] = m[k];
21 | }));
22 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23 | Object.defineProperty(o, "default", { enumerable: true, value: v });
24 | }) : function(o, v) {
25 | o["default"] = v;
26 | });
27 | var __importStar = (this && this.__importStar) || function (mod) {
28 | if (mod && mod.__esModule) return mod;
29 | var result = {};
30 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31 | __setModuleDefault(result, mod);
32 | return result;
33 | };
34 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
35 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
36 | return new (P || (P = Promise))(function (resolve, reject) {
37 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
38 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
39 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
40 | step((generator = generator.apply(thisArg, _arguments || [])).next());
41 | });
42 | };
43 | var __generator = (this && this.__generator) || function (thisArg, body) {
44 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
45 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
46 | function verb(n) { return function (v) { return step([n, v]); }; }
47 | function step(op) {
48 | if (f) throw new TypeError("Generator is already executing.");
49 | while (_) try {
50 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
51 | if (y = 0, t) op = [op[0] & 2, t.value];
52 | switch (op[0]) {
53 | case 0: case 1: t = op; break;
54 | case 4: _.label++; return { value: op[1], done: false };
55 | case 5: _.label++; y = op[1]; op = [0]; continue;
56 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
57 | default:
58 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
59 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
60 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
61 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
62 | if (t[2]) _.ops.pop();
63 | _.trys.pop(); continue;
64 | }
65 | op = body.call(thisArg, _);
66 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
67 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
68 | }
69 | };
70 | var __importDefault = (this && this.__importDefault) || function (mod) {
71 | return (mod && mod.__esModule) ? mod : { "default": mod };
72 | };
73 | Object.defineProperty(exports, "__esModule", { value: true });
74 | exports.App = void 0;
75 | var react_1 = __importStar(require("react"));
76 | var Splash_1 = require("./Splash");
77 | var MainPanel_1 = __importDefault(require("./MainPanel"));
78 | var App = /** @class */ (function (_super) {
79 | __extends(App, _super);
80 | function App(props) {
81 | var _this = _super.call(this, props) || this;
82 | // Splash page will always render upon opening App
83 | _this.state = {
84 | openSplash: false,
85 | };
86 | _this.handleFileClick = _this.handleFileClick.bind(_this);
87 | _this.handleSkipClick = _this.handleSkipClick.bind(_this);
88 | return _this;
89 | }
90 | App.prototype.handleFileClick = function (event) {
91 | return __awaiter(this, void 0, void 0, function () {
92 | var files, formData, response;
93 | return __generator(this, function (_a) {
94 | switch (_a.label) {
95 | case 0:
96 | files = event.target.files;
97 | formData = new FormData();
98 | formData.append('myFile', files[0]);
99 | console.log(files);
100 | return [4 /*yield*/, fetch('/schema/upload-file', {
101 | method: 'POST',
102 | body: formData,
103 | })];
104 | case 1:
105 | response = _a.sent();
106 | this.setState({ openSplash: false });
107 | return [2 /*return*/];
108 | }
109 | });
110 | });
111 | };
112 | // Skips file upload and moves to main page.
113 | App.prototype.handleSkipClick = function (event) {
114 | // ipcRenderer.send('skip-file-upload');
115 | this.setState({ openSplash: false });
116 | };
117 | App.prototype.render = function () {
118 | // listen for menu to invoke handleFileClick
119 | // ipcRenderer.on('menu-upload-file', () => {
120 | // this.handleFileClick;
121 | // });
122 | return (react_1.default.createElement("div", null, this.state.openSplash ? (react_1.default.createElement(Splash_1.Splash, { openSplash: this.state.openSplash, handleFileClick: this.handleFileClick, handleSkipClick: this.handleSkipClick })) : (react_1.default.createElement(MainPanel_1.default, null))));
123 | };
124 | return App;
125 | }(react_1.Component));
126 | exports.App = App;
127 | //# sourceMappingURL=App.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/App.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"App.js","sourceRoot":"","sources":["../../../frontend/components/App.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,mCAAkC;AAClC,0DAAoC;AAapC;IAAyB,uBAA0B;IACjD,aAAY,KAAe;QAA3B,YACE,kBAAM,KAAK,CAAC,SAGb;QAED,kDAAkD;QAClD,WAAK,GAAU;YACb,UAAU,EAAE,KAAK;SAClB,CAAC;QAPA,KAAI,CAAC,eAAe,GAAG,KAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QACvD,KAAI,CAAC,eAAe,GAAG,KAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;;IACzD,CAAC;IAOK,6BAAe,GAArB,UAAsB,KAAK;;;;;;wBACnB,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;wBAC3B,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;wBAChC,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;wBACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;wBAEF,qBAAM,KAAK,CAAC,qBAAqB,EAAE;gCAClD,MAAM,EAAE,MAAM;gCACd,IAAI,EAAE,QAAQ;6BACf,CAAC,EAAA;;wBAHI,QAAQ,GAAG,SAGf;wBAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;;;;;KAiBtC;IAED,4CAA4C;IAC5C,6BAAe,GAAf,UAAgB,KAAK;QACnB,wCAAwC;QACxC,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,oBAAM,GAAN;QACE,4CAA4C;QAC5C,6CAA6C;QAC7C,0BAA0B;QAC1B,MAAM;QAEN,OAAO,CACL,2CACG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CACvB,8BAAC,eAAM,IACL,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,eAAe,EAAE,IAAI,CAAC,eAAe,GACrC,CACH,CAAC,CAAC,CAAC,CACF,8BAAC,mBAAS,OAAG,CACd,CACG,CACP,CAAC;IACJ,CAAC;IACH,UAAC;AAAD,CAAC,AApED,CAAyB,iBAAS,GAoEjC;AApEY,kBAAG"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/LoadingModal.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
4 | };
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | var react_1 = __importDefault(require("react"));
7 | var react_loading_1 = __importDefault(require("react-loading"));
8 | // "Loading" pop up renders whenever async functions are called
9 | var LoadingModal = function (props) {
10 | if (props.show) {
11 | return (react_1.default.createElement("div", { id: "loading-modal", className: "modal" },
12 | react_1.default.createElement("h3", null, "LOADING..."),
13 | react_1.default.createElement(react_loading_1.default, { type: "cylon", color: "#6cbba9" })));
14 | }
15 | else
16 | return null;
17 | };
18 | exports.default = LoadingModal;
19 | //# sourceMappingURL=LoadingModal.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/LoadingModal.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"LoadingModal.js","sourceRoot":"","sources":["../../../frontend/components/LoadingModal.tsx"],"names":[],"mappings":";;;;;AAAA,gDAAyC;AACzC,gEAAyC;AAEzC,+DAA+D;AAC/D,IAAM,YAAY,GAAG,UAAC,KAAK;IACzB,IAAI,KAAK,CAAC,IAAI,EAAE;QACd,OAAM,CACJ,uCAAK,EAAE,EAAC,eAAe,EAAC,SAAS,EAAC,OAAO;YACvC,uDAAmB;YACnB,8BAAC,uBAAY,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,SAAS,GAAE,CACxC,CACP,CAAC;KACH;;QACI,OAAO,IAAI,CAAC;AACnB,CAAC,CAAA;AAED,kBAAe,YAAY,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/MainPanel.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16 | if (k2 === undefined) k2 = k;
17 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18 | }) : (function(o, m, k, k2) {
19 | if (k2 === undefined) k2 = k;
20 | o[k2] = m[k];
21 | }));
22 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23 | Object.defineProperty(o, "default", { enumerable: true, value: v });
24 | }) : function(o, v) {
25 | o["default"] = v;
26 | });
27 | var __importStar = (this && this.__importStar) || function (mod) {
28 | if (mod && mod.__esModule) return mod;
29 | var result = {};
30 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31 | __setModuleDefault(result, mod);
32 | return result;
33 | };
34 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
35 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
36 | return new (P || (P = Promise))(function (resolve, reject) {
37 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
38 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
39 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
40 | step((generator = generator.apply(thisArg, _arguments || [])).next());
41 | });
42 | };
43 | var __generator = (this && this.__generator) || function (thisArg, body) {
44 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
45 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
46 | function verb(n) { return function (v) { return step([n, v]); }; }
47 | function step(op) {
48 | if (f) throw new TypeError("Generator is already executing.");
49 | while (_) try {
50 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
51 | if (y = 0, t) op = [op[0] & 2, t.value];
52 | switch (op[0]) {
53 | case 0: case 1: t = op; break;
54 | case 4: _.label++; return { value: op[1], done: false };
55 | case 5: _.label++; y = op[1]; op = [0]; continue;
56 | case 7: op = _.ops.pop(); _.trys.pop(); continue;
57 | default:
58 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
59 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
60 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
61 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
62 | if (t[2]) _.ops.pop();
63 | _.trys.pop(); continue;
64 | }
65 | op = body.call(thisArg, _);
66 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
67 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
68 | }
69 | };
70 | var __importDefault = (this && this.__importDefault) || function (mod) {
71 | return (mod && mod.__esModule) ? mod : { "default": mod };
72 | };
73 | Object.defineProperty(exports, "__esModule", { value: true });
74 | var react_1 = __importStar(require("react"));
75 | var Compare_1 = require("./leftPanel/Compare");
76 | var History_1 = __importDefault(require("./leftPanel/History"));
77 | var Tabs_1 = require("./rightPanel/Tabs");
78 | var MainPanel = /** @class */ (function (_super) {
79 | __extends(MainPanel, _super);
80 | function MainPanel(props) {
81 | var _this = _super.call(this, props) || this;
82 | _this.state = {
83 | queries: [],
84 | // currentSchema will change depending on which Schema Tab user selects
85 | loading: false,
86 | dbSize: '',
87 | };
88 | _this.submitQuery = function (event, query) { return __awaiter(_this, void 0, void 0, function () {
89 | var response, returnedData, queryData, queryStats, queryLabel, newQuery, queries;
90 | return __generator(this, function (_a) {
91 | switch (_a.label) {
92 | case 0:
93 | event.preventDefault();
94 | return [4 /*yield*/, fetch('/query/execute-query-tracked', {
95 | method: 'PUT',
96 | headers: { 'Content-Type': 'application/json' },
97 | body: JSON.stringify({ query: query }),
98 | })];
99 | case 1:
100 | response = _a.sent();
101 | return [4 /*yield*/, response.json()];
102 | case 2:
103 | returnedData = _a.sent();
104 | queryData = returnedData.queryData, queryStats = returnedData.queryStats, queryLabel = returnedData.queryLabel;
105 | newQuery = {
106 | queryString: '',
107 | queryData: queryData,
108 | queryStatistics: queryStats,
109 | queryLabel: queryLabel,
110 | };
111 | queries = this.state.queries.slice();
112 | // push new query object into copy of queries array
113 | queries.push(newQuery);
114 | this.setState({ queries: queries });
115 | return [2 /*return*/];
116 | }
117 | });
118 | }); };
119 | // this.onClickTabItem = this.onClickTabItem.bind(this);
120 | _this.submitQuery = _this.submitQuery.bind(_this);
121 | return _this;
122 | }
123 | MainPanel.prototype.render = function () {
124 | return (react_1.default.createElement("div", { id: "main-panel" },
125 | react_1.default.createElement(Tabs_1.Tabs, { queries: this.state.queries,
126 | // tableList={this.state.lists.tableList}
127 | databaseSize: this.state.dbSize, submit: this.submitQuery }),
128 | react_1.default.createElement("div", { id: "main-left" },
129 | react_1.default.createElement(History_1.default, { queries: this.state.queries }),
130 | react_1.default.createElement(Compare_1.Compare, { queries: this.state.queries }))));
131 | };
132 | return MainPanel;
133 | }(react_1.Component));
134 | exports.default = MainPanel;
135 | //# sourceMappingURL=MainPanel.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/MainPanel.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"MainPanel.js","sourceRoot":"","sources":["../../../frontend/components/MainPanel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,+CAA8C;AAC9C,gEAA0C;AAC1C,0CAAyC;AAazC;IAAwB,6BAA+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AAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;gBAC3B,yCAAyC;gBACzC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAC/B,MAAM,EAAE,IAAI,CAAC,WAAW,GACxB;YACF,uCAAK,EAAE,EAAC,WAAW;gBACjB,8BAAC,iBAAO,IAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAI;gBACxC,8BAAC,iBAAO,IAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAI,CACpC,CACF,CACP,CAAC;IACJ,CAAC;IACH,gBAAC;AAAD,CAAC,AArDD,CAAwB,iBAAS,GAqDhC;AACD,kBAAe,SAAS,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/Splash.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
4 | };
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | exports.Splash = void 0;
7 | var react_1 = __importDefault(require("react"));
8 | function Splash(props) {
9 | // a dialogue menu with retrieve the file path
10 | return (react_1.default.createElement("div", { id: "splash-page" },
11 | react_1.default.createElement("div", { className: "logo" }),
12 | react_1.default.createElement("h4", null, "Welcome!"),
13 | react_1.default.createElement("div", { className: "splash-buttons" },
14 | react_1.default.createElement("div", { id: "custom-schema" },
15 | react_1.default.createElement("h4", null, "Create custom schema"),
16 | react_1.default.createElement("button", { id: "skip_button", onClick: props.handleSkipClick }, "Create")),
17 | react_1.default.createElement("div", { id: "import-schema" },
18 | react_1.default.createElement("h4", null, "Import database in .sql or .tar"),
19 | react_1.default.createElement("input", { type: "file", id: "fileUpload", onClick: props.handleFileClick })))));
20 | }
21 | exports.Splash = Splash;
22 | //# sourceMappingURL=Splash.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/Splash.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"Splash.js","sourceRoot":"","sources":["../../../frontend/components/Splash.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAQ1B,SAAgB,MAAM,CAAC,KAAkB;IACvC,8CAA8C;IAC9C,OAAO,CACL,uCAAK,EAAE,EAAC,aAAa;QACnB,uCAAK,SAAS,EAAC,MAAM,GAAO;QAE5B,qDAAiB;QACjB,uCAAK,SAAS,EAAC,gBAAgB;YAC7B,uCAAK,EAAE,EAAC,eAAe;gBACrB,iEAA6B;gBAC7B,0CAAQ,EAAE,EAAC,aAAa,EAAC,OAAO,EAAE,KAAK,CAAC,eAAe,aAE9C,CACL;YACN,uCAAK,EAAE,EAAC,eAAe;gBACrB,4EAAwC;gBACxC,yCAAO,IAAI,EAAC,MAAM,EAAC,EAAE,EAAC,YAAY,EAAC,OAAO,EAAE,KAAK,CAAC,eAAe,GAAI,CAIjE,CACF,CACF,CACP,CAAC;AACJ,CAAC;AAxBD,wBAwBC"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/leftPanel/Compare.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"Compare.js","sourceRoot":"","sources":["../../../../frontend/components/leftPanel/Compare.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AACxC,kFAA4D;AAC5D,sEAAgD;AAChD,mDAAgD;AAEhD,0BAAQ,CAAC,MAAM,CAAC,gBAAgB,GAAG,kBAAkB,CAAC;AAWzC,QAAA,OAAO,GAAG,UAAC,KAAmB;IACzC,gHAAgH;IAChH,4GAA4G;IAC5G,gHAAgH;IAEhH,0BAA0B;IAC1B,IAAI,OAAO,yBAAa,KAAK,KAAE,WAAW,EAAE,EAAE,GAAE,CAAC;IAC3C,IAAA,KAA0B,gBAAQ,CAAC,OAAO,CAAC,EAA1C,SAAS,QAAA,EAAE,UAAU,QAAqB,CAAC;IAElD,IAAM,eAAe,GAAG,UAAC,KAAK;QAC5B,mDAAmD;QACnD,IAAI,WAAW,GAAG,SAAS,CA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,YAAY,EAAE,CACA;QACjB,uCAAK,SAAS,EAAC,mBAAmB;YAChC,yCAAO,SAAS,EAAC,aAAa;gBAC5B;oBACE,sCAAI,SAAS,EAAC,SAAS;wBACrB,0CAAK,aAAa,CAAM;wBACxB,0CAAK,QAAQ,CAAM;wBACnB,0CAAK,YAAY,CAAM;wBAGvB,0CAAK,cAAc,CAAM;wBACzB,0CAAK,YAAY,CAAM,CAGpB;oBACJ,aAAa,EAAE,CACV,CACF,CACJ;QACN,uCAAK,SAAS,EAAC,WAAW;YACxB,8BAAC,qBAAG,IACF,IAAI,EAAE,gBAAgB,EAAE,EACxB,OAAO,EAAE;oBACP,KAAK,EAAE;wBACL,OAAO,EAAE,IAAI;wBACb,IAAI,EAAE,uBAAuB;wBAC7B,QAAQ,EAAE,EAAE;qBACb;oBACD,MAAM,EAAE;wBACN,OAAO,EAAE,IAAI;wBACb,QAAQ,EAAE,OAAO;qBAClB;oBACD,mBAAmB,EAAE,KAAK;iBAC3B,GACD,CACE,CACF,CACP,CAAC;AACJ,CAAC,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/leftPanel/History.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16 | if (k2 === undefined) k2 = k;
17 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18 | }) : (function(o, m, k, k2) {
19 | if (k2 === undefined) k2 = k;
20 | o[k2] = m[k];
21 | }));
22 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23 | Object.defineProperty(o, "default", { enumerable: true, value: v });
24 | }) : function(o, v) {
25 | o["default"] = v;
26 | });
27 | var __importStar = (this && this.__importStar) || function (mod) {
28 | if (mod && mod.__esModule) return mod;
29 | var result = {};
30 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31 | __setModuleDefault(result, mod);
32 | return result;
33 | };
34 | Object.defineProperty(exports, "__esModule", { value: true });
35 | exports.History = void 0;
36 | var react_1 = __importStar(require("react"));
37 | // Top left panel component displaying previously run queries
38 | var History = /** @class */ (function (_super) {
39 | __extends(History, _super);
40 | function History(props) {
41 | return _super.call(this, props) || this;
42 | }
43 | History.prototype.renderTableHistory = function () {
44 | var _this = this;
45 | return this.props.queries.map(function (query, index) {
46 | console.log('this is the props in history.tsx', _this.props);
47 | var queryStatistics = query.queryStatistics, queryLabel = query.queryLabel;
48 | var queryPlan = queryStatistics[0]["QUERY PLAN"];
49 | var _a = queryPlan[0], Plan = _a.Plan, planningTime = _a["Planning Time"], executionTime = _a["Execution Time"];
50 | var actualRows = Plan["Actual Rows"], actualTotalTime = Plan["Actual Total Time"];
51 | return (react_1.default.createElement("tr", { key: index },
52 | react_1.default.createElement("td", { id: "query-label" }, queryLabel),
53 | react_1.default.createElement("td", { id: "actual-rows" }, actualRows),
54 | react_1.default.createElement("td", { id: "total-time" }, actualTotalTime)));
55 | });
56 | };
57 | History.prototype.render = function () {
58 | var queries = this.props.queries;
59 | return (react_1.default.createElement("div", { id: "history-panel" },
60 | react_1.default.createElement("h3", null, "History"),
61 | react_1.default.createElement("div", { className: "history-container" },
62 | react_1.default.createElement("table", { className: "scroll-box" },
63 | react_1.default.createElement("tbody", null,
64 | react_1.default.createElement("tr", { className: "top-row" },
65 | react_1.default.createElement("td", null, 'Query Label'),
66 | react_1.default.createElement("td", null, 'Schema'),
67 | react_1.default.createElement("td", null, 'Total Rows'),
68 | react_1.default.createElement("td", null, 'Total Time')),
69 | this.renderTableHistory())))));
70 | };
71 | return History;
72 | }(react_1.Component));
73 | exports.History = History;
74 | exports.default = History;
75 | //# sourceMappingURL=History.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/leftPanel/History.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"History.js","sourceRoot":"","sources":["../../../../frontend/components/leftPanel/History.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAYzC,6DAA6D;AAC7D;IAA6B,2BAAuB;IAClD,iBAAY,KAAmB;eAC7B,kBAAM,KAAK,CAAC;IACd,CAAC;IAED,oCAAkB,GAAlB;QAAA,iBA0BC;QAzBC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,KAAK;YACzC,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,KAAI,CAAC,KAAK,CAAC,CAAC;YACpD,IAAA,eAAe,GAAiB,KAAK,gBAAtB,EAAE,UAAU,GAAK,KAAK,WAAV,CAAW;YAEtC,IAAgB,SAAS,GAAK,eAAe,CAAC,CAAC,CAAC,cAAvB,CAAwB;YAEnD,IAAA,KAIF,SAAS,CAAC,CAAC,CAAC,EAHd,IAAI,UAAA,EACe,YAAY,sBAAA,EACX,aAAa,uBACnB,CAAC;YAEf,IAAiB,UAAU,GAEzB,IAAI,eAFqB,EACJ,eAAe,GACpC,IAAI,qBADgC,CAC/B;YAET,OAAO,CACL,sCAAI,GAAG,EAAE,KAAK;gBACZ,sCAAI,EAAE,EAAC,aAAa,IAAE,UAAU,CAAM;gBAEtC,sCAAI,EAAE,EAAC,aAAa,IAAE,UAAU,CAAM;gBACtC,sCAAI,EAAE,EAAC,YAAY,IAAE,eAAe,CAAM,CACvC,CACN,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,wBAAM,GAAN;QACU,IAAA,OAAO,GAAK,IAAI,CAAC,KAAK,QAAf,CAAgB;QAE/B,OAAO,CACL,uCAAK,EAAE,EAAC,eAAe;YACrB,oDAAgB;YAChB,uCAAK,SAAS,EAAC,mBAAmB;gBAChC,yCAAO,SAAS,EAAC,YAAY;oBAC3B;wBACE,sCAAI,SAAS,EAAC,SAAS;4BACrB,0CAAK,aAAa,CAAM;4BACxB,0CAAK,QAAQ,CAAM;4BACnB,0CAAK,YAAY,CAAM;4BACvB,0CAAK,YAAY,CAAM,CACpB;wBACJ,IAAI,CAAC,kBAAkB,EAAE,CACpB,CACF,CACJ,CACF,CACP,CAAC;IACJ,CAAC;IACH,cAAC;AAAD,CAAC,AAvDD,CAA6B,iBAAS,GAuDrC;AAvDY,0BAAO;AAyDpB,kBAAe,OAAO,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/SchemaContainer.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16 | if (k2 === undefined) k2 = k;
17 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18 | }) : (function(o, m, k, k2) {
19 | if (k2 === undefined) k2 = k;
20 | o[k2] = m[k];
21 | }));
22 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23 | Object.defineProperty(o, "default", { enumerable: true, value: v });
24 | }) : function(o, v) {
25 | o["default"] = v;
26 | });
27 | var __importStar = (this && this.__importStar) || function (mod) {
28 | if (mod && mod.__esModule) return mod;
29 | var result = {};
30 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31 | __setModuleDefault(result, mod);
32 | return result;
33 | };
34 | var __importDefault = (this && this.__importDefault) || function (mod) {
35 | return (mod && mod.__esModule) ? mod : { "default": mod };
36 | };
37 | Object.defineProperty(exports, "__esModule", { value: true });
38 | exports.SchemaContainer = void 0;
39 | var react_1 = __importStar(require("react"));
40 | var Data_1 = require("./schemaChildren/Data");
41 | var Query_1 = __importDefault(require("./schemaChildren/Query"));
42 | var SchemaContainer = /** @class */ (function (_super) {
43 | __extends(SchemaContainer, _super);
44 | function SchemaContainer(props) {
45 | var _this = _super.call(this, props) || this;
46 | _this.state = {
47 | currentSchema: '',
48 | };
49 | return _this;
50 | }
51 | SchemaContainer.prototype.render = function () {
52 | return (react_1.default.createElement("div", { id: "main-right" },
53 | react_1.default.createElement("div", { id: "test-panels" },
54 | react_1.default.createElement("div", { id: "schema-left" },
55 | react_1.default.createElement("div", null,
56 | react_1.default.createElement(Query_1.default, { submit: this.props.submit, dbSize: this.props.databaseSize })),
57 | react_1.default.createElement("div", null,
58 | react_1.default.createElement(Data_1.Data, { queries: this.props.queries }))))));
59 | };
60 | return SchemaContainer;
61 | }(react_1.Component));
62 | exports.SchemaContainer = SchemaContainer;
63 | //# sourceMappingURL=SchemaContainer.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/SchemaContainer.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"SchemaContainer.js","sourceRoot":"","sources":["../../../../frontend/components/rightPanel/SchemaContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,8CAA6C;AAC7C,iEAA2C;AAY3C;IAAqC,mCAA+B;IAClE,yBAAY,KAA2B;QAAvC,YACE,kBAAM,KAAK,CAAC,SACb;QAED,WAAK,GAAU;YACb,aAAa,EAAE,EAAE;SAClB,CAAC;;IAJF,CAAC;IAMD,gCAAM,GAAN;QACE,OAAO,CACL,uCAAK,EAAE,EAAC,YAAY;YAClB,uCAAK,EAAE,EAAC,aAAa;gBACnB,uCAAK,EAAE,EAAC,aAAa;oBACnB;wBACE,8BAAC,eAAK,IACJ,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAC/B,CACE;oBACN;wBACE,8BAAC,WAAI,IAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAI,CACjC,CACF,CACF,CACF,CACP,CAAC;IACJ,CAAC;IACH,sBAAC;AAAD,CAAC,AA5BD,CAAqC,iBAAS,GA4B7C;AA5BY,0CAAe"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/Tabs.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16 | if (k2 === undefined) k2 = k;
17 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18 | }) : (function(o, m, k, k2) {
19 | if (k2 === undefined) k2 = k;
20 | o[k2] = m[k];
21 | }));
22 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23 | Object.defineProperty(o, "default", { enumerable: true, value: v });
24 | }) : function(o, v) {
25 | o["default"] = v;
26 | });
27 | var __importStar = (this && this.__importStar) || function (mod) {
28 | if (mod && mod.__esModule) return mod;
29 | var result = {};
30 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31 | __setModuleDefault(result, mod);
32 | return result;
33 | };
34 | Object.defineProperty(exports, "__esModule", { value: true });
35 | exports.Tabs = void 0;
36 | var react_1 = __importStar(require("react"));
37 | var SchemaContainer_1 = require("./SchemaContainer");
38 | var Tabs = /** @class */ (function (_super) {
39 | __extends(Tabs, _super);
40 | function Tabs(props) {
41 | var _this = _super.call(this, props) || this;
42 | _this.state = {
43 | show: false,
44 | };
45 | _this.showModal = function (event) {
46 | _this.setState({ show: true });
47 | };
48 | // componentDidMount() {
49 | // // After schema is successfully sent to backend, backend spins up new database with inputted schemaName.
50 | // // It will send the frontend an updated variable 'lists' that is an array of updated lists of all the tabs (which is the same
51 | // // thing as all the databases). We open a channel to listen for it here inside of componentDidMount, then
52 | // // we invoke onClose to close schemaModal ONLY after we are sure that backend has created that channel.
53 | // ipcRenderer.on('db-lists', (
54 | // event: any,
55 | // returnedLists: any /*returnedDbSize: string*/
56 | // ) => {
57 | // this.setState({
58 | // currentSchema: returnedLists,
59 | // // databaseSize: returnedDbSize,
60 | // });
61 | // this.onClose(event);
62 | // });
63 | // }
64 | _this.onClose = function (event) {
65 | _this.setState({ show: false });
66 | };
67 | _this.showModal = _this.showModal.bind(_this);
68 | return _this;
69 | }
70 | Tabs.prototype.render = function () {
71 | var _a = this.props, queries = _a.queries, databaseSize = _a.databaseSize;
72 | return (react_1.default.createElement("div", { className: "tabs", id: "main-right" },
73 | react_1.default.createElement("ol", { className: "tab-list" },
74 | react_1.default.createElement("span", null)),
75 | react_1.default.createElement("div", { className: "tab-content" },
76 | react_1.default.createElement(SchemaContainer_1.SchemaContainer
77 | // key={index}
78 | , {
79 | // key={index}
80 | queries: this.props.queries, submit: this.props.submit, databaseSize: databaseSize }))));
81 | };
82 | return Tabs;
83 | }(react_1.Component));
84 | exports.Tabs = Tabs;
85 | //# sourceMappingURL=Tabs.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/Tabs.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../../frontend/components/rightPanel/Tabs.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,qDAAoD;AAepD;IAA0B,wBAAoB;IAC5C,cAAY,KAAgB;QAA5B,YACE,kBAAM,KAAK,CAAC,SAEb;QACD,WAAK,GAAU;YACb,IAAI,EAAE,KAAK;SACZ,CAAC;QAEF,eAAS,GAAG,UAAC,KAAU;YACrB,KAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,CAAC,CAAC;QAEF,wBAAwB;QACxB,6GAA6G;QAC7G,kIAAkI;QAClI,8GAA8G;QAC9G,4GAA4G;QAC5G,iCAAiC;QACjC,kBAAkB;QAClB,oDAAoD;QACpD,WAAW;QACX,sBAAsB;QACtB,sCAAsC;QACtC,yCAAyC;QACzC,UAAU;QACV,2BAA2B;QAC3B,QAAQ;QACR,IAAI;QAEJ,aAAO,GAAG,UAAC,KAAU;YACnB,KAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACjC,CAAC,CAAC;QA7BA,KAAI,CAAC,SAAS,GAAG,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;;IAC7C,CAAC;IA8BD,qBAAM,GAAN;QACQ,IAAA,KAA4B,IAAI,CAAC,KAAK,EAApC,OAAO,aAAA,EAAE,YAAY,kBAAe,CAAC;QAE7C,OAAO,CACL,uCAAK,SAAS,EAAC,MAAM,EAAC,EAAE,EAAC,YAAY;YACnC,sCAAI,SAAS,EAAC,UAAU;gBAatB,2CASO,CACJ;YAOL,uCAAK,SAAS,EAAC,aAAa;gBAC1B,8BAAC,iCAAe;gBACd,cAAc;;oBAAd,cAAc;oBACd,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,YAAY,EAAE,YAAY,GAC1B,CACE,CACF,CACP,CAAC;IACJ,CAAC;IACH,WAAC;AAAD,CAAC,AAhFD,CAA0B,iBAAS,GAgFlC;AAhFY,oBAAI"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/schemaChildren/Data.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16 | if (k2 === undefined) k2 = k;
17 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18 | }) : (function(o, m, k, k2) {
19 | if (k2 === undefined) k2 = k;
20 | o[k2] = m[k];
21 | }));
22 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23 | Object.defineProperty(o, "default", { enumerable: true, value: v });
24 | }) : function(o, v) {
25 | o["default"] = v;
26 | });
27 | var __importStar = (this && this.__importStar) || function (mod) {
28 | if (mod && mod.__esModule) return mod;
29 | var result = {};
30 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31 | __setModuleDefault(result, mod);
32 | return result;
33 | };
34 | Object.defineProperty(exports, "__esModule", { value: true });
35 | exports.Data = void 0;
36 | var react_1 = __importStar(require("react"));
37 | var DataTable_1 = require("./dataChildren/DataTable");
38 | var Data = /** @class */ (function (_super) {
39 | __extends(Data, _super);
40 | function Data(props) {
41 | return _super.call(this, props) || this;
42 | }
43 | // Rendering results of tracked query from Query panel.
44 | Data.prototype.render = function () {
45 | var queries = this.props.queries;
46 | return (react_1.default.createElement("div", { id: "data-panel" },
47 | react_1.default.createElement("h3", { id: "results-title" }, "Data Table"),
48 | react_1.default.createElement("div", { id: "data-table" }, queries.length === 0 ? null : react_1.default.createElement(DataTable_1.Table, { queries: queries }))));
49 | };
50 | return Data;
51 | }(react_1.Component));
52 | exports.Data = Data;
53 | //# sourceMappingURL=Data.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/schemaChildren/Data.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"Data.js","sourceRoot":"","sources":["../../../../../frontend/components/rightPanel/schemaChildren/Data.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,sDAAiD;AAYjD;IAA0B,wBAAoB;IAC5C,cAAY,KAAK;eACf,kBAAM,KAAK,CAAC;IACd,CAAC;IAED,uDAAuD;IACvD,qBAAM,GAAN;QACU,IAAA,OAAO,GAAK,IAAI,CAAC,KAAK,QAAf,CAAgB;QAE/B,OAAO,CACL,uCAAK,EAAE,EAAC,YAAY;YAClB,sCAAI,EAAE,EAAC,eAAe,iBAAgB;YACtC,uCAAK,EAAE,EAAC,YAAY,IACjB,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,8BAAC,iBAAK,IAAC,OAAO,EAAE,OAAO,GAAI,CACtD,CACF,CACP,CAAC;IACJ,CAAC;IACH,WAAC;AAAD,CAAC,AAlBD,CAA0B,iBAAS,GAkBlC;AAlBY,oBAAI"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/schemaChildren/DummyDataPanel.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"DummyDataPanel.js","sourceRoot":"","sources":["../../../../../frontend/components/rightPanel/schemaChildren/DummyDataPanel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAEzC,sEAAgD;AAkBhD;IAA6B,kCAAqC;IAEhE,wBAAY,KAA0B;QAAtC,YACE,kBAAM,KAAK,CAAC,SAOb;QAED,WAAK,GAAU;YACb,YAAY,EAAE,cAAc;YAC5B,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;SACd,CAAA;QAED,mEAAmE;QACnE,mBAAa,GAAG,UAAC,QAAQ,EAAE,CAAgC;YACzD,IAAI,QAAQ,KAAK,MAAM,EAAE;gBACvB,KAAI,CAAC,QAAQ,CAAC,EAAC,YAAY,EAAE,QAAQ,EAAC,CAAC,CAAC;aACzC;QACH,CAAC,CAAC;QAEF,yEAAyE;QACzE,kBAAY,GAAG;YACb,IAAM,MAAM,GAAQ,EAAE,CAAC;YACvB,IAAI,SAAS,CAAC;YACd,sEAAsE;YACtE,gFAAgF;YAChF,IAAI,KAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;gBACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACrD,IAAG,KAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;wBAAE,SAAS,GAAG,KAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;wBAC3D,SAAS,GAAG,KAAK,CAAC;oBACvB,MAAM,CAAC,IAAI,CAAC,8BAAC,kBAAQ,CAAC,IAAI,IAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAC,WAAW,EAAC,QAAQ,EAAE,SAAS,IAAG,SA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CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QAC3C,KAAI,CAAC,eAAe,GAAG,KAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;;IACzD,CAAC;IA8HD,+BAAM,GAAN;QAEE,OAAO,CACL,uCAAK,SAAS,EAAC,kBAAkB;YAC/B,gEAA4B;YAC5B,4EAAuC;YACrC,uCAAK,SAAS,EAAC,mBAAmB;gBAChC,8BAAC,kBAAQ,IAAC,QAAQ,EAAE,IAAI,CAAC,aAAa;oBACpC,8BAAC,kBAAQ,CAAC,MAAM,QACb,IAAI,CAAC,KAAK,CAAC,YAAY,CACR;oBAClB,8BAAC,kBAAQ,CAAC,IAAI,IAAC,SAAS,EAAC,aAAa,IACnC,IAAI,CAAC,YAAY,EAAE,CACN,CACP;gBACX,yCAAO,EAAE,EAAC,kBAAkB,EAAC,IAAI,EAAC,MAAM,EAAC,WAAW,EAAC,mBAAmB,EACtE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC3B,QAAQ,EAAE,IAAI,CAAC,eAAe,GACxB;gBACR,0CAAQ,EAAE,EAAC,mBAAmB,EAC5B,OAAO,EAAE,IAAI,CAAC,UAAU,mBAEjB,CACL;YACN,uCAAK,SAAS,EAAC,4BAA4B;gBACzC,yCAAO,SAAS,EAAC,kBAAkB;oBACjC;wBACE,sCAAI,SAAS,EAAC,SAAS;4BACrB,kDAAc;4BACd,sDAAkB;4BAClB,mDAAe,CACZ;wBACJ,IAAI,CAAC,SAAS,EAAE,CACX,CACF,CACJ;YACN,uCAAK,EAAE,EAAC,qBAAqB;gBAC3B,0CAAQ,OAAO,EAAE,IAAI,CAAC,eAAe,0BAA8B,CAC/D,CACJ,CACP,CAAA;IACH,CAAC;IACH,qBAAC;AAAD,CAAC,AAlLD,CAA6B,iBAAS,GAkLrC;AAED,kBAAe,cAAc,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/schemaChildren/Query.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16 | if (k2 === undefined) k2 = k;
17 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18 | }) : (function(o, m, k, k2) {
19 | if (k2 === undefined) k2 = k;
20 | o[k2] = m[k];
21 | }));
22 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23 | Object.defineProperty(o, "default", { enumerable: true, value: v });
24 | }) : function(o, v) {
25 | o["default"] = v;
26 | });
27 | var __importStar = (this && this.__importStar) || function (mod) {
28 | if (mod && mod.__esModule) return mod;
29 | var result = {};
30 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31 | __setModuleDefault(result, mod);
32 | return result;
33 | };
34 | var __importDefault = (this && this.__importDefault) || function (mod) {
35 | return (mod && mod.__esModule) ? mod : { "default": mod };
36 | };
37 | Object.defineProperty(exports, "__esModule", { value: true });
38 | var react_1 = __importStar(require("react"));
39 | // const { ipcRenderer } = window.require('electron');
40 | // const { dialog } = require('electron').remote;
41 | // Codemirror configuration
42 | require("codemirror/lib/codemirror.css"); // Styline
43 | require("codemirror/mode/sql/sql"); // Language (Syntax Highlighting)
44 | require("codemirror/theme/lesser-dark.css"); // Theme
45 | var react_codemirror_1 = __importDefault(require("@skidding/react-codemirror"));
46 | var Query = /** @class */ (function (_super) {
47 | __extends(Query, _super);
48 | function Query(props) {
49 | var _this = _super.call(this, props) || this;
50 | _this.state = {
51 | queryString: '',
52 | queryLabel: '',
53 | show: false,
54 | trackQuery: false,
55 | };
56 | _this.handleQuerySubmit = _this.handleQuerySubmit.bind(_this);
57 | _this.updateCode = _this.updateCode.bind(_this);
58 | _this.handleTrackQuery = _this.handleTrackQuery.bind(_this);
59 | return _this;
60 | // this.submitQuery = this.submitQuery.bind(this);
61 | }
62 | // componentDidMount() {
63 | // ipcRenderer.on('query-error', (event: any, message: string) => {
64 | // // dialog.showErrorBox('Error', message);
65 | // });
66 | // }
67 | // Updates state.queryString as user inputs query label
68 | Query.prototype.handleLabelEntry = function (event) {
69 | this.setState({ queryLabel: event.target.value });
70 | };
71 | // Updates state.trackQuery as user checks or unchecks box
72 | Query.prototype.handleTrackQuery = function (event) {
73 | this.setState({ trackQuery: event.target.checked });
74 | };
75 | // Updates state.queryString as user inputs query string
76 | Query.prototype.updateCode = function (newQueryString) {
77 | this.setState({
78 | queryString: newQueryString,
79 | });
80 | };
81 | // Submits query to backend on 'execute-query' channel
82 | Query.prototype.handleQuerySubmit = function (event) {
83 | // event.preventDefault();
84 | // // if query string is empty, show error
85 | // if (!this.state.queryString) {
86 | // dialog.showErrorBox('Please enter a Query.', '');
87 | // }
88 | // if (!this.state.trackQuery) {
89 | // //functionality to send query but not return stats and track
90 | // const queryAndSchema = {
91 | // queryString: this.state.queryString,
92 | // queryCurrentSchema: this.props.currentSchema,
93 | // queryLabel: this.state.queryLabel,
94 | // };
95 | // ipcRenderer.send('execute-query-untracked', queryAndSchema);
96 | // //reset frontend inputs to display as empty and unchecked
97 | // this.setState({ queryLabel: '', trackQuery: false, queryString: '' });
98 | // }
99 | // if (this.state.trackQuery && !this.state.queryLabel) {
100 | // dialog.showErrorBox('Please enter a label for the Query.', '');
101 | // } else if (this.state.trackQuery) {
102 | // // send query and return stats from explain/analyze
103 | // const queryAndSchema = {
104 | // queryString: this.state.queryString,
105 | // queryCurrentSchema: this.props.currentSchema,
106 | // queryLabel: this.state.queryLabel,
107 | // };
108 | // ipcRenderer.send('execute-query-tracked', queryAndSchema);
109 | // //reset frontend inputs to display as empty and unchecked
110 | // this.setState({ queryLabel: '', trackQuery: false, queryString: '' });
111 | // }
112 | };
113 | Query.prototype.render = function () {
114 | var _this = this;
115 | // Codemirror module configuration options
116 | var options = {
117 | lineNumbers: true,
118 | mode: 'sql',
119 | theme: 'lesser-dark',
120 | };
121 | return (react_1.default.createElement("div", { id: "query-panel" },
122 | react_1.default.createElement("h3", null, "Query"),
123 | react_1.default.createElement("form", { onSubmit: function (e) { return _this.props.submit(e, _this.state); } },
124 | react_1.default.createElement("div", { className: "query-label" },
125 | react_1.default.createElement("div", { id: "chart-option" },
126 | react_1.default.createElement("span", null, "track on chart:"),
127 | react_1.default.createElement("input", { id: "track", type: "checkbox", checked: this.state.trackQuery, onChange: this.handleTrackQuery })),
128 | react_1.default.createElement("div", { id: "label-option" },
129 | react_1.default.createElement("label", null, "label: "),
130 | react_1.default.createElement("input", { className: "label-field", type: "text", placeholder: "enter label to track", value: this.state.queryLabel, onChange: function (e) { return _this.handleLabelEntry(e); } }))),
131 | react_1.default.createElement("br", null),
132 | react_1.default.createElement("label", null, "Query:"),
133 | react_1.default.createElement("div", { className: "codemirror" },
134 | react_1.default.createElement(react_codemirror_1.default, { onChange: this.updateCode, options: options, value: this.state.queryString })),
135 | react_1.default.createElement("button", null, "Submit"),
136 | react_1.default.createElement("br", null),
137 | react_1.default.createElement("br", null))));
138 | };
139 | return Query;
140 | }(react_1.Component));
141 | exports.default = Query;
142 | //# sourceMappingURL=Query.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/schemaChildren/Query.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../../../frontend/components/rightPanel/schemaChildren/Query.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAIzC,sDA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C,EAAxB,CAAwB,GACzC,CACE,CACF;gBACN,yCAAM;gBACN,sDAAqB;gBAErB,uCAAK,SAAS,EAAC,YAAY;oBACzB,8BAAC,0BAAU,IACT,QAAQ,EAAE,IAAI,CAAC,UAAU,EACzB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GAC7B,CACE;gBACN,uDAAuB;gBACvB,yCAAM;gBACN,yCAAM,CACD,CACH,CACP,CAAC;IACJ,CAAC;IACH,YAAC;AAAD,CAAC,AA3HD,CAAoB,iBAAS,GA2H5B;AAED,kBAAe,KAAK,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/schemaChildren/SchemaModal.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"SchemaModal.js","sourceRoot":"","sources":["../../../../../frontend/components/rightPanel/schemaChildren/SchemaModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,mDAA2C;AAC3C,6CAA6C;AAErC,IAAA,MAAM,GAAK,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM,OAA/B,CAAgC;AACtC,IAAA,WAAW,GAAK,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,YAA/B,CAAgC;AAoBnD;IAA0B,+BAAkC;IAC1D,qBAAY,KAAuB;QAAnC,YACE,kBAAM,KAAK,CAAC,SAYb;QAED,WAAK,GAAU;YACb,UAAU,EAAE,EAAE;YACd,cAAc,EAAE,EAAE;YAClB,WAAW,EAAE,EAAE;YACf,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,iBAAiB;YAC7B,IAAI,EAAE,KAAK;SACZ,CAAC;QAyDF,mBAAa,GAAG,UAAC,QAAQ,EAAE,CAAgC;YACzD,KAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;QAC7C,CAAC,CAAC;QAOF,kBAAY,GAAG;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AE,EAAC,aAAa,EAChB,SAAS,EAAC,eAAe,EACzB,OAAO,EAAE,IAAI,CAAC,kBAAkB,gBAGzB,CACL;YAEN,0CACE,SAAS,EAAC,cAAc,EACxB,OAAO,EAAE;oBACP,KAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;oBACrB,KAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC;oBACjD,KAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;gBACpC,CAAC,QAGM,CACL,CACP,CAAC;IACJ,CAAC;IACH,kBAAC;AAAD,CAAC,AApLD,CAA0B,iBAAS,GAoLlC;AAED,kBAAe,WAAW,CAAC;AAE3B;IACE;;gCAE4B;CAC7B"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/schemaChildren/dataChildren/DataTable.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16 | if (k2 === undefined) k2 = k;
17 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18 | }) : (function(o, m, k, k2) {
19 | if (k2 === undefined) k2 = k;
20 | o[k2] = m[k];
21 | }));
22 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23 | Object.defineProperty(o, "default", { enumerable: true, value: v });
24 | }) : function(o, v) {
25 | o["default"] = v;
26 | });
27 | var __importStar = (this && this.__importStar) || function (mod) {
28 | if (mod && mod.__esModule) return mod;
29 | var result = {};
30 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31 | __setModuleDefault(result, mod);
32 | return result;
33 | };
34 | Object.defineProperty(exports, "__esModule", { value: true });
35 | exports.Table = void 0;
36 | var react_1 = __importStar(require("react"));
37 | var Table = /** @class */ (function (_super) {
38 | __extends(Table, _super);
39 | function Table(props) {
40 | var _this = _super.call(this, props) || this;
41 | _this.getKeys = _this.getKeys.bind(_this);
42 | _this.getHeader = _this.getHeader.bind(_this);
43 | _this.getRowsData = _this.getRowsData.bind(_this);
44 | return _this;
45 | }
46 | // Returns list of headings that should be displayed @ top of table
47 | Table.prototype.getKeys = function () {
48 | var queries = this.props.queries;
49 | // All keys will be consistent across each object in queryData,
50 | // so we only need to list keys of first object in data returned
51 | // from backend.
52 | return Object.keys(queries[queries.length - 1].queryData[0]);
53 | };
54 | // Create Header by generating a element for each key.
55 | Table.prototype.getHeader = function () {
56 | var keys = this.getKeys();
57 | return keys.map(function (key, index) {
58 | return react_1.default.createElement("th", { key: key }, key.toUpperCase());
59 | });
60 | };
61 | // Iterate through queryData array to return the body part of the table.
62 | Table.prototype.getRowsData = function () {
63 | var queries = this.props.queries;
64 | var items = queries[queries.length - 1].queryData;
65 | var keys = this.getKeys(); // actor_id, firstName, lastName, lastUpdated
66 | return items.map(function (row, index) {
67 | return (react_1.default.createElement("tr", { key: index },
68 | react_1.default.createElement(RenderRow, { key: index, data: row, keys: keys })));
69 | });
70 | };
71 | Table.prototype.render = function () {
72 | return (react_1.default.createElement("div", null,
73 | react_1.default.createElement("table", null,
74 | react_1.default.createElement("thead", { id: "dataTableHead" },
75 | react_1.default.createElement("tr", null, this.getHeader())),
76 | react_1.default.createElement("tbody", { id: "dataTableBody" }, this.getRowsData()))));
77 | };
78 | return Table;
79 | }(react_1.Component));
80 | exports.Table = Table;
81 | // Returns each cell within table
82 | var RenderRow = function (props) {
83 | var data = props.data, keys = props.keys;
84 | return keys.map(function (header, index) {
85 | // if the value of a row is undefined, then go to next iteration
86 | if (data[header] == undefined)
87 | return;
88 | // turn all values in data object to string or number
89 | data[header] = data[header].toString();
90 | return react_1.default.createElement("td", { key: index }, data[header]);
91 | });
92 | };
93 | //# sourceMappingURL=DataTable.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/schemaChildren/dataChildren/DataTable.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"DataTable.js","sourceRoot":"","sources":["../../../../../../frontend/components/rightPanel/schemaChildren/dataChildren/DataTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAWzC;IAA2B,yBAAqB;IAC9C,eAAY,KAAK;QAAjB,YACE,kBAAM,KAAK,CAAC,SAIb;QAHC,KAAI,CAAC,OAAO,GAAG,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QACvC,KAAI,CAAC,SAAS,GAAG,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;QAC3C,KAAI,CAAC,WAAW,GAAG,KAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;;IACjD,CAAC;IAED,mEAAmE;IACnE,uBAAO,GAAP;QACU,IAAA,OAAO,GAAK,IAAI,CAAC,KAAK,QAAf,CAAgB;QAE/B,+DAA+D;QAC/D,gEAAgE;QAChE,gBAAgB;QAChB,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,2DAA2D;IAC3D,yBAAS,GAAT;QACE,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE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AI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;QACvC,OAAO,sCAAI,GAAG,EAAE,KAAK,IAAG,IAAI,CAAC,MAAM,CAAC,CAAM,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/tabsChildren/Tab.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16 | if (k2 === undefined) k2 = k;
17 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
18 | }) : (function(o, m, k, k2) {
19 | if (k2 === undefined) k2 = k;
20 | o[k2] = m[k];
21 | }));
22 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23 | Object.defineProperty(o, "default", { enumerable: true, value: v });
24 | }) : function(o, v) {
25 | o["default"] = v;
26 | });
27 | var __importStar = (this && this.__importStar) || function (mod) {
28 | if (mod && mod.__esModule) return mod;
29 | var result = {};
30 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31 | __setModuleDefault(result, mod);
32 | return result;
33 | };
34 | Object.defineProperty(exports, "__esModule", { value: true });
35 | exports.Tab = void 0;
36 | var react_1 = __importStar(require("react"));
37 | var Tab = /** @class */ (function (_super) {
38 | __extends(Tab, _super);
39 | function Tab() {
40 | return _super !== null && _super.apply(this, arguments) || this;
41 | }
42 | Tab.prototype.render = function () {
43 | var _a = this.props, onClickTabItem = _a.onClickTabItem, currentSchema = _a.currentSchema, label = _a.label;
44 | var className = "tab-list-item";
45 | if (currentSchema === label) {
46 | className += " tab-list-active";
47 | }
48 | return (react_1.default.createElement("li", { className: className, onClick: function () { return onClickTabItem(label); } }, label));
49 | };
50 | return Tab;
51 | }(react_1.Component));
52 | exports.Tab = Tab;
53 | //# sourceMappingURL=Tab.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/components/rightPanel/tabsChildren/Tab.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"Tab.js","sourceRoot":"","sources":["../../../../../frontend/components/rightPanel/tabsChildren/Tab.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AAOzC;IAAyB,uBAAmB;IAA5C;;IAoBA,CAAC;IAlBG,oBAAM,GAAN;QACU,IAAA,KAIF,IAAI,CAAC,KAAK,EAHV,cAAc,oBAAA,EACd,aAAa,mBAAA,EACb,KAAK,WACK,CAAC;QAEf,IAAI,SAAS,GAAG,eAAe,CAAC;QAChC,IAAI,aAAa,KAAK,KAAK,EAAE;YACzB,SAAS,IAAI,kBAAkB,CAAC;SACnC;QAED,OAAO,CACH,sCAAI,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,cAAM,OAAA,cAAc,CAAC,KAAK,CAAC,EAArB,CAAqB,IACzD,KAAK,CACL,CACR,CAAC;IACN,CAAC;IACL,UAAC;AAAD,CAAC,AApBD,CAAyB,iBAAS,GAoBjC;AApBY,kBAAG"}
--------------------------------------------------------------------------------
/tsCompiled/frontend/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
4 | };
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | var react_1 = __importDefault(require("react"));
7 | var react_dom_1 = require("react-dom");
8 | var App_1 = require("./components/App");
9 | require("./assets/stylesheets/css/style.css");
10 | require("codemirror/lib/codemirror.css");
11 | var root = document.createElement('div');
12 | root.id = 'root';
13 | document.body.appendChild(root);
14 | react_dom_1.render(react_1.default.createElement("div", null,
15 | react_1.default.createElement(App_1.App, null)), document.getElementById('root'));
16 | //# sourceMappingURL=index.js.map
--------------------------------------------------------------------------------
/tsCompiled/frontend/index.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../frontend/index.tsx"],"names":[],"mappings":";;;;;AAAA,gDAA0B;AAC1B,uCAAmC;AACnC,wCAAuC;AACvC,8CAA4C;AAC5C,yCAAuC;AAEvC,IAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC3C,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC;AACjB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAEhC,kBAAM,CACJ;IACE,8BAAC,SAAG,OAAG,CACH,EACN,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAChC,CAAC"}
--------------------------------------------------------------------------------
/tsCompiled/webpack.config.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var path = require('path');
3 | var HtmlWebpackPlugin = require('html-webpack-plugin');
4 | var spawn = require('child_process').spawn;
5 | module.exports = {
6 | entry: './frontend/index.tsx',
7 | mode: process.env.NODE_ENV,
8 | devtool: 'eval-source-map',
9 | output: {
10 | filename: 'bundle.js',
11 | path: path.resolve(__dirname, 'dist'),
12 | },
13 | module: {
14 | rules: [
15 | {
16 | test: /\.s?css$/,
17 | use: [
18 | {
19 | loader: 'style-loader',
20 | },
21 | {
22 | loader: 'css-loader',
23 | },
24 | {
25 | loader: 'postcss-loader',
26 | options: {
27 | plugins: function () {
28 | // postcss plugins, can be exported to postcss.config.js
29 | return [require('autoprefixer')];
30 | },
31 | },
32 | },
33 | {
34 | loader: 'sass-loader',
35 | },
36 | ],
37 | },
38 | {
39 | test: /\.jsx?/,
40 | exclude: /node_modules/,
41 | use: {
42 | loader: 'babel-loader',
43 | options: {
44 | presets: ['@babel/preset-env', '@babel/preset-react'],
45 | },
46 | },
47 | },
48 | {
49 | test: /\.ts(x)?$/,
50 | exclude: /node_modules/,
51 | loader: 'ts-loader',
52 | },
53 | {
54 | test: /\.(jpg|jpeg|png|ttf|svg)$/,
55 | use: [
56 | 'file-loader',
57 | {
58 | loader: 'image-webpack-loader',
59 | options: {
60 | mozjpeg: {
61 | quality: 10,
62 | },
63 | },
64 | },
65 | ],
66 | exclude: /node_modules/,
67 | },
68 | ],
69 | },
70 | resolve: {
71 | // Enable importing JS / JSX files without specifying their extension
72 | modules: [path.resolve(__dirname, 'node_modules')],
73 | extensions: [
74 | '.js',
75 | '.jsx',
76 | '.json',
77 | '.scss',
78 | '.less',
79 | '.css',
80 | '.tsx',
81 | '.ts',
82 | ],
83 | },
84 | target: 'web',
85 | devServer: {
86 | contentBase: path.resolve(__dirname, '/tsCompiled/frontend'),
87 | host: 'localhost',
88 | port: '8080',
89 | hot: true,
90 | compress: true,
91 | proxy: {
92 | '/**': 'http://localhost:3000/',
93 | },
94 | watchContentBase: true,
95 | watchOptions: {
96 | ignored: /node_modules/,
97 | },
98 | },
99 | plugins: [
100 | new HtmlWebpackPlugin({
101 | filename: 'index.html',
102 | title: 'SeeQR',
103 | cspPlugin: {
104 | enabled: true,
105 | policy: {
106 | 'base-uri': "'self'",
107 | 'object-src': "'none'",
108 | 'script-src': ["'self'"],
109 | 'style-src': ["'self'"],
110 | },
111 | hashEnabled: {
112 | 'script-src': true,
113 | 'style-src': true,
114 | },
115 | nonceEnabled: {
116 | 'script-src': true,
117 | 'style-src': true,
118 | },
119 | },
120 | }),
121 | ],
122 | };
123 | //# sourceMappingURL=webpack.config.js.map
--------------------------------------------------------------------------------
/tsCompiled/webpack.config.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"webpack.config.js","sourceRoot":"","sources":["../webpack.config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,EAAE;6BACZ;yBACF;qBACF;iBACF;gBACD,OAAO,EAAE,cAAc;aACxB;SACF;KACF;IACD,OAAO,EAAE;QACP,qEAAqE;QACrE,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAClD,UAAU,EAAE;YACV,KAAK;YACL,MAAM;YACN,OAAO;YACP,OAAO;YACP,OAAO;YACP,MAAM;YACN,MAAM;YACN,KAAK;SACN;KACF;IACD,MAAM,EAAE,KAAK;IACb,SAAS,EAAE;QACT,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,sBAAsB,CAAC;QAC5D,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,IAAI;QACT,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE;YACL,KAAK,EAAE,wBAAwB;SAChC;QACD,gBAAgB,EAAE,IAAI;QACtB,YAAY,EAAE;YACZ,OAAO,EAAE,cAAc;SACxB;KACF;IACD,OAAO,EAAE;QACP,IAAI,iBAAiB,CAAC;YACpB,QAAQ,EAAE,YAAY;YACtB,KAAK,EAAE,OAAO;YACd,SAAS,EAAE;gBACT,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACN,UAAU,EAAE,QAAQ;oBACpB,YAAY,EAAE,QAAQ;oBACtB,YAAY,EAAE,CAAC,QAAQ,CAAC;oBACxB,WAAW,EAAE,CAAC,QAAQ,CAAC;iBACxB;gBACD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;oBAClB,WAAW,EAAE,IAAI;iBAClB;gBACD,YAAY,EAAE;oBACZ,YAAY,EAAE,IAAI;oBAClB,WAAW,EAAE,IAAI;iBAClB;aACF;SACF,CAAC;KACH;CACF,CAAC"}
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */
4 | /* Basic Options */
5 | // "incremental": true, /* Enable incremental compilation */
6 | "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
7 | "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
8 | // "lib": [], /* Specify library files to be included in the compilation. */
9 | "allowJs": true /* Allow javascript files to be compiled. */,
10 | // "checkJs": true, /* Report errors in .js files. */
11 | "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
12 | // "declaration": true, /* Generates corresponding '.d.ts' file. */
13 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
14 | "sourceMap": true /* Generates corresponding '.map' file. */,
15 | // "outFile": "./", /* Concatenate and emit output to single file. */
16 | "outDir": "./tsCompiled" /* Redirect output structure to the directory. */,
17 | "rootDir": "./" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
18 | // "composite": true, /* Enable project compilation */
19 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
20 | // "removeComments": true, /* Do not emit comments to output. */
21 | // "noEmit": true, /* Do not emit outputs. */
22 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */
23 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
24 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
25 | /* Strict Type-Checking Options */
26 | "strict": true /* Enable all strict type-checking options. */,
27 | "noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */,
28 | // "strictNullChecks": true, /* Enable strict null checks. */
29 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */
30 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
31 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
32 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
33 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
34 | /* Additional Checks */
35 | // "noUnusedLocals": true, /* Report errors on unused locals. */
36 | // "noUnusedParameters": true, /* Report errors on unused parameters. */
37 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
38 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
39 | /* Module Resolution Options */
40 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
41 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
42 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
43 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
44 | // "typeRoots": [], /* List of folders to include type definitions from. */
45 | // "types": [], /* Type declaration files to be included in compilation. */
46 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
47 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
48 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
49 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
50 | /* Source Map Options */
51 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
52 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
53 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
54 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
55 | /* Experimental Options */
56 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
57 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
58 | /* Advanced Options */
59 | "skipLibCheck": true /* Skip type checking of declaration files. */,
60 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
61 | "resolveJsonModule": true /* Include modules imported with '.json' extension. Requires TypeScript version 2.9 or later. */
62 | },
63 | "exclude": [
64 | "node_modules",
65 | "dist",
66 | "tsCompiled",
67 | "__tests__"
68 | ]
69 | }
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const HtmlWebpackPlugin = require('html-webpack-plugin');
3 | const { spawn } = require('child_process');
4 |
5 | module.exports = {
6 | entry: './frontend/index.tsx',
7 | mode: process.env.NODE_ENV,
8 | devtool: 'eval-source-map',
9 | output: {
10 | filename: 'bundle.js',
11 | path: path.resolve(__dirname, 'dist'),
12 | },
13 | module: {
14 | rules: [
15 | {
16 | test: /\.s?css$/,
17 | use: [
18 | {
19 | loader: 'style-loader', // inject CSS to page
20 | },
21 | {
22 | loader: 'css-loader', // translates CSS into CommonJS modules
23 | },
24 | {
25 | loader: 'postcss-loader', // Run postcss actions
26 | options: {
27 | plugins() {
28 | // postcss plugins, can be exported to postcss.config.js
29 | return [require('autoprefixer')];
30 | },
31 | },
32 | },
33 | {
34 | loader: 'sass-loader', // compiles Sass to CSS
35 | },
36 | ],
37 | },
38 | {
39 | test: /\.jsx?/,
40 | exclude: /node_modules/,
41 | use: {
42 | loader: 'babel-loader',
43 | options: {
44 | presets: ['@babel/preset-env', '@babel/preset-react'],
45 | },
46 | },
47 | },
48 | {
49 | test: /\.ts(x)?$/,
50 | exclude: /node_modules/,
51 | loader: 'ts-loader',
52 | },
53 | {
54 | test: /\.(jpg|jpeg|png|ttf|svg)$/,
55 | use: [
56 | 'file-loader',
57 | {
58 | loader: 'image-webpack-loader',
59 | options: {
60 | mozjpeg: {
61 | quality: 10,
62 | },
63 | },
64 | },
65 | ],
66 | exclude: /node_modules/,
67 | },
68 | ],
69 | },
70 | resolve: {
71 | // Enable importing JS / JSX files without specifying their extension
72 | modules: [path.resolve(__dirname, 'node_modules')],
73 | extensions: [
74 | '.js',
75 | '.jsx',
76 | '.json',
77 | '.scss',
78 | '.less',
79 | '.css',
80 | '.tsx',
81 | '.ts',
82 | ],
83 | },
84 | target: 'web',
85 | devServer: {
86 | contentBase: path.resolve(__dirname, '/tsCompiled/frontend'),
87 | host: 'localhost',
88 | port: '8080',
89 | hot: true,
90 | compress: true,
91 | proxy: {
92 | '/**': 'http://localhost:3000/',
93 | },
94 | watchContentBase: true,
95 | watchOptions: {
96 | ignored: /node_modules/,
97 | },
98 | },
99 | plugins: [
100 | new HtmlWebpackPlugin({
101 | filename: 'index.html',
102 | title: 'SeeQR',
103 | cspPlugin: {
104 | enabled: true,
105 | policy: {
106 | 'base-uri': "'self'",
107 | 'object-src': "'none'",
108 | 'script-src': ["'self'"],
109 | 'style-src': ["'self'"],
110 | },
111 | hashEnabled: {
112 | 'script-src': true,
113 | 'style-src': true,
114 | },
115 | nonceEnabled: {
116 | 'script-src': true,
117 | 'style-src': true,
118 | },
119 | },
120 | }),
121 | ],
122 | };
123 |
--------------------------------------------------------------------------------
|