mirror of
https://github.com/Discreetly/frontend.git
synced 2026-05-04 03:00:34 -04:00
fix(create-room) changing text colors and updating server url, username, password
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { createRoom } from '$lib/services/server';
|
||||
import { getIdentity } from '$lib/utils';
|
||||
|
||||
import { selectedServer, configStore } from '$lib/stores'
|
||||
let formData = {
|
||||
roomName: '',
|
||||
membershipType: 'IDENTITY_LIST',
|
||||
@@ -24,16 +24,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSubmit (e: Event) {
|
||||
function handleSubmit (e: Event): void {
|
||||
e.preventDefault();
|
||||
// const {roomName, membershipType, rateLimit, messageLimit, claimCodes, roomType} = e.target as HTMLFormElement;
|
||||
console.log(formData);
|
||||
const identity = getIdentity();
|
||||
createRoom(
|
||||
'http://localhost:3001',
|
||||
$selectedServer,
|
||||
formData.roomName,
|
||||
'admin',
|
||||
'password',
|
||||
$configStore.apiUsername as string,
|
||||
$configStore.apiPassword as string,
|
||||
formData.rateLimit,
|
||||
formData.messageLimit,
|
||||
formData.claimCodes,
|
||||
@@ -52,14 +52,14 @@
|
||||
<h1 class="flex content-center font-bold">Create Room</h1>
|
||||
<form method="POST" on:submit|preventDefault={handleSubmit}
|
||||
class="grid gap-7">
|
||||
<label for="roomName">Room Name: <input bind:value={formData.roomName} name="roomName" type="text" /></label>
|
||||
<label for="roomName">Room Name: <input class="text-black" bind:value={formData.roomName} name="roomName" type="text" /></label>
|
||||
<label for="membershipType">
|
||||
Room Type:
|
||||
<select name="membershipType" bind:value={formData.membershipType} on:change={toggleBandadaFields}>
|
||||
<option value="IDENTITY_LIST">
|
||||
<select name="membershipType" class="text-black" bind:value={formData.membershipType} on:change={toggleBandadaFields}>
|
||||
<option value="IDENTITY_LIST" class="text-black">
|
||||
Identity List
|
||||
</option>
|
||||
<option value="BANDADA_GROUP">
|
||||
<option value="BANDADA_GROUP" class="text-black">
|
||||
Bandada Group
|
||||
</option>
|
||||
</select>
|
||||
@@ -67,36 +67,36 @@
|
||||
<div class="grid grid-flow-rows gap-5 my-5 max-w-md mx-auto">
|
||||
<label for="bandadaAddress">
|
||||
Bandada Address:
|
||||
<input name="bandadaAddress" type="text" bind:value={formData.bandadaAddress}/>
|
||||
<input name="bandadaAddress" type="text" class="text-black" bind:value={formData.bandadaAddress}/>
|
||||
</label>
|
||||
<label for="bandadaGroup">
|
||||
Bandada Group Id:
|
||||
<input name="bandadaGroup" type="text" bind:value={formData.bandadaGroupId}/>
|
||||
<input name="bandadaGroup" type="text" class="text-black"bind:value={formData.bandadaGroupId}/>
|
||||
</label>
|
||||
<label for='bandadaApiKey'>
|
||||
Bandada Api Key:
|
||||
<input name="bandadaApiKey" type="text" bind:value={formData.bandadaApiKey}/>
|
||||
<input name="bandadaApiKey" type="text" class="text-black" bind:value={formData.bandadaApiKey}/>
|
||||
</label>
|
||||
</div>
|
||||
{/if}
|
||||
</label>
|
||||
<label for="rateLimit">
|
||||
Rate Limit:
|
||||
<input name="rateLimit" type="number" bind:value={formData.rateLimit}/>
|
||||
<input name="rateLimit" class="text-black" type="number" bind:value={formData.rateLimit}/>
|
||||
</label>
|
||||
<label for="messageLimit">
|
||||
User Message Limit:
|
||||
<input name="messageLimit" type="number" bind:value={formData.messageLimit}/>
|
||||
<input name="messageLimit" class="text-black" type="number" bind:value={formData.messageLimit}/>
|
||||
</label>
|
||||
<label for="claimCodes">
|
||||
Claim Codes:
|
||||
<input name="claimCodes" type="number" bind:value={formData.claimCodes}/>
|
||||
<input name="claimCodes"class="text-black" type="number" bind:value={formData.claimCodes}/>
|
||||
</label>
|
||||
<label for="room-type">
|
||||
Room Type:
|
||||
<select name="roomType" bind:value={formData.roomType}>
|
||||
<option value="PUBLIC">Public</option>
|
||||
<option value="PRIVATE">Private</option>
|
||||
<select name="roomType" class="text-black" bind:value={formData.roomType}>
|
||||
<option value="PUBLIC" class="text-black">Public</option>
|
||||
<option value="PRIVATE" class="text-black">Private</option>
|
||||
</select>
|
||||
<br>
|
||||
<button>Create Room</button>
|
||||
|
||||
Reference in New Issue
Block a user