Merge branch 'master' into feature/generic-oauth
commit
de43145701
|
@ -21,6 +21,7 @@
|
||||||
1. [#1195](https://github.com/influxdata/chronograf/issues/1195): Chronograf was not redirecting with authentiation for Influx Enterprise Meta service
|
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. [#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. [#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
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
1. [#1112](https://github.com/influxdata/chronograf/pull/1112): Add ability to delete a dashboard
|
1. [#1112](https://github.com/influxdata/chronograf/pull/1112): Add ability to delete a dashboard
|
||||||
|
@ -32,6 +33,7 @@
|
||||||
1. [#1095](https://github.com/influxdata/chronograf/pull/1095): Add new auth duration CLI option; add client heartbeat
|
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. [#1168](https://github.com/influxdata/chronograf/issue/1168): Expand support for --basepath on some load balancers
|
||||||
1. [#1207](https://github.com/influxdata/chronograf/pull/1207): Add support for custom OAuth2 providers
|
1. [#1207](https://github.com/influxdata/chronograf/pull/1207): Add support for custom OAuth2 providers
|
||||||
|
1. [#1221](https://github.com/influxdata/chronograf/issue/1221): More sensical Cell and Dashboard defaults
|
||||||
|
|
||||||
### UI Improvements
|
### UI Improvements
|
||||||
1. [#1101](https://github.com/influxdata/chronograf/pull/1101): Compress InfluxQL responses with gzip
|
1. [#1101](https://github.com/influxdata/chronograf/pull/1101): Compress InfluxQL responses with gzip
|
||||||
|
|
|
@ -365,7 +365,7 @@ func (s *Service) NewDashboardCell(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
dash.Cells = append(dash.Cells, cell)
|
dash.Cells = append(dash.Cells, cell)
|
||||||
if err := s.DashboardsStore.Update(ctx, dash); err != nil {
|
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)
|
Error(w, http.StatusInternalServerError, msg, s.Logger)
|
||||||
return
|
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:]...)
|
dash.Cells = append(dash.Cells[:cellid], dash.Cells[cellid+1:]...)
|
||||||
if err := s.DashboardsStore.Update(ctx, dash); err != nil {
|
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)
|
Error(w, http.StatusInternalServerError, msg, s.Logger)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -484,7 +484,7 @@ func (s *Service) ReplaceDashboardCell(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
dash.Cells[cellid] = cell
|
dash.Cells[cellid] = cell
|
||||||
if err := s.DashboardsStore.Update(ctx, dash); err != nil {
|
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)
|
Error(w, http.StatusInternalServerError, msg, s.Logger)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,9 +64,10 @@ export const syncDashboardCell = (dashboard, cell) => ({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export const addDashboardCell = (cell) => ({
|
export const addDashboardCell = (dashboard, cell) => ({
|
||||||
type: 'ADD_DASHBOARD_CELL',
|
type: 'ADD_DASHBOARD_CELL',
|
||||||
payload: {
|
payload: {
|
||||||
|
dashboard,
|
||||||
cell,
|
cell,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -141,7 +142,7 @@ export const deleteDashboardAsync = (dashboard) => async (dispatch) => {
|
||||||
export const addDashboardCellAsync = (dashboard) => async (dispatch) => {
|
export const addDashboardCellAsync = (dashboard) => async (dispatch) => {
|
||||||
try {
|
try {
|
||||||
const {data} = await addDashboardCellAJAX(dashboard, NEW_DEFAULT_DASHBOARD_CELL)
|
const {data} = await addDashboardCellAJAX(dashboard, NEW_DEFAULT_DASHBOARD_CELL)
|
||||||
dispatch(addDashboardCell(data))
|
dispatch(addDashboardCell(dashboard, data))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
throw error
|
throw error
|
||||||
|
|
|
@ -12,29 +12,17 @@ export const EMPTY_DASHBOARD = {
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NEW_DASHBOARD = {
|
export const NEW_DEFAULT_DASHBOARD_CELL = {
|
||||||
name: 'Name This Dashboard',
|
x: 0,
|
||||||
cells: [
|
y: 0,
|
||||||
{
|
w: 4,
|
||||||
x: 0,
|
h: 4,
|
||||||
y: 0,
|
name: 'Name This Graph',
|
||||||
w: 4,
|
type: 'line',
|
||||||
h: 4,
|
queries: [],
|
||||||
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 = {
|
export const NEW_DASHBOARD = {
|
||||||
query: [],
|
name: 'Name This Dashboard',
|
||||||
type: 'line',
|
cells: [NEW_DEFAULT_DASHBOARD_CELL],
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,15 +72,13 @@ export default function ui(state = initialState, action) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'ADD_DASHBOARD_CELL': {
|
case 'ADD_DASHBOARD_CELL': {
|
||||||
const {cell} = action.payload
|
const {cell, dashboard} = action.payload
|
||||||
const {dashboard, dashboards} = state
|
const {dashboards} = state
|
||||||
|
|
||||||
const newCells = [cell, ...dashboard.cells]
|
const newCells = [cell, ...dashboard.cells]
|
||||||
const newDashboard = {...dashboard, cells: newCells}
|
const newDashboard = {...dashboard, cells: newCells}
|
||||||
const newDashboards = dashboards.map((d) => d.id === dashboard.id ? newDashboard : d)
|
const newDashboards = dashboards.map((d) => d.id === dashboard.id ? newDashboard : d)
|
||||||
const newState = {
|
const newState = {dashboards: newDashboards}
|
||||||
dashboards: newDashboards,
|
|
||||||
}
|
|
||||||
|
|
||||||
return {...state, ...newState}
|
return {...state, ...newState}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue