├── packages
├── insights-web
│ ├── .env
│ ├── src
│ │ ├── react-app-env.d.ts
│ │ ├── lib
│ │ │ ├── selectors
│ │ │ │ └── location.js
│ │ │ ├── utils
│ │ │ │ ├── delay.js
│ │ │ │ ├── move-caret-to-end.js
│ │ │ │ ├── script.js
│ │ │ │ ├── range.js
│ │ │ │ └── highlight-text.js
│ │ │ ├── popups
│ │ │ │ ├── delete.js
│ │ │ │ └── prompt.js
│ │ │ ├── explorer
│ │ │ │ ├── get-meta.js
│ │ │ │ ├── get-sorted-meta.js
│ │ │ │ ├── state-to-url.js
│ │ │ │ └── url-to-state.js
│ │ │ ├── client.js
│ │ │ └── tags
│ │ │ │ ├── submit-button.js
│ │ │ │ └── spinner.js
│ │ ├── scenes
│ │ │ ├── settings
│ │ │ │ ├── styles.scss
│ │ │ │ └── index.js
│ │ │ ├── users
│ │ │ │ ├── styles.scss
│ │ │ │ ├── logic.js
│ │ │ │ └── index.js
│ │ │ ├── explorer
│ │ │ │ ├── tags
│ │ │ │ │ └── full-path
│ │ │ │ │ │ ├── styles.scss
│ │ │ │ │ │ └── index.js
│ │ │ │ ├── connection
│ │ │ │ │ ├── database
│ │ │ │ │ │ ├── form
│ │ │ │ │ │ │ └── intro.js
│ │ │ │ │ │ ├── index.js
│ │ │ │ │ │ └── menu
│ │ │ │ │ │ │ └── index.js
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── styles.scss
│ │ │ │ │ └── subset
│ │ │ │ │ │ ├── form
│ │ │ │ │ │ ├── models
│ │ │ │ │ │ │ ├── model-row
│ │ │ │ │ │ │ │ └── index.js
│ │ │ │ │ │ │ ├── styles.scss
│ │ │ │ │ │ │ ├── field-row
│ │ │ │ │ │ │ │ └── index.js
│ │ │ │ │ │ │ ├── json
│ │ │ │ │ │ │ │ └── index.js
│ │ │ │ │ │ │ └── index.js
│ │ │ │ │ │ └── logic.js
│ │ │ │ │ │ ├── index.js
│ │ │ │ │ │ └── menu
│ │ │ │ │ │ └── index.js
│ │ │ │ ├── graph
│ │ │ │ │ ├── styles.scss
│ │ │ │ │ ├── time-group-select.js
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── compare-with.js
│ │ │ │ │ └── controls-right.js
│ │ │ │ ├── pagination
│ │ │ │ │ └── index.js
│ │ │ │ ├── dashboard
│ │ │ │ │ ├── views
│ │ │ │ │ │ ├── styles.scss
│ │ │ │ │ │ └── index.js
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── breadcrumbs
│ │ │ │ │ │ ├── model.js
│ │ │ │ │ │ └── index.js
│ │ │ │ │ └── styles.scss
│ │ │ │ ├── filter
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── column-filters.js
│ │ │ │ │ └── styles.scss
│ │ │ │ ├── sidebar
│ │ │ │ │ ├── models
│ │ │ │ │ │ ├── logic.js
│ │ │ │ │ │ └── index.js
│ │ │ │ │ └── selected-model
│ │ │ │ │ │ ├── aggregate
│ │ │ │ │ │ └── index.js
│ │ │ │ │ │ └── pin
│ │ │ │ │ │ └── index.js
│ │ │ │ ├── time-filter
│ │ │ │ │ └── index.js
│ │ │ │ ├── styles.scss
│ │ │ │ └── table
│ │ │ │ │ └── table-settings.js
│ │ │ ├── header
│ │ │ │ ├── logic.js
│ │ │ │ ├── styles.scss
│ │ │ │ ├── saga.js
│ │ │ │ ├── views
│ │ │ │ │ ├── styles.scss
│ │ │ │ │ └── index.js
│ │ │ │ ├── user
│ │ │ │ │ └── index.js
│ │ │ │ ├── copy-query
│ │ │ │ │ └── index.js
│ │ │ │ └── share
│ │ │ │ │ └── index.js
│ │ │ ├── _layout
│ │ │ │ ├── logic.js
│ │ │ │ ├── styles.scss
│ │ │ │ └── index.js
│ │ │ ├── login
│ │ │ │ ├── styles.scss
│ │ │ │ ├── logic.js
│ │ │ │ ├── saga.js
│ │ │ │ └── index.js
│ │ │ ├── routes.js
│ │ │ ├── index.js
│ │ │ └── urls
│ │ │ │ └── index.js
│ │ ├── index.scss
│ │ └── index.js
│ ├── public
│ │ ├── robots.txt
│ │ ├── favicon.ico
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── logo64.png
│ │ ├── manifest.json
│ │ ├── index.html
│ │ └── insights.svg
│ ├── .gitignore
│ ├── config-overrides.js
│ ├── tsconfig.json
│ ├── README.md
│ └── package.json
├── insights-charts
│ ├── src
│ │ └── index.js
│ ├── .babelrc
│ └── package.json
├── insights-api
│ ├── src
│ │ ├── config.ts
│ │ ├── middleware
│ │ │ └── index.ts
│ │ ├── services
│ │ │ ├── favourites
│ │ │ │ ├── favourites.class.ts
│ │ │ │ ├── favourites.hooks.ts
│ │ │ │ └── favourites.service.ts
│ │ │ ├── urls
│ │ │ │ ├── urls.class.ts
│ │ │ │ ├── urls.service.ts
│ │ │ │ └── urls.hooks.ts
│ │ │ ├── users
│ │ │ │ ├── users.class.ts
│ │ │ │ ├── users.service.ts
│ │ │ │ └── users.hooks.ts
│ │ │ ├── views
│ │ │ │ ├── views.class.ts
│ │ │ │ ├── views.hooks.ts
│ │ │ │ └── views.service.ts
│ │ │ ├── connections
│ │ │ │ ├── connections.class.ts
│ │ │ │ ├── connections.service.ts
│ │ │ │ └── connections.hooks.ts
│ │ │ ├── results
│ │ │ │ ├── results.hooks.ts
│ │ │ │ ├── results.service.ts
│ │ │ │ └── results.class.ts
│ │ │ ├── structure
│ │ │ │ ├── structure.hooks.ts
│ │ │ │ └── structure.service.ts
│ │ │ ├── connection-test
│ │ │ │ ├── connection-test.hooks.ts
│ │ │ │ ├── connection-test.service.ts
│ │ │ │ └── connection-test.class.ts
│ │ │ ├── index.ts
│ │ │ └── subsets
│ │ │ │ ├── subsets.service.ts
│ │ │ │ ├── subsets.hooks.ts
│ │ │ │ └── subsets.class.ts
│ │ ├── utils
│ │ │ ├── random-string.ts
│ │ │ ├── set-config-folder.ts
│ │ │ └── find-config-folder.ts
│ │ ├── models
│ │ │ ├── views.model.ts
│ │ │ ├── subsets.model.ts
│ │ │ ├── connections.model.ts
│ │ │ ├── favourites.model.ts
│ │ │ ├── urls.model.ts
│ │ │ └── users.model.ts
│ │ ├── insights
│ │ │ ├── structure
│ │ │ │ ├── generators
│ │ │ │ │ └── index.ts
│ │ │ │ └── index.ts
│ │ │ ├── adapter
│ │ │ │ ├── index.ts
│ │ │ │ └── sql
│ │ │ │ │ ├── sqlite.ts
│ │ │ │ │ └── postgres.ts
│ │ │ └── definitions.d.ts
│ │ ├── declarations.d.ts
│ │ ├── logger.ts
│ │ ├── index.ts
│ │ ├── app.hooks.ts
│ │ ├── app.ts
│ │ ├── authentication.ts
│ │ └── channels.ts
│ ├── jest.config.js
│ ├── test
│ │ ├── services
│ │ │ ├── urls.test.ts
│ │ │ ├── users.test.ts
│ │ │ ├── views.test.ts
│ │ │ ├── results.test.ts
│ │ │ ├── subsets.test.ts
│ │ │ ├── favourites.test.ts
│ │ │ ├── structure.test.ts
│ │ │ ├── connections.test.ts
│ │ │ └── connection-test.test.ts
│ │ ├── authentication.test.ts
│ │ └── app.test.ts
│ ├── .editorconfig
│ ├── tsconfig.json
│ ├── README.md
│ ├── .gitignore
│ └── package.json
├── insights-desktop
│ ├── main.js
│ ├── bin
│ │ └── insights-desktop
│ └── package.json
└── insights
│ ├── app
│ ├── templates
│ │ ├── development.json
│ │ ├── production.json
│ │ └── default.json
│ ├── lib
│ │ ├── random-string.js
│ │ ├── create-folder.js
│ │ └── find-config-folder.js
│ ├── create-secret.js
│ ├── start.js
│ └── create-superuser.js
│ ├── yarn.lock
│ ├── bin
│ ├── insights-createsecret
│ ├── insights
│ ├── insights-init
│ ├── insights-createsuperuser
│ └── insights-start
│ └── package.json
├── tsconfig.json
├── .editorconfig
├── .vscode
└── launch.json
├── .github
└── FUNDING.yml
├── .eslintrc
├── .npmignore
├── TODO.md
├── scripts
└── sync-versions.js
├── LICENSE
├── package.json
├── .gitignore
└── README.md
/packages/insights-web/.env:
--------------------------------------------------------------------------------
1 | BROWSER=none
2 |
--------------------------------------------------------------------------------
/packages/insights-charts/src/index.js:
--------------------------------------------------------------------------------
1 | export { Graph } from './graph/recharts'
2 |
--------------------------------------------------------------------------------
/packages/insights-web/src/react-app-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
Short URL not found!
') 11 | } 12 | }) 13 | ``` 14 | 15 | 2. Check that you can't just CREATE users on the service 16 | 17 | 3. Make it possible to run it like so: 18 | 19 | `npx insights start` 20 | 21 | It will ask you questions if it can't find its own config data 22 | 23 | It will create a ".insights/config.yml" to store its config if none found. 24 | 25 | .insights 26 | insights 27 | config/insights 28 | 29 | This will contain the ENV for insights like DB paths. 30 | 31 | Also optional schema files (current insights.yml): 32 | 33 | -------------------------------------------------------------------------------- /packages/insights-web/src/scenes/explorer/connection/subset/form/models/model-row/index.js: -------------------------------------------------------------------------------- 1 | import { Tag } from 'antd' 2 | import React from 'react' 3 | 4 | export default function ModelRow ({ model, ignoredColumnCount, addedColumnCount, editedColumnCount }) { 5 | return ( 6 | 7 | {model}{' '} 8 | 9 | {ignoredColumnCount > 0 ? ( 10 |$ insights createsuperuser
49 | If you like Insights or use it in your company, please consider sponsoring its development.
20 | 21 |{field.meta.sql}
32 |
25 | Insights
26 | Insights API backend!
')); 49 | 50 | // Set up Plugins and providers 51 | app.configure(express.rest()); 52 | app.configure(socketio()); 53 | 54 | // Configure other middleware (see `middleware/index.js`) 55 | app.configure(middleware); 56 | app.configure(authentication); 57 | // Set up our services (see `services/index.js`) 58 | app.configure(services); 59 | // Set up event channels (see channels.js) 60 | app.configure(channels); 61 | 62 | // Configure a middleware for 404s and the error handler 63 | app.use(express.notFound()); 64 | app.use(express.errorHandler({ logger } as any)); 65 | 66 | app.hooks(appHooks); 67 | 68 | export default app; 69 | -------------------------------------------------------------------------------- /packages/insights-web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "insights-web", 3 | "version": "0.0.101", 4 | "dependencies": { 5 | "@feathersjs/client": "^4.5.0", 6 | "@types/jest": "24.9.1", 7 | "@types/node": "13.5.0", 8 | "antd": "^3.26.7", 9 | "connected-react-router": "^6.6.1", 10 | "copy-to-clipboard": "3.2.0", 11 | "diacritics": "1.3.0", 12 | "downloadjs": "1.4.7", 13 | "fixed-data-table-2": "1.0.2", 14 | "font-awesome": "4.7.0", 15 | "helmet": "3.21.2", 16 | "kea": "1.0.1", 17 | "kea-listeners": "^0.2.2", 18 | "kea-saga": "^1.0.1", 19 | "merge-ranges": "1.0.2", 20 | "messg": "^2.2.2", 21 | "moment": "2.24.0", 22 | "sass": "^1.77.8", 23 | "nprogress": "0.2.0", 24 | "prop-types": "^15.7.2", 25 | "react": "^16.12.0", 26 | "react-dimensions": "1.3.1", 27 | "react-dom": "^16.12.0", 28 | "react-flex-layout": "mariusandra/react-flex-layout", 29 | "react-popup": "0.10.0", 30 | "react-redux": "7.1.3", 31 | "react-router": "5.1.2", 32 | "react-scripts": "3.3.0", 33 | "react-wordcloud": "^1.1.1", 34 | "redux": "4.0.5", 35 | "redux-saga": "1.1.3", 36 | "reselect": "4.0.0", 37 | "scroll-into-view": "^1.14.1", 38 | "socket.io-client": "^2.3.0", 39 | "string-natural-compare": "^3.0.1", 40 | "typescript": "3.7.5" 41 | }, 42 | "scripts": { 43 | "start": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-app-rewired start", 44 | "build": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-app-rewired build", 45 | "test": "cross-env NODE_OPTIONS=--openssl-legacy-provider react-app-rewired test", 46 | "eject": "react-scripts eject", 47 | "prepublish": "npm run build" 48 | }, 49 | "eslintConfig": { 50 | "extends": "react-app" 51 | }, 52 | "browserslist": { 53 | "production": [ 54 | ">0.2%", 55 | "not dead", 56 | "not op_mini all" 57 | ], 58 | "development": [ 59 | "last 1 chrome version", 60 | "last 1 firefox version", 61 | "last 1 safari version" 62 | ] 63 | }, 64 | "devDependencies": { 65 | "babel-plugin-import": "^1.13.0", 66 | "customize-cra": "^0.9.1", 67 | "cross-env": "^6.0.3", 68 | "less": "^3.10.3", 69 | "less-loader": "^5.0.0", 70 | "react-app-rewired": "^2.1.5", 71 | "semver": "^7.1.1" 72 | }, 73 | "files": [ 74 | "build" 75 | ] 76 | } 77 | -------------------------------------------------------------------------------- /packages/insights-web/src/scenes/explorer/connection/subset/form/models/json/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Button, Form, Input, Modal } from 'antd' 3 | import { useActions, useValues } from 'kea' 4 | 5 | import modelsLogic from '../logic' 6 | 7 | function JSONComponent ({ visible, form: { getFieldDecorator, validateFieldsAndScroll, getFieldValue } }) { 8 | const { defaultJSON } = useValues(modelsLogic) 9 | const { hideJSON, setNewFields, setEditedFields, setCheckedKeys } = useActions(modelsLogic) 10 | 11 | const handleSave = (e) => { 12 | e.preventDefault() 13 | 14 | validateFieldsAndScroll((err, values) => { 15 | if (!err) { 16 | const { newFields, editedFields, checkedKeys } = JSON.parse(values.json) 17 | setNewFields(newFields || {}) 18 | setEditedFields(editedFields || {}) 19 | setCheckedKeys(checkedKeys || []) 20 | hideJSON() 21 | } 22 | }) 23 | } 24 | 25 | return ( 26 |