wip add and change password
+ changed on_click
This commit is contained in:
@@ -302,6 +302,13 @@ export class ChatController {
|
|||||||
const room_name = await this.chatService.getCurrentRoomName(req.user.username);
|
const room_name = await this.chatService.getCurrentRoomName(req.user.username);
|
||||||
const room = await this.chatService.getRoomByName(room_name);
|
const room = await this.chatService.getRoomByName(room_name);
|
||||||
const users = room.users;
|
const users = room.users;
|
||||||
|
|
||||||
|
let index = users.indexOf(req.user.username);
|
||||||
|
if (index > -1)
|
||||||
|
{
|
||||||
|
users.splice(index, 1);
|
||||||
|
}
|
||||||
|
|
||||||
res.status(HttpStatus.OK).json({ users: users });
|
res.status(HttpStatus.OK).json({ users: users });
|
||||||
printCaller("- out ");
|
printCaller("- out ");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<Button
|
<Button
|
||||||
bind:layout
|
bind:layout
|
||||||
new_layout=""
|
new_layout=""
|
||||||
on_click={}
|
|
||||||
my_class=""
|
my_class=""
|
||||||
my_title=""
|
my_title=""
|
||||||
>
|
>
|
||||||
@@ -17,7 +16,6 @@
|
|||||||
export let my_class = "";
|
export let my_class = "";
|
||||||
export let my_title = "";
|
export let my_title = "";
|
||||||
export let new_layout = "";
|
export let new_layout = "";
|
||||||
export let on_click = "";
|
|
||||||
|
|
||||||
function update_layout() {
|
function update_layout() {
|
||||||
layout.set(new_layout);
|
layout.set(new_layout);
|
||||||
@@ -25,7 +23,7 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button on:click={update_layout} on:click={on_click} title={my_title} class={my_class}>
|
<button on:click={update_layout} on:click title={my_title} class={my_class}>
|
||||||
<p><slot></slot></p>
|
<p><slot></slot></p>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
<p>rooms are loading...</p>
|
<p>rooms are loading...</p>
|
||||||
{:then rooms}
|
{:then rooms}
|
||||||
{#each rooms as room}
|
{#each rooms as room}
|
||||||
<Button my_class="list" on_click={function() {go_to_room(room)}}>
|
<Button my_class="list" on:click={function() {go_to_room(room)}}>
|
||||||
{room.client_name}
|
{room.client_name}
|
||||||
</Button>
|
</Button>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<p>users are loading...</p>
|
<p>users are loading...</p>
|
||||||
{:then users}
|
{:then users}
|
||||||
{#each users as user}
|
{#each users as user}
|
||||||
<Button my_class="list" on_click={function() {invite_this_user(user.username)}}>
|
<Button my_class="list" on:click={function() {invite_this_user(user.username)}}>
|
||||||
{user.username}
|
{user.username}
|
||||||
</Button>
|
</Button>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
<p>rooms are loading...</p>
|
<p>rooms are loading...</p>
|
||||||
{:then rooms}
|
{:then rooms}
|
||||||
{#each rooms as room}
|
{#each rooms as room}
|
||||||
<Button my_class="list" on_click={function() {join_rooms(room)}}>
|
<Button my_class="list" on:click={function() {join_rooms(room)}}>
|
||||||
{room.name}
|
{room.name}
|
||||||
</Button>
|
</Button>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- send -->
|
<!-- send -->
|
||||||
<Button my_class="send" on_click={send_msg}>
|
<Button my_class="send" on:click={send_msg}>
|
||||||
send
|
send
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,26 @@
|
|||||||
|
|
||||||
let users = get_room_users();
|
let users = get_room_users();
|
||||||
|
|
||||||
|
console.log("current_room:", $current_room);
|
||||||
|
|
||||||
|
function change_password()
|
||||||
|
{
|
||||||
|
console.log("in change_password");
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove_password()
|
||||||
|
{
|
||||||
|
console.log("in remove_password");
|
||||||
|
}
|
||||||
|
|
||||||
|
function add_password()
|
||||||
|
{
|
||||||
|
console.log("in add_password");
|
||||||
|
}
|
||||||
|
|
||||||
function user_profile()
|
function user_profile()
|
||||||
{
|
{
|
||||||
console/log("in user_profile");
|
console.log("in user_profile");
|
||||||
}
|
}
|
||||||
|
|
||||||
function user_leave_room()
|
function user_leave_room()
|
||||||
@@ -42,13 +59,26 @@
|
|||||||
<!-- panel_room_set -->
|
<!-- panel_room_set -->
|
||||||
<div class="panel panel_room_set __border_top">
|
<div class="panel panel_room_set __border_top">
|
||||||
{#if $current_room.type !== "direct"}
|
{#if $current_room.type !== "direct"}
|
||||||
<Button on_click={user_leave_room}>
|
<Button on:click={user_leave_room}>
|
||||||
leave
|
leave
|
||||||
</Button>
|
</Button>
|
||||||
<Button new_layout="invite">
|
<Button new_layout="invite">
|
||||||
invite someone
|
invite someone
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if $current_room.protection }
|
||||||
|
<p class="__center">this room is password protected</p>
|
||||||
|
<Button on:click={change_password}>
|
||||||
|
change password
|
||||||
|
</Button>
|
||||||
|
<Button on:click={remove_password}>
|
||||||
|
remove password
|
||||||
|
</Button>
|
||||||
|
{:else}
|
||||||
|
<Button on:click={add_password}>
|
||||||
|
add password
|
||||||
|
</Button>
|
||||||
|
{/if}
|
||||||
<p>room users :</p>
|
<p>room users :</p>
|
||||||
<div class="room_users">
|
<div class="room_users">
|
||||||
<div class="__show_if_only_child">
|
<div class="__show_if_only_child">
|
||||||
@@ -58,7 +88,7 @@
|
|||||||
<p>list of users is loading...</p>
|
<p>list of users is loading...</p>
|
||||||
{:then users}
|
{:then users}
|
||||||
{#each users as user}
|
{#each users as user}
|
||||||
<Button new_layout="user" my_class="list" on_click={user_profile}>
|
<Button new_layout="user" my_class="list" on:click={user_profile}>
|
||||||
{user}
|
{user}
|
||||||
</Button>
|
</Button>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
Reference in New Issue
Block a user