few fixes

add-admin-interface
adb 4 years ago
parent f7ee0d9695
commit b2691f0c85

@ -9,7 +9,6 @@
<div class="users">{{getMembers().length}} members</div> <div class="users">{{getMembers().length}} members</div>
</div> </div>
</div> </div>
<h2 v-if="getMembers().length !== 0">members:</h2>
<div v-for="member in getMembers().slice(0,20)" :key="member" class="contentBox" :title="member"> <div v-for="member in getMembers().slice(0,20)" :key="member" class="contentBox" :title="member">
<userThumbnail <userThumbnail
:mxcURL="getUser(member).avatarUrl" :mxcURL="getUser(member).avatarUrl"
@ -68,6 +67,7 @@ export default {
box-shadow: 6px 6px 20px #111; box-shadow: 6px 6px 20px #111;
border-radius: 1rem; border-radius: 1rem;
text-align: center; text-align: center;
z-index: 30;
} }
@media (max-width: 30rem) { @media (max-width: 30rem) {
#chatInformation{ #chatInformation{

@ -38,7 +38,6 @@ export default {
async sendMessage(){ async sendMessage(){
let content = this.msg.content; let content = this.msg.content;
if (!content.body) return; if (!content.body) return;
//content.body = content.body.replace(/\n$/gm, '');
let msgSend = Object.assign({}, this.msg); let msgSend = Object.assign({}, this.msg);
await matrix.sendEvent(msgSend, this.roomId); await matrix.sendEvent(msgSend, this.roomId);
content.body = ""; content.body = "";

@ -20,7 +20,7 @@ export default {
height: 8rem; height: 8rem;
width: 8rem; width: 8rem;
background-color: #1d1d1d; background-color: #1d1d1d;
box-shadow: 6px 6px 20px #111; box-shadow: 6px 6px 10px #111;
border-radius: 2rem; border-radius: 2rem;
.icon{ .icon{
position: absolute; position: absolute;

@ -93,7 +93,7 @@ export default {
.date { .date {
top: 0.25rem; top: 0.25rem;
position: sticky; position: sticky;
z-index: 100; z-index: 10;
background-color: #2d2d2d; background-color: #2d2d2d;
padding: 0.5rem; padding: 0.5rem;
border-radius: 0.5rem; border-radius: 0.5rem;

@ -14,7 +14,7 @@ export class MatrixHandler {
if (this.client){ console.log('there is already an active session'); return; } if (this.client){ console.log('there is already an active session'); return; }
this.client = new matrix.createClient({ this.client = new matrix.createClient({
baseUrl: baseUrl, baseUrl: baseUrl,
sessionStore: new matrix.WebStorageSessionStore(window.localStorage) sessionStore: new matrix.WebStorageSessionStore(localStorage)
}); });
this.client.login('m.login.password', { this.client.login('m.login.password', {
user: user, user: user,
@ -45,7 +45,7 @@ export class MatrixHandler {
baseUrl, baseUrl,
accessToken, accessToken,
userId, userId,
sessionStore: new matrix.WebStorageSessionStore(window.localStorage) sessionStore: new matrix.WebStorageSessionStore(localStorage)
}); });
this.user = userId; this.user = userId;
this.baseUrl = baseUrl; this.baseUrl = baseUrl;
@ -70,7 +70,7 @@ export class MatrixHandler {
const msgSend = { const msgSend = {
type: msg.type, type: msg.type,
content: { content: {
body: msg.content.body, body: msg.content.body.trim(),
msgtype: msg.content.msgtype, msgtype: msg.content.msgtype,
}, },
}; };

@ -79,10 +79,7 @@ export default {
getPreviewString(room){ getPreviewString(room){
let event = this.getLatestEvent(room); let event = this.getLatestEvent(room);
if (!event) return ''; if (!event) return '';
let text = event.content.body return `${this.calcUserName(event.sender)}: ${event.content.body||'unknown event'} ${getTime(event.origin_server_ts)}`;
? event.content.body.length>20?event.content.body.substr(0,19)+'…':event.content.body
: 'unknown event';
return `${this.calcUserName(event.sender)}: ${text} ${getTime(event.origin_server_ts)}`;
}, },
calcUserName(userId) { calcUserName(userId) {
@ -114,6 +111,7 @@ export default {
background-color: #222; background-color: #222;
text-align: center; text-align: center;
overflow-y: auto; overflow-y: auto;
z-index: 20;
} }
.chat{ .chat{
position: absolute; position: absolute;
@ -135,6 +133,10 @@ export default {
position: absolute; position: absolute;
left: 4rem; left: 4rem;
top: 0.25rem; top: 0.25rem;
text-overflow: ellipsis;
white-space: nowrap;
width: calc(100% - 5rem);
text-align: left;
} }
.preview{ .preview{
position: absolute; position: absolute;
@ -142,6 +144,10 @@ export default {
left: 4rem; left: 4rem;
font-size: 0.8rem; font-size: 0.8rem;
text-align: left; text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
width: calc(100% - 4.5rem);
} }
.roomListSmall{ .roomListSmall{
position: absolute; position: absolute;
@ -157,6 +163,7 @@ export default {
animation: ease; animation: ease;
animation-duration: 0.2s; animation-duration: 0.2s;
scrollbar-width: none; scrollbar-width: none;
z-index: 20;
} }
.roomListSmall:hover{ .roomListSmall:hover{
width: 18rem; width: 18rem;

Loading…
Cancel
Save