Commit 60cb4238 authored by MaxSol1's avatar MaxSol1
Browse files

create id

parent 1ac43886
...@@ -57,9 +57,16 @@ func handleCreateTemplate(w http.ResponseWriter, r *http.Request) { ...@@ -57,9 +57,16 @@ func handleCreateTemplate(w http.ResponseWriter, r *http.Request) {
log.Printf("Error compiling regex: %w", err.Error()) log.Printf("Error compiling regex: %w", err.Error())
} }
regID, err := regexp.Compile(`"([^"]*)"`)
if err != nil {
log.Printf("Error compiling regex: %w", err.Error())
}
if r.URL.Query().Get(sqs) != "" { if r.URL.Query().Get(sqs) != "" {
dashboardX.Elements[i].Options.Filter = reg.ReplaceAllString(dashboardX.Elements[i].Options.Filter, r.URL.Query().Get(sqs)) dashboardX.Elements[i].Options.Filter = reg.ReplaceAllString(dashboardX.Elements[i].Options.Filter, r.URL.Query().Get(sqs))
dashboardX.Elements[i].Options.ID = reg.ReplaceAllString(dashboardX.Elements[i].Options.ID, r.URL.Query().Get(sqs))
dashboardX.Elements[i].Options.ID = strings.Trim(regID.FindString(dashboardX.Elements[i].Options.Filter), "\"")
} }
} }
} }
......
...@@ -51,6 +51,7 @@ export function CheckCard({options, slug, dashboard}) { ...@@ -51,6 +51,7 @@ export function CheckCard({options, slug, dashboard}) {
setPerfData(null); setPerfData(null);
} }
}); });
meerkat.getDashboard(slug).then(async d => { meerkat.getDashboard(slug).then(async d => {
dash = await d dash = await d
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment