Admin support for managing users (#245)

* First pass at displaying user data in admin

* Hide chat blurb on home page if chat is disabled

* Hide sidebar chat section if chat is disabled

* Block/unblock user interface for https://github.com/owncast/owncast/issues/1096

* Simplify past display name handling

* Updates to reflect the api access token change

* Update paths

* Clean up the new access token page

* Fix linter

* Update linter workflow action

* Cleanup

* Fix exception rendering table row

* Commit next-env file that seems to be required with next 11

* chat refactor - admin adjustments (#250)

* add useragent parser; clean up some html;

* some ui changes
- use modal instead of popover to confirm block/unblock user
- update styles, table styles for consistency
- rename some user/chat labels in nav and content

* format user info modal a bit

* add some sort of mild treatment and delay while processing ban of users

* rename button to 'ban'

* add some notes

* Prettified Code!

* fix disableChat toggle for nav bar

* Support sorting the disabled user list

* Fix linter error around table sorting

* No longer restoring messages on unban so change message prompt

* Standardize on forbiddenUsername terminology

* The linter broke the webhooks page. Fixed it. Linter is probably pissed.

* Move chat welcome message to chat config

* Other submenus don't have icons so remove these ones

Co-authored-by: gingervitis <omqmail@gmail.com>
Co-authored-by: gabek <gabek@users.noreply.github.com>
This commit is contained in:
Gabe Kangas
2021-07-19 22:02:02 -07:00
committed by GitHub
parent 4aac80196d
commit b10ba1dcc2
26 changed files with 8007 additions and 238 deletions

View File

@@ -16,7 +16,6 @@ import {
QuestionCircleOutlined,
MessageOutlined,
ExperimentOutlined,
UserOutlined,
} from '@ant-design/icons';
import classNames from 'classnames';
import { upgradeVersionAvailable } from '../utils/apis';
@@ -36,7 +35,7 @@ export default function MainLayout(props) {
const context = useContext(ServerStatusContext);
const { serverConfig, online, broadcaster, versionNumber } = context || {};
const { instanceDetails } = serverConfig;
const { instanceDetails, chatDisabled } = serverConfig;
const [currentStreamTitle, setCurrentStreamTitle] = useState('');
@@ -78,8 +77,7 @@ export default function MainLayout(props) {
const upgradeMenuItemStyle = upgradeVersion ? 'block' : 'none';
const upgradeVersionString = `${upgradeVersion}` || '';
const upgradeMessage = `Upgrade to v${upgradeVersionString}`;
const chatMenuItemStyle = 'block'; // upgradeVersion ? 'block' : 'none';
const chatMenuItemStyle = chatDisabled ? 'none' : 'block';
const clearAlertMessage = () => {
alertMessage.setMessage(null);
@@ -129,7 +127,7 @@ export default function MainLayout(props) {
<Sider width={240} className="side-nav">
<Menu
defaultSelectedKeys={[route.substring(1) || 'home']}
defaultOpenKeys={['current-stream-menu', 'utilities-menu', 'configuration']}
defaultOpenKeys={[]}
mode="inline"
className="menu-container"
>
@@ -149,15 +147,15 @@ export default function MainLayout(props) {
<SubMenu
key="chat-config"
title="Chat"
title="Chat &amp; Users"
icon={<MessageOutlined />}
style={{ display: chatMenuItemStyle }}
>
<Menu.Item key="messages" icon={<MessageOutlined />} title="Chat utilities">
<Menu.Item key="messages" title="Chat utilities">
<Link href="/chat/messages">Messages</Link>
</Menu.Item>
<Menu.Item key="chat-users" icon={<UserOutlined />} title="Chat utilities">
<Menu.Item key="chat-users" title="Chat utilities">
<Link href="/chat/users">Users</Link>
</Menu.Item>
</SubMenu>