-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from ferviddigital/release/0.4.1
Release/0.4.1
- Loading branch information
Showing
11 changed files
with
790 additions
and
324 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,35 @@ | ||
<script setup lang="ts"> | ||
import HeaderTitleCenter from './HeaderTitleCenter.vue'; | ||
defineProps<{ | ||
fields: FormField[], | ||
title: string | ||
}>(); | ||
const runUpdateCallback = (event: FocusEvent, field: FormField) => { | ||
if (!(event.target instanceof HTMLInputElement)) return; | ||
const newValue = event.target.value | ||
field.blurCallback(newValue) | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<HeaderTitleCenter :title="title" /> | ||
<div class="p-4"> | ||
<div class="rounded-xl bg-white divide-y overflow-hidden"> | ||
<div v-for="field in fields"> | ||
<input | ||
:type="field.type" | ||
:name="field.name" | ||
:placeholder="field.placeholder" | ||
:value="field.currentValue" | ||
class="border-none bg-none !ring-0 !p-3 !px-4 w-full" | ||
:class="field.classes" | ||
@blur="(event: FocusEvent) => runUpdateCallback(event, field)" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
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
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,36 @@ | ||
<script setup lang="ts"> | ||
import { record } from '../../store/record'; | ||
import EditFields from '../Interface/EditFields.vue'; | ||
const fields: FormField[] = [ | ||
{ | ||
name: 'signalServerUrl', | ||
placeholder: 'wss://signalserver.com', | ||
currentValue: record.value.user.preferences.webRTC.signalerUrl, | ||
type: 'url', | ||
classes: 'font-mono text-sm !p-4 !px-4', | ||
blurCallback: (newValue) => updateSignalServer(newValue), | ||
}, | ||
]; | ||
const validateSocketUrl = (urlString: string) => { | ||
try { | ||
const url = new URL(urlString); | ||
return url.protocol === 'ws:' || url.protocol === 'wss:'; | ||
} catch (error) { | ||
return false; | ||
} | ||
}; | ||
const updateSignalServer = (newUrl: string) => { | ||
if (validateSocketUrl(newUrl) || newUrl.length === 0) { | ||
record.value.user.preferences.webRTC.signalerUrl = newUrl; | ||
} else { | ||
alert('Signal Server URL is not valid.'); | ||
} | ||
}; | ||
</script> | ||
|
||
<template> | ||
<EditFields title="Signal Server URL" :fields="fields" /> | ||
</template> |
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,25 @@ | ||
<script setup lang="ts"> | ||
import { record } from '../../store/record'; | ||
import EditFields from '../Interface/EditFields.vue'; | ||
const fields: FormField[] = [ | ||
{ | ||
name: 'firstName', | ||
placeholder: 'First name', | ||
currentValue: record.value.user.firstName, | ||
type: 'text', | ||
blurCallback: (newValue) => record.value.user.firstName = newValue | ||
}, | ||
{ | ||
name: 'lastName', | ||
placeholder: 'Last name', | ||
currentValue: record.value.user.lastName, | ||
type: 'text', | ||
blurCallback: (newValue) => record.value.user.lastName = newValue | ||
}, | ||
]; | ||
</script> | ||
|
||
<template> | ||
<EditFields title="Owner" :fields="fields" /> | ||
</template> |
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,8 @@ | ||
interface FormField { | ||
name: string; | ||
type: string; | ||
placeholder?: string; | ||
currentValue?: string; | ||
classes?: string; | ||
blurCallback(newValue: string); | ||
} |
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