Skip to content

Commit 88e9e3c

Browse files
committed
app/vmui: revert 1affba3
Reason for revert: this functionality is non-trivial, so it needs additional maintenance efforts in the future. This functionality is non-core for VictoriaLogs web UI (aka 'nice to have feature'). It is already provided by vmalert web UI ( https://docs.victoriametrics.com/victoriametrics/vmalert/#web ). I doubt we'll have enough capacity for providing high-quiality maintenance for this functionality. It is better to revert it instead of providing half-baked functionality for our users. Updates #522 Updates VictoriaMetrics/VictoriaMetrics#8989 Updates #5
1 parent a2655c1 commit 88e9e3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+182
-3201
lines changed

app/vmui/Dockerfile-build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22-alpine3.22
1+
FROM node:20-alpine3.19
22

33
# Sets a custom location for the npm cache, preventing access errors in system directories
44
ENV NPM_CONFIG_CACHE=/build/.npm

app/vmui/packages/vmui/src/App.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import ExploreLogs from "./pages/ExploreLogs/ExploreLogs";
66
import LogsLayout from "./layouts/LogsLayout/LogsLayout";
77
import StreamContext from "./pages/StreamContext/StreamContext";
88
import router from "./router";
9-
import ExploreRules from "./pages/ExploreAlerts/ExploreRules";
10-
import ExploreNotifiers from "./pages/ExploreAlerts/ExploreNotifiers";
119
import "./constants/markedPlugins";
1210

1311
const App: FC = () => {
@@ -32,14 +30,6 @@ const App: FC = () => {
3230
path={router.streamContext}
3331
element={<StreamContext/>}
3432
/>
35-
<Route
36-
path={router.rules}
37-
element={<ExploreRules/>}
38-
/>
39-
<Route
40-
path={router.notifiers}
41-
element={<ExploreNotifiers/>}
42-
/>
4333
</Route>
4434
</Routes>
4535
)}

app/vmui/packages/vmui/src/api/explore-alerts.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

app/vmui/packages/vmui/src/components/Configurators/TimeRangeSettings/ExecutionControls/ExecutionControls.tsx

Lines changed: 68 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,7 @@ const delayOptions: AutoRefreshOption[] = [
3030
{ seconds: 7200, title: "2h" }
3131
];
3232

33-
interface ExecutionControlsProps {
34-
tooltip: string;
35-
useAutorefresh?: boolean;
36-
closeModal: () => void;
37-
}
38-
39-
export const ExecutionControls: FC<ExecutionControlsProps> = ({ tooltip, useAutorefresh, closeModal }) => {
33+
export const ExecutionControls: FC = () => {
4034
const { isMobile } = useDeviceDetect();
4135

4236
const dispatch = useTimeDispatch();
@@ -62,9 +56,6 @@ export const ExecutionControls: FC<ExecutionControlsProps> = ({ tooltip, useAuto
6256

6357
const handleUpdate = () => {
6458
dispatch({ type: "RUN_QUERY" });
65-
if (!useAutorefresh && isMobile) {
66-
closeModal();
67-
}
6859
};
6960

7061
useEffect(() => {
@@ -93,109 +84,84 @@ export const ExecutionControls: FC<ExecutionControlsProps> = ({ tooltip, useAuto
9384
"vm-execution-controls-buttons": true,
9485
"vm-execution-controls-buttons_mobile": isMobile,
9586
"vm-header-button": !appModeEnable,
96-
"vm-autorefresh": useAutorefresh,
9787
})}
9888
>
99-
{useAutorefresh ? (
100-
isMobile ? (
101-
<div
102-
className="vm-mobile-option"
103-
onClick={toggleOpenOptions}
104-
>
105-
<span className="vm-mobile-option__icon"><RestartIcon/></span>
106-
<div className="vm-mobile-option-text">
107-
<span className="vm-mobile-option-text__label">Auto-refresh</span>
108-
<span className="vm-mobile-option-text__value">{selectedDelay.title}</span>
109-
</div>
110-
<span className="vm-mobile-option__arrow"><ArrowDownIcon/></span>
111-
</div>
112-
) : (
113-
<>
114-
<Tooltip title={tooltip}>
115-
<Button
116-
variant="contained"
117-
color="primary"
118-
onClick={handleUpdate}
119-
startIcon={<RefreshIcon/>}
120-
ariaLabel={tooltip}
121-
/>
122-
</Tooltip>
123-
<Tooltip title="Auto-refresh control">
124-
<div ref={optionsButtonRef}>
125-
<Button
126-
variant="contained"
127-
color="primary"
128-
fullWidth
129-
endIcon={(
130-
<div
131-
className={classNames({
132-
"vm-execution-controls-buttons__arrow": true,
133-
"vm-execution-controls-buttons__arrow_open": openOptions,
134-
})}
135-
>
136-
<ArrowDownIcon/>
137-
</div>
138-
)}
139-
onClick={toggleOpenOptions}
140-
>
141-
{selectedDelay.title}
142-
</Button>
143-
</div>
144-
</Tooltip>
145-
</>
146-
)
147-
) : (
148-
isMobile ? (
149-
<div
150-
className="vm-mobile-option"
151-
onClick={handleUpdate}
152-
>
153-
<span className="vm-mobile-option__icon"><RestartIcon/></span>
154-
<div className="vm-mobile-option-text">
155-
<span className="vm-mobile-option-text__label">Refresh</span>
156-
</div>
157-
</div>
158-
) : (
89+
{!isMobile && (
90+
<Tooltip title="Refresh dashboard">
15991
<Button
16092
variant="contained"
16193
color="primary"
16294
onClick={handleUpdate}
16395
startIcon={<RefreshIcon/>}
164-
ariaLabel={tooltip}
96+
ariaLabel="refresh dashboard"
16597
/>
166-
)
98+
</Tooltip>
99+
)}
100+
{isMobile ? (
101+
<div
102+
className="vm-mobile-option"
103+
onClick={toggleOpenOptions}
104+
>
105+
<span className="vm-mobile-option__icon"><RestartIcon/></span>
106+
<div className="vm-mobile-option-text">
107+
<span className="vm-mobile-option-text__label">Auto-refresh</span>
108+
<span className="vm-mobile-option-text__value">{selectedDelay.title}</span>
109+
</div>
110+
<span className="vm-mobile-option__arrow"><ArrowDownIcon/></span>
111+
</div>
112+
) : (
113+
<Tooltip title="Auto-refresh control">
114+
<div ref={optionsButtonRef}>
115+
<Button
116+
variant="contained"
117+
color="primary"
118+
fullWidth
119+
endIcon={(
120+
<div
121+
className={classNames({
122+
"vm-execution-controls-buttons__arrow": true,
123+
"vm-execution-controls-buttons__arrow_open": openOptions,
124+
})}
125+
>
126+
<ArrowDownIcon/>
127+
</div>
128+
)}
129+
onClick={toggleOpenOptions}
130+
>
131+
{selectedDelay.title}
132+
</Button>
133+
</div>
134+
</Tooltip>
167135
)}
168136
</div>
169137
</div>
170-
{useAutorefresh && (
171-
<Popper
172-
open={openOptions}
173-
placement="bottom-right"
174-
onClose={handleCloseOptions}
175-
buttonRef={optionsButtonRef}
176-
title={isMobile ? "Auto-refresh duration" : undefined}
138+
<Popper
139+
open={openOptions}
140+
placement="bottom-right"
141+
onClose={handleCloseOptions}
142+
buttonRef={optionsButtonRef}
143+
title={isMobile ? "Auto-refresh duration" : undefined}
144+
>
145+
<div
146+
className={classNames({
147+
"vm-execution-controls-list": true,
148+
"vm-execution-controls-list_mobile": isMobile,
149+
})}
177150
>
178-
<div
179-
className={classNames({
180-
"vm-execution-controls-list": true,
181-
"vm-execution-controls-list_mobile": isMobile,
182-
})}
183-
>
184-
{delayOptions.map(d => (
185-
<div
186-
className={classNames({
187-
"vm-list-item": true,
188-
"vm-list-item_mobile": isMobile,
189-
"vm-list-item_active": d.seconds === selectedDelay.seconds
190-
})}
191-
key={d.seconds}
192-
onClick={createHandlerChange(d)}
193-
>
194-
{d.title}
195-
</div>
196-
))}
197-
</div>
198-
</Popper>
199-
)}
151+
{delayOptions.map(d => (
152+
<div
153+
className={classNames({
154+
"vm-list-item": true,
155+
"vm-list-item_mobile": isMobile,
156+
"vm-list-item_active": d.seconds === selectedDelay.seconds
157+
})}
158+
key={d.seconds}
159+
onClick={createHandlerChange(d)}
160+
>
161+
{d.title}
162+
</div>
163+
))}
164+
</div>
165+
</Popper>
200166
</>;
201167
};

app/vmui/packages/vmui/src/components/Configurators/TimeRangeSettings/ExecutionControls/style.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
display: flex;
88
justify-content: space-between;
99
border-radius: calc($button-radius + 1px);
10-
:is(.vm-autorefresh) {
11-
min-width: 107px;
12-
}
10+
min-width: 107px;
1311

1412
&_mobile {
1513
flex-direction: column;

app/vmui/packages/vmui/src/components/ExploreAlerts/Badges/index.tsx

Lines changed: 0 additions & 34 deletions
This file was deleted.

app/vmui/packages/vmui/src/components/ExploreAlerts/Badges/style.scss

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)