mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-23 22:36:24 +00:00
No restricted globals.
This commit is contained in:
+1
-3
@@ -38,10 +38,8 @@
|
||||
"react/prop-types": 0,
|
||||
|
||||
"jsx-a11y/click-events-have-key-events": 0,
|
||||
|
||||
"jsx-a11y/mouse-events-have-key-events": 0,
|
||||
"no-multi-spaces": 0,
|
||||
"no-restricted-globals": 0,
|
||||
|
||||
"object-curly-newline": 0,
|
||||
"padded-blocks": 0,
|
||||
"prefer-destructuring": 0,
|
||||
|
||||
@@ -44,7 +44,7 @@ class LinkWrapper extends React.Component {
|
||||
if (router && href[0] === '/') {
|
||||
router.push(href);
|
||||
} else {
|
||||
location.href = href;
|
||||
window.location.href = href;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ function startPerf(delay) {
|
||||
|
||||
export function showingDebugToolbar() {
|
||||
return (('debugToolbar' in localStorage && JSON.parse(localStorage.debugToolbar))
|
||||
|| location.pathname.indexOf('debug') > -1);
|
||||
|| window.location.pathname.indexOf('debug') > -1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ const TRUNCATE_ELLIPSIS = '…';
|
||||
* `('text', {start: 2, length: 1}) => [{text: 'te'}, {text: 'x', match: true}, {text: 't'}]`
|
||||
*/
|
||||
function chunkText(text, { start, length }) {
|
||||
if (text && !isNaN(start) && !isNaN(length)) {
|
||||
if (text && !window.isNaN(start) && !window.isNaN(length)) {
|
||||
const chunks = [];
|
||||
// text chunk before match
|
||||
if (start > 0) {
|
||||
|
||||
@@ -294,7 +294,7 @@ class NodeDetailsTable extends React.Component {
|
||||
|
||||
|
||||
NodeDetailsTable.defaultProps = {
|
||||
nodeIdKey: 'id', // key to identify a node in a row (used for topology links)
|
||||
nodeIdKey: 'id', // key to identify a node in a row (used for topology links)
|
||||
limit: NODE_DETAILS_DATA_ROWS_DEFAULT_LIMIT,
|
||||
onSortChange: () => {},
|
||||
sortedDesc: null,
|
||||
|
||||
@@ -235,7 +235,7 @@ export function parseQuery(query) {
|
||||
if (comparisonQuery && comparisonQuery.length === 2) {
|
||||
const value = parseValue(comparisonQuery[1]);
|
||||
const metric = comparisonQuery[0].trim();
|
||||
if (!isNaN(value) && metric) {
|
||||
if (!window.isNaN(value) && metric) {
|
||||
comparison = {
|
||||
metric,
|
||||
value,
|
||||
|
||||
@@ -27,7 +27,7 @@ const csrfToken = (() => {
|
||||
// Check for token at window level or parent level (for iframe);
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
const token = typeof window !== 'undefined'
|
||||
? window.__WEAVEWORKS_CSRF_TOKEN || parent.__WEAVEWORKS_CSRF_TOKEN
|
||||
? window.__WEAVEWORKS_CSRF_TOKEN || window.parent.__WEAVEWORKS_CSRF_TOKEN
|
||||
: null;
|
||||
/* eslint-enable no-underscore-dangle */
|
||||
if (!token || token === '$__CSRF_TOKEN_PLACEHOLDER__') {
|
||||
@@ -110,7 +110,7 @@ function topologiesUrl(state) {
|
||||
}
|
||||
|
||||
export function getWebsocketUrl(host = window.location.host, pathname = window.location.pathname) {
|
||||
const wsProto = location.protocol === 'https:' ? 'wss' : 'ws';
|
||||
const wsProto = window.location.protocol === 'https:' ? 'wss' : 'ws';
|
||||
return `${wsProto}://${host}${process.env.SCOPE_API_PREFIX || ''}${basePath(pathname)}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user