Skip to content

Commit 36d85b2

Browse files
authored
Merge pull request #7 from acceleratedscience/wip
Wip
2 parents 4a7f691 + f797f66 commit 36d85b2

12 files changed

Lines changed: 64 additions & 25 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- Describe build process and post build script to rename index.html -->
2+
13
# OpenAD GUI
24

35
_Open Accelerated Discovery Graphical User Interface_

index-build.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<base href="/__BASE_PATH__/" />
5+
<script>
6+
window.dynamicBasePath = '/__BASE_PATH__/' // Vue router links
7+
</script>
8+
<meta charset="UTF-8" />
9+
<link rel="icon" href="favicon.ico" />
10+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
11+
<script src="rdkit/RDKit_minimal.js"></script>
12+
<title>OMGUI</title>
13+
</head>
14+
<body>
15+
<div id="app"></div>
16+
<script type="module" src="src/main.ts"></script>
17+
</body>
18+
</html>

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!doctype html>
22
<html lang="en">
33
<head>
4-
<base href="/__BASE_PATH__/" />
4+
<base href="" />
55
<script>
6-
window.dynamicBasePath = '/__BASE_PATH__/' // Vue router links
6+
window.dynamicBasePath = '' // Vue router links
77
</script>
88
<meta charset="UTF-8" />
99
<link rel="icon" href="favicon.ico" />

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "run-p type-check build-vite",
8+
"build": "run-p type-check build-vite && mv dist/index-build.html dist/index.html",
99
"build-vite": "vite build",
1010
"preview": "vite preview",
1111
"test:unit": "vitest",

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const isRawPath = computed(() => {
120120
121121
// Store the name of your current workspace.
122122
if (fileSystemApi) {
123-
fileSystemApi.getWorkspace().then((result: { data: string; status: number; statusText: string }) => {
123+
fileSystemApi.getWorkspaceName().then((result: { data: string; status: number; statusText: string }) => {
124124
if (result.status != 200) {
125125
console.error('Failed to get workspace name:', result.statusText)
126126
return

src/api/segments/FileSystemApi.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,36 @@ export default class FileSystemApi extends BaseApi {
99
//
1010
//
1111

12-
// Get the list of workspaces.
12+
// Get the list of workspaces
1313
getWorkspaces() {
1414
return this.apiClient.get('/get-workspaces')
1515
}
1616

17-
// Get the name of the active workspace.
18-
getWorkspace() {
19-
return this.apiClient.get('/get-workspace')
17+
// Get the name of the active workspace
18+
getWorkspaceName() {
19+
return this.apiClient.get('/get-workspace-name')
2020
}
2121

2222
setWorkspace(workspace: string) {
2323
return this.apiClient.post('/set-workspace', { workspace })
2424
}
2525

26-
// Get list of files in workspace or workspace directory.
27-
getWorkspaceFiles(path: string = '') {
28-
return this.apiClient.post('/get-workspace-files', { path })
26+
// Get list of files in workspace directory
27+
getFiles(path: string = '') {
28+
return this.apiClient.post('/get-files', { path })
2929
}
3030

31-
// Get file content from path.
31+
// Get file content from path
3232
getFile(path: string = '', query: LocationQuery = {}) {
3333
return this.apiClient.post('/get-file', { path, query })
3434
}
3535

36-
// Open a file in its OS application.
36+
// Open a file in its OS application
3737
openFileOS(path_absolute: string = '') {
3838
return this.apiClient.post('/open-file-os', { path_absolute })
3939
}
4040

41-
// Delete a file.
41+
// Delete a file
4242
deleteFile(path_absolute: string = '') {
4343
return this.apiClient.post('/delete-file', { path_absolute })
4444
}

src/assets/main.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,20 @@ details[open] summary h4 {
158158
*/
159159

160160
// Code
161-
span.code {
161+
code,
162+
span.code { // todo: get rid of span.code and use code blocks instead
162163
background: $extra-soft-bg;
163164
border: solid 1px $black-10;
164165
border-radius: 2px;
165166
padding: 0 5px;
166167
font-family: 'IBM Plex Mono', monospace;
167168
font-style: normal;
168169
}
170+
code.block {
171+
display: block;
172+
padding: 10px 5px;
173+
white-space: pre-wrap;
174+
}
169175

170176
/**
171177
* Settings Panel

src/components/TheNav.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<nav :class="{ inverse }">
33
<div class="brand">
4-
<div class="main">% OpenAD</div>
4+
<div class="main">omgui</div>
55
<!-- <div class="title">Workspace</div> -->
66
</div>
77
<div class="filler"></div>

src/pages/MoleculeWorkingSet.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
<template v-else>
88
<template v-if="empty">
99
<p>You haven't saved any molecules yet.</p>
10-
<p>To add molecules to your working set, click the bookmark icon on a molecule, or run in your terminal:</p>
11-
<span class="code" style="margin-top: 8px; display: inline-block">add molecule &lt;identifier&gt;</span><br />
10+
<p>To add molecules to your working set, click the <BaseIcon icon="icn-bookmark" style="margin-bottom: -4px" /> bookmark icon on a molecule, or run:</p>
11+
<code class="block">
12+
import omgui<br>
13+
<br>
14+
omgui.add_mol(&lt;identifier&gt;)
15+
</code>
1216
</template>
1317
<div v-else id="about-msg">
1418
This is your working set of molecules, it is cleared at the end of your session.<br />
@@ -52,7 +56,8 @@ onMounted(() => {
5256
const query = molGridStore._setUrlQuery()
5357
apiFetch(moleculesApi.getMolset_mws(query), {
5458
onSuccess: (data) => {
55-
if (data == 'empty') {
59+
console.log(data)
60+
if (!data) {
5661
empty.value = true
5762
} else {
5863
molGridStore.setMolset(data)
@@ -79,4 +84,8 @@ h3 svg {
7984
#about-msg {
8085
margin-bottom: 16px;
8186
}
87+
code.block {
88+
margin-top: 20px;
89+
max-width: 400px;
90+
}
8291
</style>

src/viewers/FileBrowser.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ function deselectCol(level: number) {
382382
// Return structured content of a directory.
383383
async function fetchWorkspaceFiles(path = '') {
384384
if (!fileSystemApi) return
385-
const { status, data, statusText } = await fileSystemApi.getWorkspaceFiles(path)
385+
const { status, data, statusText } = await fileSystemApi.getFiles(path)
386386
if (status !== 200) {
387387
console.error(statusText)
388388
return

0 commit comments

Comments
 (0)