Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken device view and Improve manual ip address component #570

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/viewProviders/RokuDeviceViewViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export class RokuDeviceViewViewProvider extends BaseRdbViewProvider {
});
}
const result = await this.dependencies.rtaManager.device.getScreenshot();
this.createResponseMessage(message, {
this.postOrQueueMessage(this.createResponseMessage(message, {
success: true,
arrayBuffer: result.buffer.buffer
});
}));
} catch (e) {
this.postOrQueueMessage(this.createResponseMessage(message, {
success: false
Expand Down
30 changes: 21 additions & 9 deletions webviews/src/shared/OdcSetManualIpAddress.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<script lang="ts">
import { Save } from 'svelte-codicons';
import { ViewProviderCommand } from '../../../src/viewProviders/ViewProviderCommand';
import { intermediary } from '../ExtensionIntermediary';
import { utils } from '../utils';

let ipAddress = utils.getStorageValue('manuallySetIpAddress', '');
let password = utils.getStorageValue('manuallySetPassword', '');

function onSaveIpButtonClicked() {
function onIpAddressChange() {
ipAddress = this.value
utils.setStorageValue('manuallySetIpAddress', ipAddress);
}

function onPasswordChange() {
password = this.value
utils.setStorageValue('manuallySetPassword', password);
}

function onConnectClicked() {
intermediary.sendCommand(ViewProviderCommand.setManualIpAddress, {
host: ipAddress,
password: password
Expand All @@ -31,19 +38,24 @@
<label for="ipAddress">IP Address</label>
</td>
<td>
<input
<vscode-text-field
id="ipAddress"
class="fieldValue"
bind:value={ipAddress} />
</td>
<td rowspan="2">
<button on:click={onSaveIpButtonClicked}><Save />&nbsp;<b>Apply</b></button>
value={ipAddress}
on:input={onIpAddressChange} />
</td>
</tr>
<tr>
<td> <label for="password">Password</label></td>
<td>
<input id="password" class="fieldValue" bind:value={password} />
<vscode-text-field
id="password"
value={password}
on:input={onPasswordChange} />
</td>
</tr>
<tr>
<td colspan="2">
<vscode-button on:click={onConnectClicked}>Connect</vscode-button>
</td>
</tr>
</table>
Expand Down