diff --git a/core/src/handlers/users.rs b/core/src/handlers/users.rs
index f3a94f93..f6fe68c2 100644
--- a/core/src/handlers/users.rs
+++ b/core/src/handlers/users.rs
@@ -207,7 +207,7 @@ pub async fn change_password(
let requester = users_manager.try_auth_or_err(&token)?;
- if requester.uid != config.uid || !requester.can_perform_action(&UserAction::ManageUser) {
+ if requester.uid != config.uid && !requester.can_perform_action(&UserAction::ManageUser) {
return Err(Error {
kind: ErrorKind::PermissionDenied,
source: eyre!("You are not authorized to change other users password"),
diff --git a/dashboard/src/components/Atoms/NotificationCard.tsx b/dashboard/src/components/Atoms/NotificationCard.tsx
index a9482b1f..c29422b3 100644
--- a/dashboard/src/components/Atoms/NotificationCard.tsx
+++ b/dashboard/src/components/Atoms/NotificationCard.tsx
@@ -51,14 +51,14 @@ export default function NotificationCard({
>
+
{title}
-+
{message}
- {!message && ( - + {!message && ( + {formatNotificationTime(timestamp)} )} diff --git a/dashboard/src/components/GameConsole.tsx b/dashboard/src/components/GameConsole.tsx index d33ae6d8..67f2f405 100644 --- a/dashboard/src/components/GameConsole.tsx +++ b/dashboard/src/components/GameConsole.tsx @@ -1,17 +1,19 @@ import { faCircle, faServer } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import axios from 'axios'; -import { useConsoleStream } from 'data/ConsoleStream'; +import { ConsoleEvent, useConsoleStream } from 'data/ConsoleStream'; import { InstanceContext } from 'data/InstanceContext'; import { CommandHistoryContext } from 'data/CommandHistoryContext'; import { useUserAuthorized } from 'data/UserInfo'; import Tooltip from 'rc-tooltip'; import { useContext, useEffect } from 'react'; import { useRef, useState } from 'react'; -import { usePrevious } from 'utils/hooks'; +import { useLocalStorageQueryParam, usePrevious } from 'utils/hooks'; import { DISABLE_AUTOFILL } from 'utils/util'; import ErrorGraphic from './ErrorGraphic'; import { useDocumentTitle } from 'usehooks-ts'; +import Button from './Atoms/Button'; +import Checkbox from './Atoms/Checkbox'; const autoScrollThreshold = 10; @@ -24,8 +26,15 @@ export default function GameConsole() { 'can_access_instance_console', uuid ); - const { consoleLog, consoleStatus } = useConsoleStream(uuid); + const defaultFilters = { + "PlayerMessage": true, + "SystemMessage": true, + "InstanceOutput": true + } + const { consoleLog, consoleStatus, clearConsoleLog } = useConsoleStream(uuid); const [command, setCommand] = useState(''); + const [filter, setFilter] = useState(''); + const [regex, setRegex] = useState(true); const { commandHistory, appendCommandHistory } = useContext( CommandHistoryContext ); @@ -128,75 +137,117 @@ export default function GameConsole() { } }; + const filterMessage = (line: ConsoleEvent) => { + if (filter == '') return true; + if (regex) { + try { + const filterRegex = new RegExp(filter, "i"); + if (line.message.match(filterRegex)) return true; + } catch (e) { + console.log("regex invalid!!!"); + } + } else { + if (line.message.toLowerCase().indexOf(filter.toLowerCase()) != -1) return true; + } + return false; + } + + const checkRegex = (checked: boolean) => { + setRegex(checked) + } + return ( -- This user will start with no permissions. You can grant them - permissions later. -
{isSelf ? (