Skip to content

Commit 1ddc77b

Browse files
authored
Merge pull request #15 from oslabs-beta/exe.testing_merge
Exe.testing merge
2 parents a52eecf + df11d27 commit 1ddc77b

File tree

15 files changed

+195
-32313
lines changed

15 files changed

+195
-32313
lines changed

app/index.html

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
7-
<title>CHRONOS</title>
8-
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/>
9-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Open+Sans&family=Inter:wght@100&family=Lexend+Peta&display=swap" />
10-
<script src="https://cdn.plot.ly/plotly-latest.min.js" charset="utf-8"></script>
11-
<base href="/" />
12-
</head>
13-
<body>
14-
<div id="app"></div>
15-
</body>
16-
</html>
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
8+
<title>CHRONOS</title>
9+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
10+
<link rel="stylesheet"
11+
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Open+Sans&family=Inter:wght@100&family=Lexend+Peta&display=swap" />
12+
<script src="https://cdn.plot.ly/plotly-latest.min.js" charset="utf-8"></script>
13+
</head>
14+
15+
<body>
16+
<div id="app"></div>
17+
</body>
18+
19+
</html>

dist.package.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "chronos",
3+
"productName": "Chronos",
4+
"version": "6.1.0",
5+
"description": "Chronos Microservice Debugger",
6+
"main": "./build/Main.js",
7+
"scripts": {
8+
"build": "webpack",
9+
"start": "webpack serve",
10+
"nodemon": "nodemon server/server.js",
11+
"electron": "electron .",
12+
"electron:wsl": "electron . --no-sandbox"
13+
},
14+
"babel": {
15+
"presets": ["@babel/preset-env", "@babel/preset-react"],
16+
"plugins": ["@babel/plugin-proposal-class-properties"]
17+
},
18+
"keywords": ["distributed tracing", "tracing"],
19+
"author": "",
20+
"license": "ISC",
21+
"dependencies": {
22+
"@fortawesome/fontawesome-svg-core": "^1.2.35",
23+
"@fortawesome/free-solid-svg-icons": "^5.15.3",
24+
"@fortawesome/react-fontawesome": "^0.1.14",
25+
"@grpc/proto-loader": "^0.6.1",
26+
"@material-ui/core": "^4.11.3",
27+
"@material-ui/icons": "^4.11.2",
28+
"@pionerlabs/grpc-interceptors": "^0.2.5",
29+
"@types/react-table": "^7.0.29",
30+
"caniuse-lite": "^1.0.30001312",
31+
"chai": "^4.3.4",
32+
"chronos-tracker": "^6.0.3",
33+
"d3": "^6.7.0",
34+
"electron": "^12.2.3",
35+
"enzyme-adapter-react-16": "^1.15.6",
36+
"express": "^4.17.1",
37+
"lodash": "^4.17.21",
38+
"moment": "^2.29.1",
39+
"mongodb": "^3.6.6",
40+
"mongoose": "^5.12.5",
41+
"oidc-client": "^1.11.5",
42+
"pg": "^8.6.0",
43+
"plotly.js": "^1.58.4",
44+
"plotly.js-dist": "^1.58.4",
45+
"react": "16.10.1",
46+
"react-dom": "16.10.1",
47+
"react-graph-vis": "^1.0.7",
48+
"react-plotly.js": "^2.5.1",
49+
"react-router-dom": "^5.2.0",
50+
"react-table": "^7.7.0",
51+
"styled-components": "^5.2.3",
52+
"webdriverio": "^6.12.1"
53+
},
54+
"directories": {
55+
"example": "examples"
56+
},
57+
"repository": {
58+
"type": "git",
59+
"url": "git+https://github.com/hodesza/Chronos.git"
60+
},
61+
"bugs": {
62+
"url": "https://github.com/hodesza/Chronos/issues"
63+
},
64+
"homepage": "https://github.com/hodesza/Chronos#readme"
65+
}

electron/Main.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { app, BrowserWindow, ipcMain } from 'electron';
22
import './routes/user';
33
import './routes/dashboard';
44
import './routes/data';
5+
import path from 'path';
56

67
const ipc = ipcMain;
78

@@ -23,20 +24,17 @@ const createWindow = () => {
2324
frame: false,
2425
titleBarStyle: 'hidden',
2526
webPreferences: {
27+
preload: path.join(__dirname, './utilities/preload.js').replace(/\\/g, '/'),
2628
nodeIntegration: true,
2729
contextIsolation: false,
2830
},
2931
});
3032

3133
// Development: load the application window to port 8080
3234
win.loadURL('http://localhost:8080/');
33-
// win.loadFile('./dist/index.html');
34-
// win.loadURL(`file://${path.join(__dirname, './dist/index.html')}`);
3535

36-
// win.webContents.on('did-finish-load', () => {
37-
// console.log('content loaded');
38-
// win.webContents.executeJavaScript(`console.log(${remote})`);
39-
// });
36+
//Production
37+
// win.loadFile(path.resolve('./resources/app/index.html').replace(/\\/g, '/'));
4038

4139
ipc.on('max', () => {
4240
if (!win.isMaximized()) win.maximize();

electron/utilities/addBase.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const fs = require('fs');
2+
3+
const path = require('path');
4+
5+
let route = path.resolve('./resources/app/index.html').replace(/\\/g, '/');
6+
let html = fs.readFileSync(route, 'utf-8');
7+
console.log('hi', html.match(/base/), route);
8+
if (!html.match(/base/)) {
9+
const entryInd = html.match(/<head>/).index + 6;
10+
let link = path.resolve() + '/resources/app/extraRouteDepthForImgRoutesToWork/';
11+
link = link.replace(/\\/g, '/');
12+
13+
html = html.split('');
14+
html.splice(entryInd, 0, `<base href="${link}" />`).join('');
15+
html = html.join('');
16+
17+
fs.writeFileSync(path.resolve('./resources/app/index.html'), html);
18+
}

electron/utilities/preload.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const path = require('path')
2+
3+
// const script = document.querySelector('[src=index_bundle.js]');
4+
window.addEventListener('DOMContentLoaded', () => {
5+
let link = path.resolve() + '/resources/app/';
6+
link = link.replace(/\\/g, '/');
7+
var script = document.createElement('script');
8+
script.src = link + 'index_bundle.js';
9+
document.getElementsByTagName('head')[0].appendChild(script);
10+
});

nodeUtilities/alterImgPaths.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const fs = require('fs');
2+
3+
function alterImgPaths(path, replaceArr) {
4+
if(fs.existsSync(path) && fs.lstatSync(path).isFile()) {
5+
6+
}
7+
}
8+
9+
alterImgPaths('./dist/index_bundle.js')

nodeUtilities/deleteDist.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const fs = require('fs')
2+
3+
4+
function deleteFolderRecursive(path) {
5+
if (fs.existsSync(path) && fs.lstatSync(path).isDirectory()) {
6+
fs.readdirSync(path).forEach(function (file, index) {
7+
var curPath = path + '/' + file;
8+
9+
if (fs.lstatSync(curPath).isDirectory()) {
10+
// recurse
11+
deleteFolderRecursive(curPath);
12+
} else {
13+
// delete file
14+
fs.unlinkSync(curPath);
15+
}
16+
});
17+
18+
console.log(`Deleting directory "${path}"...`);
19+
fs.rmdirSync(path);
20+
}
21+
}
22+
23+
console.log('Cleaning working tree...');
24+
25+
deleteFolderRecursive('./dist');

notes/Notes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dist folder contains the client side code
2+
3+
build folder contains the electron code
4+
5+
electron-packager ./dist chronos --overwrite --asar --prune=true --out=release-builds
6+
7+
electron-packager ./dist chronos --overwrite --prune=true --out=release-builds
8+
9+

notes/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
7+
<title>CHRONOS</title>
8+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/>
9+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Open+Sans&family=Inter:wght@100&family=Lexend+Peta&display=swap" />
10+
<script src="https://cdn.plot.ly/plotly-latest.min.js" charset="utf-8"></script>
11+
<base href="C:/Users/willi/OneDrive/Desktop/CodeSmith/projects/osp/Chronos/release-builds/chronos-win32-x64/" />
12+
</head>
13+
<body>
14+
<div id="app"></div>
15+
<script type="text/javascript" src="resources/app/dist/index_bundle.js"></script></body>
16+
</html>

0 commit comments

Comments
 (0)