Merge branch 'master' into flip-the-de
commit
03dea79485
|
@ -17,9 +17,12 @@
|
|||
1. [#1179](https://github.com/influxdata/chronograf/pull/1179): Admin Databases Page will render a database without retention policies
|
||||
1. [#1128](https://github.com/influxdata/chronograf/pull/1128): No more ghost dashboards 👻
|
||||
1. [#1189](https://github.com/influxdata/chronograf/pull/1189): Clicking inside the graph header edit box will no longer blur the field. Use the Escape key for that behavior instead.
|
||||
1. [#1193](https://github.com/influxdata/chronograf/issues/1193): Fix no quoting of raw InfluxQL fields with function names
|
||||
1. [#1195](https://github.com/influxdata/chronograf/issues/1195): Chronograf was not redirecting with authentiation for Influx Enterprise Meta service
|
||||
1. [#1095](https://github.com/influxdata/chronograf/pull/1095): Make logout button display again
|
||||
1. [#1209](https://github.com/influxdata/chronograf/pull/1209): HipChat Kapacitor config now uses only the subdomain instead of asking for the entire HipChat URL.
|
||||
1. [#1219](https://github.com/influxdata/chronograf/pull/1219): Update query for default cell in new dashboard
|
||||
1. [#1206](https://github.com/influxdata/chronograf/issues/1206): Chronograf now proxies to kapacitors behind proxy using vhost correctly.
|
||||
|
||||
### Features
|
||||
1. [#1112](https://github.com/influxdata/chronograf/pull/1112): Add ability to delete a dashboard
|
||||
|
@ -30,6 +33,7 @@
|
|||
1. [#1113](https://github.com/influxdata/chronograf/issues/1113): Add Slack channel per Kapacitor alert.
|
||||
1. [#1095](https://github.com/influxdata/chronograf/pull/1095): Add new auth duration CLI option; add client heartbeat
|
||||
1. [#1168](https://github.com/influxdata/chronograf/issue/1168): Expand support for --basepath on some load balancers
|
||||
1. [#1221](https://github.com/influxdata/chronograf/issue/1221): More sensical Cell and Dashboard defaults
|
||||
|
||||
### UI Improvements
|
||||
1. [#1101](https://github.com/influxdata/chronograf/pull/1101): Compress InfluxQL responses with gzip
|
||||
|
|
|
@ -15,7 +15,7 @@ func Convert(influxQL string) (chronograf.QueryConfig, error) {
|
|||
}
|
||||
|
||||
raw := chronograf.QueryConfig{
|
||||
RawText: query.String(),
|
||||
RawText: influxQL,
|
||||
Fields: []chronograf.Field{},
|
||||
GroupBy: chronograf.GroupBy{
|
||||
Tags: []string{},
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package influx
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/influxdata/chronograf"
|
||||
)
|
||||
|
||||
func TestConvert(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
influxQL string
|
||||
want chronograf.QueryConfig
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "Test named count field",
|
||||
influxQL: `SELECT moving_average(mean("count"),14) FROM "usage_computed"."autogen".unique_clusters_by_day WHERE time > now() - 90d AND product = 'influxdb' group by time(1d)`,
|
||||
want: chronograf.QueryConfig{
|
||||
RawText: `SELECT moving_average(mean("count"),14) FROM "usage_computed"."autogen".unique_clusters_by_day WHERE time > now() - 90d AND product = 'influxdb' group by time(1d)`,
|
||||
Fields: []chronograf.Field{},
|
||||
Tags: map[string][]string{},
|
||||
GroupBy: chronograf.GroupBy{
|
||||
Tags: []string{},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := Convert(tt.influxQL)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("Convert() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
if !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("Convert() = %#v, want %#v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
|
@ -365,7 +365,7 @@ func (s *Service) NewDashboardCell(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
dash.Cells = append(dash.Cells, cell)
|
||||
if err := s.DashboardsStore.Update(ctx, dash); err != nil {
|
||||
msg := fmt.Sprintf("Error updating dashboard ID %d: %v", id, err)
|
||||
msg := fmt.Sprintf("Error adding cell %s to dashboard %d: %v", cid, id, err)
|
||||
Error(w, http.StatusInternalServerError, msg, s.Logger)
|
||||
return
|
||||
}
|
||||
|
@ -435,7 +435,7 @@ func (s *Service) RemoveDashboardCell(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
dash.Cells = append(dash.Cells[:cellid], dash.Cells[cellid+1:]...)
|
||||
if err := s.DashboardsStore.Update(ctx, dash); err != nil {
|
||||
msg := fmt.Sprintf("Error updating dashboard ID %d: %v", id, err)
|
||||
msg := fmt.Sprintf("Error removing cell %s from dashboard %d: %v", cid, id, err)
|
||||
Error(w, http.StatusInternalServerError, msg, s.Logger)
|
||||
return
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ func (s *Service) ReplaceDashboardCell(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
dash.Cells[cellid] = cell
|
||||
if err := s.DashboardsStore.Update(ctx, dash); err != nil {
|
||||
msg := fmt.Sprintf("Error updating dashboard ID %d: %v", id, err)
|
||||
msg := fmt.Sprintf("Error updating cell %s in dashboard %d: %v", cid, id, err)
|
||||
Error(w, http.StatusInternalServerError, msg, s.Logger)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -246,7 +246,7 @@ func Test_newDashboardResponse(t *testing.T) {
|
|||
{
|
||||
Command: "SELECT donors from hill_valley_preservation_society where time > '1985-10-25 08:00:00'",
|
||||
QueryConfig: chronograf.QueryConfig{
|
||||
RawText: "SELECT donors FROM hill_valley_preservation_society WHERE time > '1985-10-25 08:00:00'",
|
||||
RawText: "SELECT donors from hill_valley_preservation_society where time > '1985-10-25 08:00:00'",
|
||||
Fields: []chronograf.Field{},
|
||||
GroupBy: chronograf.GroupBy{
|
||||
Tags: []string{},
|
||||
|
|
|
@ -44,6 +44,9 @@ func (h *Service) KapacitorProxy(w http.ResponseWriter, r *http.Request) {
|
|||
u.Path = path
|
||||
|
||||
director := func(req *http.Request) {
|
||||
// Set the Host header of the original Kapacitor URL
|
||||
req.Host = u.Host
|
||||
|
||||
req.URL = u
|
||||
// Because we are acting as a proxy, kapacitor needs to have the basic auth information set as
|
||||
// a header directly
|
||||
|
|
|
@ -64,9 +64,10 @@ export const syncDashboardCell = (dashboard, cell) => ({
|
|||
},
|
||||
})
|
||||
|
||||
export const addDashboardCell = (cell) => ({
|
||||
export const addDashboardCell = (dashboard, cell) => ({
|
||||
type: 'ADD_DASHBOARD_CELL',
|
||||
payload: {
|
||||
dashboard,
|
||||
cell,
|
||||
},
|
||||
})
|
||||
|
@ -141,7 +142,7 @@ export const deleteDashboardAsync = (dashboard) => async (dispatch) => {
|
|||
export const addDashboardCellAsync = (dashboard) => async (dispatch) => {
|
||||
try {
|
||||
const {data} = await addDashboardCellAJAX(dashboard, NEW_DEFAULT_DASHBOARD_CELL)
|
||||
dispatch(addDashboardCell(data))
|
||||
dispatch(addDashboardCell(dashboard, data))
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
throw error
|
||||
|
|
|
@ -12,29 +12,17 @@ export const EMPTY_DASHBOARD = {
|
|||
],
|
||||
}
|
||||
|
||||
export const NEW_DASHBOARD = {
|
||||
name: 'Name This Dashboard',
|
||||
cells: [
|
||||
{
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 4,
|
||||
h: 4,
|
||||
name: 'Name This Graph',
|
||||
type: 'line',
|
||||
queries: [
|
||||
{
|
||||
query: "SELECT mean(\"usage_user\") AS \"usage_user\" FROM \"cpu\"",
|
||||
label: "",
|
||||
groupbys: [],
|
||||
wheres: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
export const NEW_DEFAULT_DASHBOARD_CELL = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 4,
|
||||
h: 4,
|
||||
name: 'Name This Graph',
|
||||
type: 'line',
|
||||
queries: [],
|
||||
}
|
||||
|
||||
export const NEW_DEFAULT_DASHBOARD_CELL = {
|
||||
query: [],
|
||||
type: 'line',
|
||||
export const NEW_DASHBOARD = {
|
||||
name: 'Name This Dashboard',
|
||||
cells: [NEW_DEFAULT_DASHBOARD_CELL],
|
||||
}
|
||||
|
|
|
@ -72,15 +72,13 @@ export default function ui(state = initialState, action) {
|
|||
}
|
||||
|
||||
case 'ADD_DASHBOARD_CELL': {
|
||||
const {cell} = action.payload
|
||||
const {dashboard, dashboards} = state
|
||||
const {cell, dashboard} = action.payload
|
||||
const {dashboards} = state
|
||||
|
||||
const newCells = [cell, ...dashboard.cells]
|
||||
const newDashboard = {...dashboard, cells: newCells}
|
||||
const newDashboards = dashboards.map((d) => d.id === dashboard.id ? newDashboard : d)
|
||||
const newState = {
|
||||
dashboards: newDashboards,
|
||||
}
|
||||
const newState = {dashboards: newDashboards}
|
||||
|
||||
return {...state, ...newState}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,8 @@ export const LayoutRenderer = React.createClass({
|
|||
// on a stable query representation.
|
||||
let queryText
|
||||
if (query.queryConfig) {
|
||||
queryText = buildInfluxQLQuery(timeRange, query.queryConfig)
|
||||
const {queryConfig: {rawText}} = query
|
||||
queryText = rawText || buildInfluxQLQuery(timeRange, query.queryConfig)
|
||||
} else {
|
||||
queryText = this.buildQueryForOldQuerySchema(query)
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ $dash-graph-options-arrow: 8px;
|
|||
left: 0;
|
||||
}
|
||||
.dash-graph--container {
|
||||
z-index: 0;
|
||||
user-select: none !important;
|
||||
-o-user-select: none !important;
|
||||
-moz-user-select: none !important;
|
||||
|
@ -88,7 +89,7 @@ $dash-graph-options-arrow: 8px;
|
|||
}
|
||||
}
|
||||
.dash-graph--heading {
|
||||
z-index: 1;
|
||||
z-index: 0;
|
||||
user-select: none !important;
|
||||
-o-user-select: none !important;
|
||||
-moz-user-select: none !important;
|
||||
|
@ -146,7 +147,7 @@ $dash-graph-options-arrow: 8px;
|
|||
.dash-graph--options {
|
||||
width: $dash-graph-heading;
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
z-index: 1;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
|
||||
|
|
Loading…
Reference in New Issue