change isAllowedCache prefix

fix proxycheck key update
add small stuff to wins
This commit is contained in:
HF 2022-08-21 20:54:49 +02:00
parent dde8eba9bc
commit c93fad12bc
4 changed files with 15 additions and 11 deletions

View File

@ -5,7 +5,7 @@
import client from './client';
const PREFIX = 'isal:';
const PREFIX = 'isal';
const CACHE_DURATION = 14 * 24 * 3600;
export function cacheAllowed(ip, status) {

View File

@ -7,6 +7,7 @@ const initialState = {
windowType: 'SETTINGS',
title: '',
args: {},
isPopup: window.opener && !window.opener.closed,
};
export default function win(

View File

@ -6,7 +6,6 @@
import https from 'https';
import { HOUR } from '../core/constants';
import { HourlyCron } from './cron';
@ -89,8 +88,9 @@ class PcKeyProvider {
* @param keys Array of key strings
*/
async getKeysUsage(keys) {
for (let i = 0; i < keys.length; i += 1) {
let key = keys[i];
const tmpKeys = [...keys];
for (let i = 0; i < tmpKeys.length; i += 1) {
let key = tmpKeys[i];
if (typeof key !== 'string') {
[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,...)
* @param key
@ -327,6 +320,10 @@ class ProxyCheck {
});
}
updateKeys() {
return this.pcKeyProvider.updateKeys();
}
async checkFromQueue() {
const { ipQueue } = this;
if (!ipQueue.length) {

View File

@ -15,4 +15,10 @@ document.addEventListener('DOMContentLoaded', () => {
// eslint-disable-next-line no-console
console.log('hello');
renderAppWin(document.getElementById('app'), store);
/*
* check if popup or independent window
*/
if (!window.opener || window.opener.closed) {
}
});