Skip to content

Commit

Permalink
support submission of branch input field
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenClontz committed Jul 23, 2024
1 parent 8dca075 commit e720e26
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions packages/viewer/src/components/Dev/Remote.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
const { source, sync } = context()
const status = state(sync)
let hostInput: HTMLInputElement
const updateHost = () => source.setHost(hostInput.value)
let branchInput: HTMLInputElement
const updateBranch = () => source.checkout(branchInput.value)
$: currentSha = $status?.sha
$: dataSource = bundle.bundleUrl({
branch: $source.branch,
Expand Down Expand Up @@ -37,30 +43,35 @@
</table>

<h4>Data</h4>
<p>
Using data hosted at <br/>
<small><a href={dataSource}><code>{dataSource}</code></a></small>
</p>
<table class="table">
<tr>
<th>Host</th>
<td>
<input
class="form-control"
value={$source.host}
on:blur={e => source.setHost(e.currentTarget.value)}
/>
<form on:submit={updateHost}>
<input
bind:this={hostInput}
class="form-control"
value={$source.host}
on:blur={updateHost}
/>
</form>
</td>
</tr>
<tr>
<th>Branch</th>
<td>
<p>
<form on:submit={updateBranch}>
<input
bind:this={branchInput}
class="form-control"
value={$source.branch}
on:blur={e => source.checkout(e.currentTarget.value)}
on:blur={updateBranch}
/>
</p>
<p>
Using data hosted at <a href={dataSource}><code>{dataSource}</code></a>
</p>
</form>
</td>
</tr>
<tr>
Expand Down

0 comments on commit e720e26

Please sign in to comment.