Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Profile #171

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4f1b807
Implement profile management and streamline configuration handling.
junhaoliao Dec 18, 2024
b000c50
Merge branch 'main' into profile
junhaoliao Jan 23, 2025
dbf3b4a
Merge remote-tracking branch 'yscope/main' into profile
junhaoliao Jan 26, 2025
54b7966
Define default profile beforehand.
junhaoliao Jan 26, 2025
46c3e18
Create ProfilesContextProvider
junhaoliao Jan 26, 2025
2361e39
Refactor settings to replace modal with sidebar panel.
junhaoliao Jan 29, 2025
337b86a
Merge remote-tracking branch 'yscope/main' into profile
junhaoliao Feb 3, 2025
cb13dd0
Remove ProfilesContext and integrate profile management into config u…
junhaoliao Feb 3, 2025
b6cc1a8
Add tooltip pointer-events:none to theme style overrides.
junhaoliao Feb 4, 2025
ce05f27
Refactor profile management and theme toggle components.
junhaoliao Feb 4, 2025
376dd8e
Update SettingsTabPanel behavior and UI state management.
junhaoliao Feb 4, 2025
73d1b3c
Support profile creation.
junhaoliao Feb 4, 2025
4dd5e2b
Remove force profile override when deleting a profile.
junhaoliao Feb 4, 2025
f580a1f
Add profile reload on settings apply.
junhaoliao Feb 7, 2025
39e97b8
Fix page size retrieval to properly convert stored value.
junhaoliao Feb 7, 2025
36503e2
Refactor settings tab panel layout and simplify logic.
junhaoliao Feb 7, 2025
50c5742
Add consistent spacing and dividers to SettingsTabPanel.
junhaoliao Feb 7, 2025
b1fa260
Adjust padding-right in CustomTabPanel styles.
junhaoliao Feb 7, 2025
6c9ceba
Refactor progress callback parameter in utility functions
junhaoliao Feb 7, 2025
a73c999
Replace axios with getJsonObjectFrom for JSON fetching.
junhaoliao Feb 7, 2025
58b07f6
Update kafka file path prefix.
junhaoliao Feb 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions public/profile-presets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"Athena": {
"config": {
"decoderOptions/formatString": "{ts:timestamp:YYYY-MM-DD HH\\:mm\\:ss.SSS} {level} [{thread}] {class}.{method}({file}:{line}): {message}",
"decoderOptions/logLevelKey": "level",
"decoderOptions/timestampKey": "ts",
"pageSize": 10000
},
"filePathPrefixes": [
"/prod/logging/athena"
],
"lastModificationTimestampMillis": 0
},
"Kafka": {
"config": {
"decoderOptions/formatString": "{d:timestamp} {p} {c}:{L} - {m}",
"decoderOptions/logLevelKey": "p",
"decoderOptions/timestampKey": "d",
"pageSize": 10000
},
"filePathPrefixes": [
"/prod/logging/up"
],
"lastModificationTimestampMillis": 1732881600000
},
"Test": {
"config": {
"decoderOptions/formatString": "{@timestamp} {log\\.level} {message}",
"decoderOptions/logLevelKey": "log.level",
"decoderOptions/timestampKey": "@timestamp",
"pageSize": 10000
},
"filePathPrefixes": [
"/test"
],
"lastModificationTimestampMillis": 1732881600000
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.sidebar-tab-panel {
padding: 0.75rem;
padding: 0.75rem !important;
padding-right: 0.5rem !important;
}

.sidebar-tab-panel-container {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import {
Button,
FormControl,
FormHelperText,
FormLabel,
ToggleButtonGroup,
useColorScheme,
} from "@mui/joy";
import type {Mode} from "@mui/system/cssVars/useCurrentColorScheme";

import DarkModeIcon from "@mui/icons-material/DarkMode";
import LightModeIcon from "@mui/icons-material/LightMode";

import {THEME_NAME} from "../../../../../typings/config";


/**
* Renders a theme selection field in the settings form.
*
* @return
*/
const ThemeSwitchField = () => {
const {setMode, mode} = useColorScheme();

return (
<FormControl>
<FormLabel>
Theme override
</FormLabel>
<ToggleButtonGroup
size={"sm"}
value={mode as string}
onChange={(__, newValue) => {
setMode(newValue as Mode);
}}
>
<Button
startDecorator={<LightModeIcon/>}
value={THEME_NAME.LIGHT}
>
Light
</Button>
<Button
startDecorator={<DarkModeIcon/>}
value={THEME_NAME.DARK}
>
Dark
</Button>
</ToggleButtonGroup>
<FormHelperText>
{`Current mode: ${mode}`}
</FormHelperText>
</FormControl>

);
};

export default ThemeSwitchField;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.settings-tab-container {
overflow: hidden;
display: flex;
flex-direction: column;
height: 100%;
}

.settings-options-container {

Check failure on line 8 in src/components/CentralContainer/Sidebar/SidebarTabs/SettingsTabPanel/index.css

View workflow job for this annotation

GitHub Actions / lint-check

Unexpected empty block
}
Loading
Loading