-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Empty ProjectManager with button to enter it * Some arrangement * Scrolling, unified project view * initial adventure/project implementation * Exclusive checkboxes with focus * iterate a bit on adventure data structure * Do checkbox better * tests, rename to projects, more implementation * Mostly focusing elemetns and css * Use panes and some other small changes * Move titles outside of content boxes * Use panes and some other things * Hookedup project creation to backend * Missed something * Add proper response to server routes * Use project given from server * Get scripts from server * Run a project, but resource view does not open automatically * Script runs on project start * Run project opens resource view * Accidentally deleted script element * Select any project from frontend * Can clone project from git * Little bit of startview css * Startview css and formatting things * Better toolbar * Back button, some fortmatting, css etc * Back buttons * Changeable project location, and some other things * check for existence of project dir, and only slurp it up when interacting with projects * disable project management buttons when inputs not populated * Remove package-lock.json * Add project metadata and save option * add frontend/backend support to list project scripts in RunScript dropdown * Added ability to delete files * see/change which scripts are associated with each binary * Hide project option if no project and add .trash when deleting * remove leading / * another leading slash * postmerge cleanups * remove unused imports * oops * Do mypy's bidding * make associated script checkboxes work with script reset * core init script functionality * removing debug print * refactor ProjectManagerCheckbox.svelte a bit, better styling * add some on-hover hints for checkboxes, rename "Run" to "Launch" * only show project options if experimental settings enabled * correct script options to binary options * Some tests for projects * save project test * test delete * test get project script * Test git clone * Test open project * linting * remove empty test, use HTTPS instead of git URLs, fix project id to session id * Changelog * frontend lint from merge conflict * update old project tests, fix minor bugs, use init script by default * finish renaming "adventure" to "project" * fix very dumb typo * remove dead code, refactor for test coverage * update changelog link and test coverage --------- Co-authored-by: Dan Pesce <[email protected]> Co-authored-by: edward <[email protected]> Co-authored-by: Dan Pesce <[email protected]> Co-authored-by: dannyp303 <[email protected]>
- Loading branch information
1 parent
cdfc1a5
commit ccb6e15
Showing
35 changed files
with
2,076 additions
and
30 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script> | ||
import Checkbox from "./Checkbox.svelte"; | ||
export let selectedValue, | ||
ownValue, | ||
leftbox = false, | ||
nomargin = false; | ||
let thisSelected; | ||
$: if (thisSelected) { | ||
selectedValue = ownValue; | ||
} | ||
</script> | ||
|
||
<Checkbox | ||
leftbox="{leftbox}" | ||
nomargin="{nomargin}" | ||
checked="{selectedValue === ownValue}" | ||
bind:value="{thisSelected}" | ||
> | ||
<slot /> | ||
</Checkbox> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
frontend/src/ProjectManager/ProjectManagerAddBinaryToProject.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<style> | ||
.add-file { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-around; | ||
} | ||
button { | ||
margin: 1em, 0; | ||
padding-top: 0.5em; | ||
padding-bottom: 0.5em; | ||
padding-left: 1em; | ||
padding-right: 1em; | ||
background-color: var(--main-bg-color); | ||
color: var(--main-fg-color); | ||
border: 1px solid var(--main-fg-color); | ||
border-radius: 0; | ||
font-size: smaller; | ||
overflow: hidden; | ||
box-shadow: none; | ||
} | ||
button:hover, | ||
button:focus { | ||
outline: none; | ||
box-shadow: inset 1px 1px 0 var(--main-fg-color), | ||
inset -1px -1px 0 var(--main-fg-color); | ||
} | ||
button:active { | ||
box-shadow: inset 2px 2px 0 var(--main-fg-color), | ||
inset -2px -2px 0 var(--main-fg-color); | ||
} | ||
</style> | ||
|
||
<script> | ||
import FileBrowser from "../FileBrowser.svelte"; | ||
import Icon from "../Icon.svelte"; | ||
import { selectedProject, settings } from "../stores"; | ||
let files, f; | ||
$: if (files) { | ||
f = files[0]; | ||
files = null; | ||
} | ||
async function addBinaryToProject() { | ||
await fetch( | ||
`${$settings.backendUrl}/add_binary_to_project?id=${$selectedProject.session_id}&name=${f.name}`, | ||
{ | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: await f.arrayBuffer(), | ||
} | ||
).then(async (r) => { | ||
if (!r.ok) { | ||
throw Error(JSON.stringify(await r.json(), undefined, 2)); | ||
} | ||
$selectedProject = await fetch( | ||
`${$settings.backendUrl}/get_project_by_id?id=${$selectedProject.session_id}` | ||
).then((r) => { | ||
if (!r.ok) { | ||
throw Error(r.statusText); | ||
} | ||
return r.json(); | ||
}); | ||
return await r.json(); | ||
}); | ||
} | ||
</script> | ||
|
||
<div class="add-file"> | ||
<FileBrowser bind:files="{files}" /> | ||
{#if f} | ||
<button on:click="{addBinaryToProject}" | ||
><Icon url="/icons/binary.svg" /> Add Binary to Project</button | ||
> | ||
{/if} | ||
</div> |
69 changes: 69 additions & 0 deletions
69
frontend/src/ProjectManager/ProjectManagerAddScriptToProject.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<style> | ||
.add-file { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-around; | ||
} | ||
button { | ||
margin: 1em, 0; | ||
padding-top: 0.5em; | ||
padding-bottom: 0.5em; | ||
padding-left: 1em; | ||
padding-right: 1em; | ||
background-color: var(--main-bg-color); | ||
color: var(--main-fg-color); | ||
border: 1px solid var(--main-fg-color); | ||
border-radius: 0; | ||
font-size: smaller; | ||
overflow: hidden; | ||
box-shadow: none; | ||
} | ||
</style> | ||
|
||
<script> | ||
import FileBrowser from "../FileBrowser.svelte"; | ||
import Icon from "../Icon.svelte"; | ||
import { selectedProject, settings } from "../stores"; | ||
let files, f; | ||
$: if (files) { | ||
f = files[0]; | ||
files = null; | ||
} | ||
async function addScriptToProject() { | ||
return await fetch( | ||
`${$settings.backendUrl}/add_script_to_project?id=${$selectedProject.session_id}&name=${f.name}`, | ||
{ | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: await f.arrayBuffer(), | ||
} | ||
).then(async (r) => { | ||
if (!r.ok) { | ||
throw Error(JSON.stringify(await r.json(), undefined, 2)); | ||
} | ||
$selectedProject = await fetch( | ||
`${$settings.backendUrl}/get_project_by_id?id=${$selectedProject.session_id}` | ||
).then((r) => { | ||
if (!r.ok) { | ||
throw Error(r.statusText); | ||
} | ||
return r.json(); | ||
}); | ||
return await r.json(); | ||
}); | ||
} | ||
</script> | ||
|
||
<div class="add-file"> | ||
<FileBrowser bind:files="{files}" /> | ||
{#if f} | ||
<button on:click="{addScriptToProject}" | ||
><Icon url="/icons/document.svg" /> Add Script to Project</button | ||
> | ||
{/if} | ||
</div> |
68 changes: 68 additions & 0 deletions
68
frontend/src/ProjectManager/ProjectManagerBinaryOptions.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<style> | ||
button { | ||
margin-bottom: 1em; | ||
margin-left: 1em; | ||
padding-top: 0.5em; | ||
padding-bottom: 0.5em; | ||
padding-left: 1em; | ||
padding-right: 1em; | ||
background-color: var(--main-bg-color); | ||
color: var(--main-fg-color); | ||
border: 1px solid var(--main-fg-color); | ||
border-radius: 0; | ||
font-size: smaller; | ||
overflow: hidden; | ||
box-shadow: none; | ||
} | ||
button:hover, | ||
button:focus { | ||
outline: none; | ||
box-shadow: inset 1px 1px 0 var(--main-fg-color), | ||
inset -1px -1px 0 var(--main-fg-color); | ||
} | ||
button:active { | ||
box-shadow: inset 2px 2px 0 var(--main-fg-color), | ||
inset -2px -2px 0 var(--main-fg-color); | ||
} | ||
</style> | ||
|
||
<script> | ||
import { selectedProject, settings, selected } from "../stores"; | ||
import Icon from "../Icon.svelte"; | ||
export let name; | ||
async function deleteBinary() { | ||
await fetch(`${$settings.backendUrl}/delete_binary_from_project`, { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify({ | ||
id: $selectedProject.session_id, | ||
binary: name, | ||
}), | ||
}).then(async (r) => { | ||
if (!r.ok) { | ||
throw Error(JSON.stringify(await r.json(), undefined, 2)); | ||
} | ||
$selectedProject = await fetch( | ||
`${$settings.backendUrl}/get_project_by_id?id=${$selectedProject.session_id}` | ||
).then((r) => { | ||
if (!r.ok) { | ||
throw Error(r.statusText); | ||
} | ||
return r.json(); | ||
}); | ||
return await r.json(); | ||
}); | ||
} | ||
</script> | ||
|
||
<div> | ||
<button on:click|stopPropagation="{deleteBinary}" | ||
><Icon url="/icons/trash.svg" />Delete {name} from project.</button | ||
> | ||
</div> |
Oops, something went wrong.