@@ -1,7 +1,15 @@ | |||||
import BaseHTTPServer, SimpleHTTPServer | import BaseHTTPServer, SimpleHTTPServer | ||||
import ssl | import ssl | ||||
httpd = BaseHTTPServer.HTTPServer(('0.0.0.0', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler) | |||||
class RequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |||||
def do_GET(self): | |||||
print(self.path) | |||||
if '.' not in self.path: | |||||
self.path = '/' | |||||
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) | |||||
# RequestHandler, self).do_GET() | |||||
httpd = BaseHTTPServer.HTTPServer(('0.0.0.0', 4443), RequestHandler) | |||||
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='/pstore/home/adaszews/workspace/arvados-workbench-advanced/backend/server.pem', server_side=True) | httpd.socket = ssl.wrap_socket (httpd.socket, certfile='/pstore/home/adaszews/workspace/arvados-workbench-advanced/backend/server.pem', server_side=True) | ||||
httpd.serve_forever() | httpd.serve_forever() | ||||
@@ -2,13 +2,11 @@ | |||||
"dependencies": { | "dependencies": { | ||||
"@fortawesome/fontawesome-free": "^5.12.0", | "@fortawesome/fontawesome-free": "^5.12.0", | ||||
"bootstrap": "^4.4.1", | "bootstrap": "^4.4.1", | ||||
"font-awesome": "^4.7.0", | |||||
"jquery": "^3.4.1", | "jquery": "^3.4.1", | ||||
"linkstate": "^1.1.1", | "linkstate": "^1.1.1", | ||||
"popper.js": "^1.16.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", | ||||
@@ -16,7 +16,7 @@ export default { | |||||
}, | }, | ||||
plugins: [ | plugins: [ | ||||
includePaths({ | includePaths({ | ||||
paths: ['src/js', 'src/js/widget', 'src/js/misc', 'src/js/component'] | |||||
paths: ['src/js', 'src/js/widget', 'src/js/misc', 'src/js/component', 'src/js/page'] | |||||
}), | }), | ||||
copy({ | copy({ | ||||
'src/html/index.html': 'dist/index.html', | 'src/html/index.html': 'dist/index.html', | ||||
@@ -1,37 +1,26 @@ | |||||
import { h, Component } from 'preact'; | import { h, Component } from 'preact'; | ||||
import { Router, route } from 'preact-router'; | |||||
import WBTabs from 'wb-tabs'; | import WBTabs from 'wb-tabs'; | ||||
import WBTable from 'wb-table'; | import WBTable from 'wb-table'; | ||||
import WBPagination from 'wb-pagination'; | import WBPagination from 'wb-pagination'; | ||||
import WBProjectListing from 'wb-project-listing'; | import WBProjectListing from 'wb-project-listing'; | ||||
import WBNavbar from 'wb-navbar'; | import WBNavbar from 'wb-navbar'; | ||||
import WBBrowse from 'wb-browse'; | |||||
class WBApp extends Component { | class WBApp extends Component { | ||||
render({}, { activePage }) { | render({}, { activePage }) { | ||||
return ( | return ( | ||||
<div> | |||||
<h1>WBApp <i class="fab fa-adobe"></i></h1> | |||||
<WBNavbar /> | |||||
<WBProjectListing arvHost="api.arkau.roche.com" | |||||
arvToken="v2/arkau-gj3su-uf4hnu2o2qkvm8j/15kla38mafzq6b31d5t74ynhk6iuy32v1ticslodr0obvvhde9" | |||||
itemsPerPage="5" /> | |||||
<WBPagination numPages={ 0 } activePage={ 0 } /> | |||||
<WBPagination numPages={ 100 } activePage={ activePage || 0 } | |||||
onPageChanged={ i => this.setState({ 'activePage': i }) } /> | |||||
<WBTable | |||||
columns={ [ 'Name', 'Description', 'Size' ] } | |||||
rows={ [ | |||||
[ 'Name', 'Description', '0 bytes'], | |||||
[ 'Name', 'Description', '0 bytes'], | |||||
[ 'Name', 'Description', '0 bytes'], | |||||
[ 'Name', 'Description', '0 bytes'], | |||||
[ 'Name', 'Description', '0 bytes'] | |||||
] } /> | |||||
<WBTabs tabs={ [ | |||||
{ 'name': 'Ala', 'isActive': true }, | |||||
"Ma", | |||||
{ 'name': 'Kota', 'isDisabled': true } | |||||
] } onTabChanged={ idx => alert(idx) } /> | |||||
</div> | |||||
<Router> | |||||
<div path="/"> | |||||
Hello, world! | |||||
</div> | |||||
<div path="/login"> | |||||
<WBNavbar /> | |||||
</div> | |||||
<WBBrowse path="/browse/:ownerUuid?" /> | |||||
</Router> | |||||
); | ); | ||||
} | } | ||||
} | } | ||||
@@ -29,7 +29,7 @@ class WBProjectListing extends Component { | |||||
let filters = [ | let filters = [ | ||||
[ 'group_class', '=', 'project' ] | [ 'group_class', '=', 'project' ] | ||||
]; | ]; | ||||
if (this.props.ownerUuid !== null) | |||||
if (this.props.ownerUuid) | |||||
filters.push([ 'owner_uuid', '=', this.props.ownerUuid ]); | filters.push([ 'owner_uuid', '=', this.props.ownerUuid ]); | ||||
let prom = makeArvadosRequest(this.props.arvHost, this.props.arvToken, | let prom = makeArvadosRequest(this.props.arvHost, this.props.arvToken, | ||||
'/arvados/v1/groups?filters=' + encodeURIComponent(JSON.stringify(filters)) + | '/arvados/v1/groups?filters=' + encodeURIComponent(JSON.stringify(filters)) + | ||||
@@ -0,0 +1,19 @@ | |||||
import { h, Component } from 'preact'; | |||||
import WBNavbar from 'wb-navbar'; | |||||
import WBProjectListing from 'wb-project-listing'; | |||||
class WBBrowse extends Component { | |||||
render({ ownerUuid }) { | |||||
return ( | |||||
<div> | |||||
<WBNavbar /> | |||||
<WBProjectListing arvHost="api.arkau.roche.com" | |||||
arvToken="v2/arkau-gj3su-uf4hnu2o2qkvm8j/15kla38mafzq6b31d5t74ynhk6iuy32v1ticslodr0obvvhde9" | |||||
ownerUuid={ ownerUuid } | |||||
itemsPerPage="5" /> | |||||
</div> | |||||
); | |||||
} | |||||
} | |||||
export default WBBrowse; |