@@ -3,3 +3,5 @@ __pycache__ | |||||
node_modules | node_modules | ||||
package-lock.json | package-lock.json | ||||
/frontend/dist/ | /frontend/dist/ | ||||
/backend/server.pem | |||||
@@ -0,0 +1,7 @@ | |||||
import BaseHTTPServer, SimpleHTTPServer | |||||
import ssl | |||||
httpd = BaseHTTPServer.HTTPServer(('0.0.0.0', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler) | |||||
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='/pstore/home/adaszews/workspace/arvados-workbench-advanced/backend/server.pem', server_side=True) | |||||
httpd.serve_forever() | |||||
@@ -1,8 +1,12 @@ | |||||
{ | { | ||||
"dependencies": { | "dependencies": { | ||||
"bootstrap": "^4.4.1", | |||||
"jquery": "^3.4.1", | |||||
"linkstate": "^1.1.1", | "linkstate": "^1.1.1", | ||||
"popper.js": "^1.16.1", | |||||
"preact": "^8.2.9", | "preact": "^8.2.9", | ||||
"preact-router": "^2.6.1", | "preact-router": "^2.6.1", | ||||
"random-bytes": "^1.0.0", | |||||
"rollup": "^0.62.0", | "rollup": "^0.62.0", | ||||
"rollup-plugin-buble": "^0.19.2", | "rollup-plugin-buble": "^0.19.2", | ||||
"rollup-plugin-copy": "^0.2.3", | "rollup-plugin-copy": "^0.2.3", | ||||
@@ -10,17 +10,19 @@ export default { | |||||
input: 'src/js/index.js', | input: 'src/js/index.js', | ||||
output: { | output: { | ||||
file: 'dist/js/app.min.js', | file: 'dist/js/app.min.js', | ||||
name: 'CHEMTOP', | |||||
name: 'WBADV', | |||||
format: 'umd', | format: 'umd', | ||||
sourceMap: true | sourceMap: true | ||||
}, | }, | ||||
plugins: [ | plugins: [ | ||||
includePaths({ | includePaths({ | ||||
paths: ['src/js', 'src/js/widget', 'src/js/misc'] | |||||
paths: ['src/js', 'src/js/widget', 'src/js/misc', 'src/js/component'] | |||||
}), | }), | ||||
copy({ | copy({ | ||||
'src/html/index.html': 'dist/index.html', | 'src/html/index.html': 'dist/index.html', | ||||
'src/css/index.css': 'dist/css/index.css', | 'src/css/index.css': 'dist/css/index.css', | ||||
'node_modules/bootstrap/dist/css/bootstrap.min.css': 'dist/css/bootstrap.min.css', | |||||
'node_modules/bootstrap/dist/js/bootstrap.min.js': 'dist/js/bootstrap.min.js', | |||||
verbose: true | verbose: true | ||||
}), | }), | ||||
buble({jsx: 'h'}), | buble({jsx: 'h'}), | ||||
@@ -0,0 +1,10 @@ | |||||
<html> | |||||
<head> | |||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |||||
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" /> | |||||
<script language="javascript" src="/js/bootstrap.min.js"></script> | |||||
</head> | |||||
<body> | |||||
<script language="javascript" src="/js/app.min.js"></script> | |||||
</body> | |||||
</html> |
@@ -0,0 +1,45 @@ | |||||
import { h, Component } from 'preact'; | |||||
import WBTabs from 'wb-tabs'; | |||||
class WBApp extends Component { | |||||
render() { | |||||
return ( | |||||
<div> | |||||
<h1>WBApp</h1> | |||||
<table class="table table-striped table-hover"> | |||||
<thead class="thead-light"> | |||||
<tr> | |||||
<th>Name</th> | |||||
<th>Description</th> | |||||
<th>Size</th> | |||||
</tr> | |||||
</thead> | |||||
<tbody> | |||||
<tr> | |||||
<td>Name</td> | |||||
<td>Description</td> | |||||
<td>0 bytes</td> | |||||
</tr> | |||||
<tr> | |||||
<td>Name</td> | |||||
<td>Description</td> | |||||
<td>0 bytes</td> | |||||
</tr> | |||||
<tr> | |||||
<td>Name</td> | |||||
<td>Description</td> | |||||
<td>0 bytes</td> | |||||
</tr> | |||||
</tbody> | |||||
</table> | |||||
<WBTabs tabs={ [ | |||||
{ 'name': 'Ala', 'isActive': true }, | |||||
"Ma", | |||||
{ 'name': 'Kota', 'isDisabled': true } | |||||
] } onTabChanged={ idx => alert(idx) } /> | |||||
</div> | |||||
); | |||||
} | |||||
} | |||||
export default WBApp; |
@@ -0,0 +1,6 @@ | |||||
import { h, render } from 'preact'; | |||||
import WBApp from 'wb-app'; | |||||
render(( | |||||
<WBApp /> | |||||
), document.body); |
@@ -0,0 +1,33 @@ | |||||
import { h, Component } from 'preact'; | |||||
class WBTabs extends Component { | |||||
render({ tabs, onTabChanged }) { | |||||
return ( | |||||
<ul class="nav nav-tabs"> | |||||
{ tabs.map((t, idx) => { | |||||
let name, isActive, isDisabled; | |||||
if (typeof(t) === 'object') { | |||||
name = t.name; | |||||
isActive = t.isActive; | |||||
isDisabled = t.isDisabled; | |||||
} else if (typeof(t) === 'string') { | |||||
name = t; | |||||
} | |||||
let cls = ['nav-link']; | |||||
if (isActive) | |||||
cls.push('active'); | |||||
if (isDisabled) | |||||
cls.push('disabled'); | |||||
cls = cls.join(' '); | |||||
return ( | |||||
<li class="nav-item"> | |||||
<a class={ cls } href="#" onclick={ () => onTabChanged(idx) }>{ name }</a> | |||||
</li> | |||||
); | |||||
}) } | |||||
</ul> | |||||
); | |||||
} | |||||
} | |||||
export default WBTabs; |