Merge pull request #376 from Azure/fix-no-data
update some minor issues
This commit is contained in:
Коммит
4e337a09f6
|
@ -7,17 +7,14 @@ RUN mkdir -p /usr/src/app/server
|
|||
WORKDIR /usr/src/app
|
||||
|
||||
# Install app dependencies
|
||||
COPY package.json /usr/src/app/
|
||||
COPY package-lock.json /usr/src/app/
|
||||
COPY yarn.lock /usr/src/app/
|
||||
COPY package.json /usr/src/app/
|
||||
|
||||
COPY server/yarn.lock /usr/src/app/server
|
||||
COPY server/package.json /usr/src/app/server
|
||||
COPY server/package-lock.json /usr/src/app/server
|
||||
|
||||
COPY client/yarn.lock /usr/src/app/client
|
||||
COPY client/package.json /usr/src/app/client
|
||||
COPY client/package-lock.json /usr/src/app/client
|
||||
|
||||
RUN npm install yarn -g
|
||||
RUN yarn
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"main.css": "static/css/main.526645cd.css",
|
||||
"main.css.map": "static/css/main.526645cd.css.map",
|
||||
"main.js": "static/js/main.2f18ded5.js",
|
||||
"main.js.map": "static/js/main.2f18ded5.js.map"
|
||||
"main.js": "static/js/main.462c17f8.js",
|
||||
"main.js.map": "static/js/main.462c17f8.js.map"
|
||||
}
|
|
@ -1 +1 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="/favicon.ico"><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"/><title>React App</title><link href="/static/css/main.526645cd.css" rel="stylesheet"></head><body><div id="root"></div><script type="text/javascript" src="/static/js/main.2f18ded5.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="/favicon.ico"><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"/><title>React App</title><link href="/static/css/main.526645cd.css" rel="stylesheet"></head><body><div id="root"></div><script type="text/javascript" src="/static/js/main.462c17f8.js"></script></body></html>
|
|
@ -1 +1 @@
|
|||
"use strict";function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}var precacheConfig=[["/index.html","4e598a66830e50d90fa8f6a6eb634686"],["/static/css/main.526645cd.css","c99fb40040506aa587d6e41c488488c2"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,t){var n=new URL(e);return n.hash="",n.search=n.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),n.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(n){if(!t.has(n)){var r=new Request(n,{credentials:"same-origin"});return fetch(r).then(function(t){if(!t.ok)throw new Error("Request for "+n+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(n,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(n){return Promise.all(n.map(function(n){if(!t.has(n.url))return e.delete(n)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,n=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);(t=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,"index.html"),t=urlsToCacheKeys.has(n));!t&&"navigate"===e.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],e.request.url)&&(n=new URL("/index.html",self.location).toString(),t=urlsToCacheKeys.has(n)),t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetch(e.request)}))}});
|
||||
"use strict";function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}var precacheConfig=[["/index.html","58b19b58f55adcc093bee6677b6f378e"],["/static/css/main.526645cd.css","c99fb40040506aa587d6e41c488488c2"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,t){var n=new URL(e);return n.hash="",n.search=n.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),n.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(n){if(!t.has(n)){var r=new Request(n,{credentials:"same-origin"});return fetch(r).then(function(t){if(!t.ok)throw new Error("Request for "+n+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(n,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(n){return Promise.all(n.map(function(n){if(!t.has(n.url))return e.delete(n)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,n=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);(t=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,"index.html"),t=urlsToCacheKeys.has(n));!t&&"navigate"===e.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],e.request.url)&&(n=new URL("/index.html",self.location).toString(),t=urlsToCacheKeys.has(n)),t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetch(e.request)}))}});
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -7,6 +7,15 @@ import { DateRange } from 'react-date-range';
|
|||
import * as moment from 'moment';
|
||||
|
||||
const defaultRanges = {
|
||||
'Today': {
|
||||
startDate: function startDate(now: moment.Moment) {
|
||||
return now;
|
||||
},
|
||||
endDate: function endDate(now: moment.Moment) {
|
||||
return now;
|
||||
}
|
||||
},
|
||||
|
||||
'Yesterday': {
|
||||
startDate: function startDate(now: moment.Moment) {
|
||||
return now.add(-1, 'days');
|
||||
|
@ -21,7 +30,7 @@ const defaultRanges = {
|
|||
return now.add(-7, 'days');
|
||||
},
|
||||
endDate: function endDate(now: moment.Moment) {
|
||||
return now.add(-1, 'days');
|
||||
return now;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -30,7 +39,16 @@ const defaultRanges = {
|
|||
return now.add(-30, 'days');
|
||||
},
|
||||
endDate: function endDate(now: moment.Moment) {
|
||||
return now.add(-1, 'days');
|
||||
return now;
|
||||
}
|
||||
},
|
||||
|
||||
'Last 90 Days': {
|
||||
startDate: function startDate(now: moment.Moment) {
|
||||
return now.add(-90, 'days');
|
||||
},
|
||||
endDate: function endDate(now: moment.Moment) {
|
||||
return now;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -70,22 +88,23 @@ const classNames = {
|
|||
export default class DatePickerFilter extends GenericComponent<any, any> {
|
||||
|
||||
static defaultProps = {
|
||||
title: 'Timespan',
|
||||
subtitle: 'Select range',
|
||||
icon: 'more_vert'
|
||||
title: 'Timespan',
|
||||
subtitle: 'Select range',
|
||||
icon: 'more_vert'
|
||||
};
|
||||
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
super(props);
|
||||
|
||||
this.handleSelect = this.handleSelect.bind(this);
|
||||
this.showOverlay = this.showOverlay.bind(this);
|
||||
this.hideOverlay = this.hideOverlay.bind(this);
|
||||
this.handleSelect = this.handleSelect.bind(this);
|
||||
this.showOverlay = this.showOverlay.bind(this);
|
||||
this.hideOverlay = this.hideOverlay.bind(this);
|
||||
this.hideOverlayCancel = this.hideOverlayCancel.bind(this);
|
||||
|
||||
this.state = {
|
||||
visible: false,
|
||||
selectedValue: ''
|
||||
};
|
||||
this.state = {
|
||||
visible: false,
|
||||
selectedValue: ''
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -93,26 +112,28 @@ export default class DatePickerFilter extends GenericComponent<any, any> {
|
|||
* @param {Object} newDateRange
|
||||
*/
|
||||
handleSelect(newDateRange: any) {
|
||||
let selectedValue = this.toISODateRange(newDateRange);
|
||||
let selectedValue = this.toISODateRange(newDateRange);
|
||||
|
||||
if (this.state.selectedValue !== selectedValue) {
|
||||
this.setState({
|
||||
selectedValue
|
||||
});
|
||||
}
|
||||
if (this.state.selectedValue !== selectedValue) {
|
||||
this.setState({
|
||||
selectedValue
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
showOverlay() {
|
||||
this.setState({
|
||||
visible: true
|
||||
});
|
||||
this.setState({
|
||||
visible: true
|
||||
});
|
||||
}
|
||||
|
||||
hideOverlay() {
|
||||
this.setState({
|
||||
visible: false
|
||||
});
|
||||
this.trigger('onChange', this.state.selectedValue);
|
||||
this.setState({ visible: false });
|
||||
this.trigger('onChange', this.state.selectedValue);
|
||||
}
|
||||
|
||||
hideOverlayCancel() {
|
||||
this.setState({ visible: false });
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,10 +145,10 @@ export default class DatePickerFilter extends GenericComponent<any, any> {
|
|||
* @returns {string} ISO8601 Date interval string
|
||||
*/
|
||||
toISODateRange(dateRange: any) {
|
||||
let {startDate, endDate} = dateRange;
|
||||
let startDateISOString = `${startDate.format('YYYY-MM-DD')}T00:00:00.000Z`;
|
||||
let endDateISOString = `${endDate.format('YYYY-MM-DD')}T23:59:59.999Z`;
|
||||
return startDateISOString + '/' + endDateISOString;
|
||||
let {startDate, endDate} = dateRange;
|
||||
let startDateISOString = `${startDate.format('YYYY-MM-DD')}T00:00:00.000Z`;
|
||||
let endDateISOString = `${endDate.format('YYYY-MM-DD')}T23:59:59.999Z`;
|
||||
return startDateISOString + '/' + endDateISOString;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -137,115 +158,120 @@ export default class DatePickerFilter extends GenericComponent<any, any> {
|
|||
* @returns {string}
|
||||
*/
|
||||
toPrettyDateRange(selectedValue: string) {
|
||||
let dates = selectedValue.split('/');
|
||||
return dates[0].split('T')[0] + ' to ' + dates[1].split('T')[0];
|
||||
let dates = selectedValue.split('/');
|
||||
return dates[0].split('T')[0] + ' to ' + dates[1].split('T')[0];
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
const { title, subtitle, icon } = this.props;
|
||||
const { visible, selectedValue} = this.state;
|
||||
const { title, subtitle, icon } = this.props;
|
||||
const { visible, selectedValue} = this.state;
|
||||
|
||||
const paperStyle = classNames.menu.join(' ') + (visible ? 'md-paper md-paper--1' : '');
|
||||
const labelStyle = classNames.label.join(' ') + (visible ? 'md-floating-label--active' : '');
|
||||
const paperStyle = classNames.menu.join(' ') + (visible ? 'md-paper md-paper--1' : '');
|
||||
const labelStyle = classNames.label.join(' ') + (visible ? 'md-floating-label--active' : '');
|
||||
|
||||
const selectDateRange = selectedValue ? this.toPrettyDateRange(selectedValue) : (subtitle || 'Select range');
|
||||
const selectDateRange = selectedValue ? this.toPrettyDateRange(selectedValue) : (subtitle || 'Select range');
|
||||
|
||||
let startDate = selectedValue ? moment.utc(selectedValue.split('/')[0]) : '';
|
||||
let endDate = selectedValue ? moment.utc(selectedValue.split('/')[1]) : '';
|
||||
let startDate = selectedValue ? moment.utc(selectedValue.split('/')[0]) : '';
|
||||
let endDate = selectedValue ? moment.utc(selectedValue.split('/')[1]) : '';
|
||||
|
||||
// Application insights only store the information for the last 90 days
|
||||
let minDate = moment().subtract(90, 'days');
|
||||
let maxDate = moment().add(1, 'days');
|
||||
// Application insights only store the information for the last 90 days
|
||||
let minDate = moment().subtract(90, 'days');
|
||||
let maxDate = moment().add(1, 'days');
|
||||
|
||||
let theme = {
|
||||
Calendar: {
|
||||
width : 300,
|
||||
},
|
||||
PredefinedRanges: {
|
||||
marginLeft : 20,
|
||||
marginRight : 20,
|
||||
marginTop : 10
|
||||
},
|
||||
PredefinedRangesItem: {
|
||||
fontSize : 14,
|
||||
textAlign : 'center',
|
||||
},
|
||||
PredefinedRangesItemActive: {
|
||||
color : '#03a9f4',
|
||||
},
|
||||
MonthAndYear : {
|
||||
background : '#03a9f4',
|
||||
color : '#fff',
|
||||
fontSize : 14,
|
||||
fontWeight : 'bold'
|
||||
},
|
||||
MonthButton : {
|
||||
background : '#03a9f4'
|
||||
},
|
||||
Day : {
|
||||
transition : 'transform .1s ease, box-shadow .1s ease, background .1s ease',
|
||||
fontSize : 14,
|
||||
},
|
||||
DaySelected : {
|
||||
background : '#03a9f4'
|
||||
},
|
||||
DayActive : {
|
||||
background : '#03a9f4',
|
||||
boxShadow : 'none'
|
||||
},
|
||||
DayInRange : {
|
||||
background : '#b3e5fc',
|
||||
color : '#000'
|
||||
},
|
||||
DayHover : {
|
||||
background : '#ffffff',
|
||||
transform : 'scale(1.1) translateY(-10%)',
|
||||
boxShadow : '0 2px 4px rgba(0, 0, 0, 0.4)'
|
||||
},
|
||||
let theme = {
|
||||
Calendar: {
|
||||
width : 300,
|
||||
},
|
||||
PredefinedRanges: {
|
||||
marginLeft : 20,
|
||||
marginRight : 20,
|
||||
marginTop : 10
|
||||
},
|
||||
PredefinedRangesItem: {
|
||||
fontSize : 14,
|
||||
textAlign : 'center',
|
||||
},
|
||||
PredefinedRangesItemActive: {
|
||||
color : '#03a9f4',
|
||||
},
|
||||
MonthAndYear : {
|
||||
background : '#03a9f4',
|
||||
color : '#fff',
|
||||
fontSize : 14,
|
||||
fontWeight : 'bold'
|
||||
},
|
||||
MonthButton : {
|
||||
background : '#03a9f4'
|
||||
},
|
||||
Day : {
|
||||
transition : 'transform .1s ease, box-shadow .1s ease, background .1s ease',
|
||||
fontSize : 14,
|
||||
},
|
||||
DaySelected : {
|
||||
background : '#03a9f4'
|
||||
},
|
||||
DayActive : {
|
||||
background : '#03a9f4',
|
||||
boxShadow : 'none'
|
||||
},
|
||||
DayInRange : {
|
||||
background : '#b3e5fc',
|
||||
color : '#000'
|
||||
},
|
||||
DayHover : {
|
||||
background : '#ffffff',
|
||||
transform : 'scale(1.1) translateY(-10%)',
|
||||
boxShadow : '0 2px 4px rgba(0, 0, 0, 0.4)'
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
const actions = [
|
||||
{ primary: true, children: 'done', onClick: this.hideOverlay },
|
||||
{ secondary: true, children: 'clear', onClick: this.hideOverlayCancel }
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="filters">
|
||||
return (
|
||||
<div className="filters">
|
||||
|
||||
<AccessibleFakeInkedButton
|
||||
className={paperStyle}
|
||||
onClick={this.showOverlay}
|
||||
aria-haspopup="true"
|
||||
aria-expanded={visible}
|
||||
style={styles.button}
|
||||
>
|
||||
<label className={labelStyle}>{title}</label>
|
||||
<div className="md-icon-separator md-text-field md-select-field--btn md-text-field--floating-margin">
|
||||
<span className="md-value md-icon-text">{selectDateRange}</span>
|
||||
<FontIcon>arrow_drop_down</FontIcon>
|
||||
</div>
|
||||
</AccessibleFakeInkedButton>
|
||||
|
||||
<DialogContainer
|
||||
id="dateRangePicker"
|
||||
onHide={this.hideOverlay}
|
||||
visible={visible}
|
||||
aria-label="Daterange Picker"
|
||||
>
|
||||
<DateRange
|
||||
linkedCalendars={true}
|
||||
calendars={1}
|
||||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
minDate={minDate}
|
||||
maxDate={maxDate}
|
||||
// monday as first day of week
|
||||
firstDayOfWeek={1}
|
||||
ranges={defaultRanges}
|
||||
onInit={this.handleSelect}
|
||||
onChange={this.handleSelect}
|
||||
theme={theme}
|
||||
/>
|
||||
|
||||
</DialogContainer>
|
||||
<AccessibleFakeInkedButton
|
||||
className={paperStyle}
|
||||
onClick={this.showOverlay}
|
||||
aria-haspopup="true"
|
||||
aria-expanded={visible}
|
||||
style={styles.button}
|
||||
>
|
||||
<label className={labelStyle}>{title}</label>
|
||||
<div className="md-icon-separator md-text-field md-select-field--btn md-text-field--floating-margin">
|
||||
<span className="md-value md-icon-text">{selectDateRange}</span>
|
||||
<FontIcon>arrow_drop_down</FontIcon>
|
||||
</div>
|
||||
);
|
||||
</AccessibleFakeInkedButton>
|
||||
|
||||
<DialogContainer
|
||||
id="dateRangePicker"
|
||||
onHide={this.hideOverlay}
|
||||
visible={visible}
|
||||
actions={actions}
|
||||
aria-label="Daterange Picker"
|
||||
>
|
||||
<DateRange
|
||||
linkedCalendars={true}
|
||||
calendars={1}
|
||||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
minDate={minDate}
|
||||
maxDate={maxDate}
|
||||
// monday as first day of week
|
||||
firstDayOfWeek={1}
|
||||
ranges={defaultRanges}
|
||||
onInit={this.handleSelect}
|
||||
onChange={this.handleSelect}
|
||||
theme={theme}
|
||||
/>
|
||||
|
||||
</DialogContainer>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
|
@ -23,7 +23,7 @@ router.post('/query', (req, res) => {
|
|||
// 1. Get the apiKey from the dashboard
|
||||
let apiKey = getApiKeyFromConnection(dashboard, appId);
|
||||
|
||||
var url = `${appInsightsUri}/${appId}/query?timespan=${queryTimespan}`;
|
||||
var url = `${appInsightsUri}/${appId}/query?timespan=${encodeURIComponent(queryTimespan)}`;
|
||||
const requestOptions = {
|
||||
method: 'POST',
|
||||
json: true,
|
||||
|
|
Загрузка…
Ссылка в новой задаче