forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'grafana/master' into graph-with-series-…
…data * grafana/master: Changelog: Typo guage -> gauge (grafana#16982) TestData: stream via fetch (grafana#16963) plugins: fix how datemath utils are exposed to plugins (grafana#16976) NewDataSource: Updated page header title fix(prometheus): issue with click label to filter for recording rules in Explore Explore: Removes Promise.All from runQueries thunk (grafana#16957) Chore: Add prometheus basic auth proxy (grafana#16882) Snapshot: use given key and deleteKey (grafana#16876) DataSourcePlugins: more generics improvements (grafana#16965) AddDataSource: Updated page design & categories (grafana#16971) Templating: Support selecting all filtered values of multi-value variable (grafana#16873) Chore: Add Input stories (grafana#16897)
- Loading branch information
Showing
52 changed files
with
608 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM nginx:alpine | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY htpasswd /etc/nginx/htpasswd |
6 changes: 6 additions & 0 deletions
6
devenv/docker/blocks/prometheus_basic_auth_proxy/docker-compose.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This will proxy all requests for http://localhost:10090 to | ||
# http://prometheus:9090 (Prometheus inside the docker compose) | ||
|
||
nginxproxy: | ||
build: docker/blocks/nginx_proxy | ||
network_mode: host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
prom:$apr1$bfu32njz$HHDDTjaeWHDzQs2UMXP.C1 |
34 changes: 34 additions & 0 deletions
34
devenv/docker/blocks/prometheus_basic_auth_proxy/nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
events { } | ||
|
||
http { | ||
server { | ||
|
||
listen 10090; | ||
|
||
location / { | ||
|
||
# Removes any Access-Control-Allow-Origin from Prometheus itself. When accessing from browser, having * or | ||
# multiple values is not allowed in some cases | ||
proxy_hide_header Access-Control-Allow-Origin; | ||
|
||
# Allow the origin access. This is kinda wildcard but for browser it seems more strict and is needed for | ||
# withCredentials requests. | ||
add_header Access-Control-Allow-Origin $http_origin; | ||
|
||
# When using withCredentials requests this must be true. | ||
add_header Access-Control-Allow-Credentials true; | ||
|
||
# Ask for basic auth except for pre flight OPTIONS request. | ||
limit_except OPTIONS { | ||
################################################################ | ||
# The htpasswd file contains user: | ||
# prom: test | ||
################################################################ | ||
auth_basic "prom"; | ||
auth_basic_user_file /etc/nginx/htpasswd; | ||
} | ||
|
||
proxy_pass http://prometheus:9090/; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React, { useState } from 'react'; | ||
import { zip, fromPairs } from 'lodash'; | ||
|
||
import { storiesOf } from '@storybook/react'; | ||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; | ||
import { Input } from './Input'; | ||
import { text, select } from '@storybook/addon-knobs'; | ||
import { EventsWithValidation } from '../../utils'; | ||
|
||
const getKnobs = () => { | ||
return { | ||
validation: text('Validation regex (will do a partial match if you do not anchor it)', ''), | ||
validationErrorMessage: text('Validation error message', 'Input not valid'), | ||
validationEvent: select( | ||
'Validation event', | ||
fromPairs(zip(Object.keys(EventsWithValidation), Object.values(EventsWithValidation))), | ||
EventsWithValidation.onBlur | ||
), | ||
}; | ||
}; | ||
|
||
const Wrapper = () => { | ||
const { validation, validationErrorMessage, validationEvent } = getKnobs(); | ||
const [value, setValue] = useState(''); | ||
const validations = { | ||
[validationEvent]: [ | ||
{ | ||
rule: (value: string) => { | ||
return !!value.match(validation); | ||
}, | ||
errorMessage: validationErrorMessage, | ||
}, | ||
], | ||
}; | ||
return <Input value={value} onChange={e => setValue(e.currentTarget.value)} validationEvents={validations} />; | ||
}; | ||
|
||
const story = storiesOf('UI/Input', module); | ||
story.addDecorator(withCenteredStory); | ||
story.add('input', () => <Wrapper />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 27 additions & 26 deletions
53
packages/grafana-ui/src/components/SetInterval/SetInterval.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/grafana-ui/src/components/Switch/Switch.story.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { useState } from 'react'; | ||
|
||
import { storiesOf } from '@storybook/react'; | ||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; | ||
import { Switch } from './Switch'; | ||
import { text } from '@storybook/addon-knobs'; | ||
|
||
const getKnobs = () => { | ||
return { | ||
label: text('Label Text', 'Label'), | ||
}; | ||
}; | ||
|
||
const SwitchWrapper = () => { | ||
const { label } = getKnobs(); | ||
const [checked, setChecked] = useState(false); | ||
return <Switch label={label} checked={checked} onChange={() => setChecked(!checked)} />; | ||
}; | ||
|
||
const story = storiesOf('UI/Switch', module); | ||
story.addDecorator(withCenteredStory); | ||
story.add('switch', () => <SwitchWrapper />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.