Skip to content

Commit

Permalink
Add block fetch logs by remote server
Browse files Browse the repository at this point in the history
  • Loading branch information
haimkastner committed Sep 9, 2022
1 parent 9f9ef44 commit 77f5f1c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { isValidUrl } from "../../../infrastructure/utils";
import { handleServerRestError } from "../../../services/notifications.service";
import { livelinessCheck } from "../../../services/liveliness.service";
import { ApiFacade } from "../../../infrastructure/generated/api/swagger/api";
import { ThemeSwitch } from "../../global/ThemeSwitch";
import InfoIcon from '@mui/icons-material/Info';

export function EditRemoteConnection() {
const { t } = useTranslation();
Expand All @@ -32,6 +34,8 @@ export function EditRemoteConnection() {

const [showRemoteKey, setShowRemoteKey] = useState<boolean>(false);

const [blockLogsFetchByRemote, setBlockLogsFetchByRemote] = useState<boolean>(false);

useEffect(() => {
(async () => {
try {
Expand Down Expand Up @@ -70,6 +74,7 @@ export function EditRemoteConnection() {
setSettingRemote(true);
try {
await ApiFacade.RemoteApi.setRemoteSettings({
blockLogsFetchByRemote,
host: editRemoteURL,
connectionKey: remoteKey,
});
Expand Down Expand Up @@ -162,6 +167,20 @@ export function EditRemoteConnection() {
}}
/>
</div>
<div style={{ margin: DEFAULT_FONT_RATION * 0.7, marginTop: DEFAULT_FONT_RATION * 0.1, display: 'flex' }}>
<span style={{ display: 'flex', marginTop: DEFAULT_FONT_RATION * 0.4}}>
{t('dashboard.settings.connectivity.edit.remote.allow.remote.to.fetch.logs')}
<ThemeTooltip title={<span>{t('dashboard.settings.connectivity.edit.remote.allow.remote.to.fetch.logs.tip')}</span>}>
<InfoIcon style={{ fontSize: DEFAULT_FONT_RATION * 0.8 }} />
</ThemeTooltip>
</span>
<ThemeSwitch
disabled={settingRemote}
checked={!blockLogsFetchByRemote}
onChange={() => setBlockLogsFetchByRemote(!blockLogsFetchByRemote)}
inputProps={{ 'aria-label': 'controlled' }}
/>
</div>
<div style={{ marginLeft: DEFAULT_FONT_RATION * 0.7, marginRight: DEFAULT_FONT_RATION * 0.7 }}>
<Grid
container
Expand Down
2 changes: 2 additions & 0 deletions src/localization/translations/en/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@
"dashboard.settings.connectivity.edit.remote.url.helper": "Remote server web-socket URL (ws protocol)",
"dashboard.settings.connectivity.edit.remote.key.placeholder": "The remote server connection key",
"dashboard.settings.connectivity.edit.remote.key.helper": "Authentication key ({{length}} characters)",
"dashboard.settings.connectivity.edit.remote.allow.remote.to.fetch.logs": "Allow remote server to fetch logs",
"dashboard.settings.connectivity.edit.remote.allow.remote.to.fetch.logs.tip": "Allow remote server to fetch logs for debugging issues, if you disable this, the remote server will not be allowed to access the local server logs",
"dashboard.settings.connectivity.disconnect.remote": "Disconnect from the remote server",
"dashboard.settings.connectivity.disconnect.remote.tip": "Disconnect the local server from the remote server",
"dashboard.settings.connectivity.disconnect.remote.button": "Disconnect",
Expand Down
2 changes: 2 additions & 0 deletions src/localization/translations/he/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@
"dashboard.settings.connectivity.edit.remote.url.helper": "כתובת השרת המרוחק בפרוטוקול WS",
"dashboard.settings.connectivity.edit.remote.key.placeholder": "מפתח החיבור לשרת המרוחק",
"dashboard.settings.connectivity.edit.remote.key.helper": "מפתח האימות ({{length}} תווים)",
"dashboard.settings.connectivity.edit.remote.allow.remote.to.fetch.logs": "אפשר לשרת המרוחק למשוך לוגים",
"dashboard.settings.connectivity.edit.remote.allow.remote.to.fetch.logs.tip": "אפשר לשרת המרוחק למשוך לוגים לצרכי תחקור בעיות, אם אינך מאפשר את זה, השרת המרוחק לא יכול למשוך לוגים מהשרת המקומי",
"dashboard.settings.connectivity.disconnect.remote": "התנתק מהשרת המרוחק",
"dashboard.settings.connectivity.disconnect.remote.tip": "נתק את השרת המקומי מהשרת המרוחק",
"dashboard.settings.connectivity.disconnect.remote.button": "התנתק",
Expand Down

0 comments on commit 77f5f1c

Please sign in to comment.