change isAllowedCache prefix
fix proxycheck key update add small stuff to wins
This commit is contained in:
parent
dde8eba9bc
commit
c93fad12bc
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import client from './client';
|
import client from './client';
|
||||||
|
|
||||||
const PREFIX = 'isal:';
|
const PREFIX = 'isal';
|
||||||
const CACHE_DURATION = 14 * 24 * 3600;
|
const CACHE_DURATION = 14 * 24 * 3600;
|
||||||
|
|
||||||
export function cacheAllowed(ip, status) {
|
export function cacheAllowed(ip, status) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ const initialState = {
|
||||||
windowType: 'SETTINGS',
|
windowType: 'SETTINGS',
|
||||||
title: '',
|
title: '',
|
||||||
args: {},
|
args: {},
|
||||||
|
isPopup: window.opener && !window.opener.closed,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function win(
|
export default function win(
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
import https from 'https';
|
import https from 'https';
|
||||||
|
|
||||||
import { HOUR } from '../core/constants';
|
|
||||||
import { HourlyCron } from './cron';
|
import { HourlyCron } from './cron';
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,8 +88,9 @@ class PcKeyProvider {
|
||||||
* @param keys Array of key strings
|
* @param keys Array of key strings
|
||||||
*/
|
*/
|
||||||
async getKeysUsage(keys) {
|
async getKeysUsage(keys) {
|
||||||
for (let i = 0; i < keys.length; i += 1) {
|
const tmpKeys = [...keys];
|
||||||
let key = keys[i];
|
for (let i = 0; i < tmpKeys.length; i += 1) {
|
||||||
|
let key = tmpKeys[i];
|
||||||
if (typeof key !== 'string') {
|
if (typeof key !== 'string') {
|
||||||
[key] = key;
|
[key] = key;
|
||||||
}
|
}
|
||||||
|
@ -196,13 +196,6 @@ class PcKeyProvider {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* wrapper to update keys
|
|
||||||
*/
|
|
||||||
updateKeys() {
|
|
||||||
this.pcKeyProvider.updateKeys();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* report denied key (over daily quota, rate limited, blocked,...)
|
* report denied key (over daily quota, rate limited, blocked,...)
|
||||||
* @param key
|
* @param key
|
||||||
|
@ -327,6 +320,10 @@ class ProxyCheck {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateKeys() {
|
||||||
|
return this.pcKeyProvider.updateKeys();
|
||||||
|
}
|
||||||
|
|
||||||
async checkFromQueue() {
|
async checkFromQueue() {
|
||||||
const { ipQueue } = this;
|
const { ipQueue } = this;
|
||||||
if (!ipQueue.length) {
|
if (!ipQueue.length) {
|
||||||
|
|
|
@ -15,4 +15,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('hello');
|
console.log('hello');
|
||||||
renderAppWin(document.getElementById('app'), store);
|
renderAppWin(document.getElementById('app'), store);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check if popup or independent window
|
||||||
|
*/
|
||||||
|
if (!window.opener || window.opener.closed) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user