Files
582ce0c923 app/vmalert: upgraded bootstrap, removed jquery, fixed collapse issues (#8750)
### Describe Your Changes

upgraded bootstrap, removed jquery, fixed UI collapse issues in vmalert
UI

<img width="967" alt="image"
src="https://github.com/user-attachments/assets/adcd0a74-fd33-4ec6-b2ee-9e642bcf8425"
/>
<img width="528" alt="image"
src="https://github.com/user-attachments/assets/ecf4f1f7-ec05-4d01-a423-516076cb3d30"
/>


### Checklist

The following checks are **mandatory**:

- [ ] My change adheres to [VictoriaMetrics contributing
guidelines](https://docs.victoriametrics.com/contributing/).

---------

Signed-off-by: hagen1778 <[email protected]>
Co-authored-by: Roman Khavronenko <[email protected]>
2025-04-29 11:46:18 +02:00

25 lines
478 B
Go

package vmalertutil
import (
"net/url"
"strings"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver"
)
const prefix = "/vmalert/"
// Prefix returns "/vmalert/" prefix if it is missing in the path.
func Prefix(path string) string {
pp := strings.TrimRight(httpserver.GetPathPrefix(), "/")
path = strings.TrimLeft(path, pp)
if strings.HasPrefix(path, prefix) {
return pp
}
res, err := url.JoinPath(pp, prefix)
if err != nil {
return path
}
return res
}