diff --git a/ts/Manager/App.tsx b/ts/Manager/App.tsx index aee0041..b7f32cc 100644 --- a/ts/Manager/App.tsx +++ b/ts/Manager/App.tsx @@ -5,7 +5,7 @@ import { SortArrow } from './SortArrow'; import { api, Room, Restriction, Access } from '../Common/Api'; import NewRoomForm from './NewRoomForm'; -export type SortKey = 'name' | 'welcome' | 'maxParticipants' | 'record'; +export type SortKey = 'name' | 'welcome' | 'maxParticipants' | 'record' | 'access'; enum SortOrder { DESC = -1, ASC = 1 } @@ -14,6 +14,7 @@ function sortRooms(key: SortKey, orderBy: SortOrder) { switch (key) { case 'name': case 'welcome': + case 'access': return a[key].localeCompare(b[key]) * orderBy; case 'maxParticipants': return (a.maxParticipants - b.maxParticipants) * orderBy; @@ -136,6 +137,9 @@ const App: React.FC = () => { {t('bbb', 'Name')} + onOrderBy('access')} className="bbb-shrink"> + {t('bbb', 'Access')} + onOrderBy('maxParticipants')} className="bbb-shrink"> {t('bbb', 'Max')} diff --git a/ts/Manager/RoomRow.tsx b/ts/Manager/RoomRow.tsx index 30532f7..2ae4c0e 100644 --- a/ts/Manager/RoomRow.tsx +++ b/ts/Manager/RoomRow.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import { CopyToClipboard } from 'react-copy-to-clipboard'; -import { api, Recording, Room, Restriction } from '../Common/Api'; +import { api, Recording, Room, Restriction, Access } from '../Common/Api'; import EditRoom from './EditRoom'; import RecordingRow from './RecordingRow'; import EditableValue from './EditableValue'; @@ -34,8 +34,6 @@ const RecordingsNumber: React.FC = ({ recordings, showRec return 0; }; - - const RoomRow: React.FC = (props) => { const [recordings, setRecordings] = useState(null); const [showRecordings, setShowRecordings] = useState(false); @@ -155,6 +153,23 @@ const RoomRow: React.FC = (props) => { ); } + function accessToIcon(access: string) { + switch(access) { + case Access.Public: + return ; + case Access.Password: + return ; + case Access.Internal: + return ; + case Access.InternalRestricted: + return ; + case Access.WaitingRoom: + return ; + } + + return ; + } + function edit(field: string, type: 'text' | 'number' = 'text', options?) { return ; } @@ -189,6 +204,9 @@ const RoomRow: React.FC = (props) => { {room.userId !== OC.currentUser && Avatar} {(room.userId === OC.currentUser && room.shared) && } + + {accessToIcon(room.access)} + {edit('maxParticipants', 'number', {min: minParticipantsLimit, max: maxParticipantsLimit < 0 ? undefined : maxParticipantsLimit})}