mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/nopaque into development
This commit is contained in:
commit
cb1228c392
16
.env.tpl
16
.env.tpl
@ -100,15 +100,23 @@ NOPAQUE_CONTACT_EMAIL_ADRESS=
|
|||||||
# Choose one: http, https
|
# Choose one: http, https
|
||||||
# NOPAQUE_PROTOCOL=
|
# NOPAQUE_PROTOCOL=
|
||||||
|
|
||||||
# DEFAULT: 5
|
# DEFAULT: True
|
||||||
# NOPAQUE_RESSOURCES_PER_PAGE=
|
# Choose one: False, True
|
||||||
|
# NOPAQUE_REMEMBER_COOKIE_HTTPONLY=
|
||||||
|
|
||||||
|
# DEFAULT: False
|
||||||
|
# Choose one: False, True
|
||||||
|
# HINT: Set to true if you redirect http to https
|
||||||
|
# NOPAQUE_REMEMBER_COOKIE_SECURE=
|
||||||
|
|
||||||
# DEFAULT: hard to guess string
|
# DEFAULT: hard to guess string
|
||||||
# HINT: Use this bash command `python -c "import uuid; print(uuid.uuid4().hex)"`
|
# HINT: Use this bash command `python -c "import uuid; print(uuid.uuid4().hex)"`
|
||||||
# NOPAQUE_SECRET_KEY=
|
# NOPAQUE_SECRET_KEY=
|
||||||
|
|
||||||
# DEFAULT: 10
|
# DEFAULT: False
|
||||||
# NOPAQUE_USERS_PER_PAGE=
|
# Choose one: False, True
|
||||||
|
# HINT: Set to true if you redirect http to https
|
||||||
|
# NOPAQUE_SESSION_COOKIE_SECURE=
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -126,8 +126,8 @@ def corpus_analysis_query(query):
|
|||||||
context = 50
|
context = 50
|
||||||
progress = 0
|
progress = 0
|
||||||
# for attr in corpus.structural_attributes.list():
|
# for attr in corpus.structural_attributes.list():
|
||||||
# if attr.attrs['name'] == 'text':
|
# if attr.attrs['name'] == 'text':
|
||||||
# text_attr = attr
|
# text_attr = attr
|
||||||
# logging.warning(results.fdist_1(15, results.attrs['fields']['match'], text_attr))
|
# logging.warning(results.fdist_1(15, results.attrs['fields']['match'], text_attr))
|
||||||
client.status = 'running'
|
client.status = 'running'
|
||||||
while chunk_start <= results.attrs['size']:
|
while chunk_start <= results.attrs['size']:
|
||||||
|
@ -33,13 +33,24 @@ function prepareQueryData() {
|
|||||||
*/
|
*/
|
||||||
function saveQueryData() {
|
function saveQueryData() {
|
||||||
let [payload, client, results, rest] = arguments;
|
let [payload, client, results, rest] = arguments;
|
||||||
|
// Get data matches length before new chunk data is being inserted
|
||||||
let dataLength = results.data.matches.length;
|
let dataLength = results.data.matches.length;
|
||||||
if (client.dynamicMode) {
|
if (client.dynamicMode) {
|
||||||
// get data matches length before new chunk data is being inserted
|
// Incorporating new chunk data into full results
|
||||||
// incorporating new chunk data into full results
|
|
||||||
results.data.matches.push(...payload.chunk.matches);
|
results.data.matches.push(...payload.chunk.matches);
|
||||||
results.data.addData(payload.chunk.cpos_lookup, 'cpos_lookup');
|
results.data.addData(payload.chunk.cpos_lookup, 'cpos_lookup');
|
||||||
results.data.addData(payload.chunk.text_lookup, 'text_lookup');
|
results.data.addData(payload.chunk.text_lookup, 'text_lookup');
|
||||||
|
console.log(payload.chunk.text_lookup);
|
||||||
|
/**
|
||||||
|
* Increment match_counts per text in a global results varaible because
|
||||||
|
* they are coming in chunkwise.
|
||||||
|
*/
|
||||||
|
for (let [text_key, value] of Object.entries(payload.chunk.text_lookup)) {
|
||||||
|
if (!(text_key in results.tmp_match_counts)) {
|
||||||
|
results.tmp_match_counts[text_key] = {match_count: 0};
|
||||||
|
}
|
||||||
|
results.tmp_match_counts[text_key].match_count += payload.chunk.text_lookup[text_key].match_count;
|
||||||
|
}
|
||||||
results.data.cpos_ranges = payload.chunk.cpos_ranges;
|
results.data.cpos_ranges = payload.chunk.cpos_ranges;
|
||||||
let queryFormElement = document.querySelector('#query-form');
|
let queryFormElement = document.querySelector('#query-form');
|
||||||
results.data.getQueryStr(queryFormElement);
|
results.data.getQueryStr(queryFormElement);
|
||||||
@ -51,6 +62,10 @@ function saveQueryData() {
|
|||||||
console.info('Query data chunk saved', results.data);
|
console.info('Query data chunk saved', results.data);
|
||||||
if (client.requestQueryProgress === 100) {
|
if (client.requestQueryProgress === 100) {
|
||||||
client.isBusy = false;
|
client.isBusy = false;
|
||||||
|
// Update text_lookup with tmp_match_counts.
|
||||||
|
for (let [text_key, value] of Object.entries(results.tmp_match_counts)) {
|
||||||
|
results.data.text_lookup[text_key].match_count = results.tmp_match_counts[text_key].match_count;
|
||||||
|
}
|
||||||
client.notifyView('query-data-recieved');
|
client.notifyView('query-data-recieved');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -22,6 +22,8 @@ class Results {
|
|||||||
this.fullResultsData.init();
|
this.fullResultsData.init();
|
||||||
this.subResultsData.init();
|
this.subResultsData.init();
|
||||||
this.inspectResultsData.init();
|
this.inspectResultsData.init();
|
||||||
|
// Temporarly save match counts per text
|
||||||
|
this.tmp_match_counts = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,10 @@ DEFAULT_SMTP_USE_SSL = 'False'
|
|||||||
DEFAULT_SMTP_USE_TLS = 'False'
|
DEFAULT_SMTP_USE_TLS = 'False'
|
||||||
DEFAULT_NUM_PROXIES = '0'
|
DEFAULT_NUM_PROXIES = '0'
|
||||||
DEFAULT_PROTOCOL = 'http'
|
DEFAULT_PROTOCOL = 'http'
|
||||||
DEFAULT_RESSOURCES_PER_PAGE = '5'
|
DEFAULT_REMEMBER_COOKIE_HTTPONLY = 'True'
|
||||||
DEFAULT_USERS_PER_PAGE = '10'
|
DEFAULT_REMEMBER_COOKIE_SECURE = 'False'
|
||||||
DEFAULT_SECRET_KEY = 'hard to guess string'
|
DEFAULT_SECRET_KEY = 'hard to guess string'
|
||||||
|
DEFAULT_SESSION_COOKIE_SECURE = 'False'
|
||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
@ -55,15 +56,19 @@ class Config:
|
|||||||
NUM_PROXIES = int(os.environ.get('NOPAQUE_NUM_PROXIES',
|
NUM_PROXIES = int(os.environ.get('NOPAQUE_NUM_PROXIES',
|
||||||
DEFAULT_NUM_PROXIES))
|
DEFAULT_NUM_PROXIES))
|
||||||
PROTOCOL = os.environ.get('NOPAQUE_PROTOCOL', DEFAULT_PROTOCOL)
|
PROTOCOL = os.environ.get('NOPAQUE_PROTOCOL', DEFAULT_PROTOCOL)
|
||||||
RESSOURCES_PER_PAGE = int(os.environ.get('NOPAQUE_RESSOURCES_PER_PAGE',
|
REMEMBER_COOKIE_HTTPONLY = os.environ.get(
|
||||||
DEFAULT_RESSOURCES_PER_PAGE))
|
'NOPAQUE_REMEMBER_COOKIE_HTTPONLY',
|
||||||
SECRET_KEY = os.environ.get('NOPAQUE_SECRET_KEY', DEFAULT_SECRET_KEY)
|
DEFAULT_REMEMBER_COOKIE_HTTPONLY
|
||||||
USERS_PER_PAGE = int(os.environ.get('NOPAQUE_USERS_PER_PAGE',
|
).lower() == 'true'
|
||||||
DEFAULT_USERS_PER_PAGE))
|
REMEMBER_COOKIE_SECURE = os.environ.get(
|
||||||
if PROTOCOL == 'https':
|
'NOPAQUE_REMEMBER_COOKIE_SECURE',
|
||||||
REMEMBER_COOKIE_HTTPONLY = True
|
DEFAULT_REMEMBER_COOKIE_SECURE
|
||||||
REMEMBER_COOKIE_SECURE = True
|
).lower() == 'true'
|
||||||
SESSION_COOKIE_SECURE = True
|
SECRET_KEY = os.environ.get('RECIPY_SECRET_KEY', DEFAULT_SECRET_KEY)
|
||||||
|
SESSION_COOKIE_SECURE = os.environ.get(
|
||||||
|
'NOPAQUE_SESSION_COOKIE_SECURE',
|
||||||
|
DEFAULT_SESSION_COOKIE_SECURE
|
||||||
|
).lower() == 'true'
|
||||||
|
|
||||||
''' ### Logging ### '''
|
''' ### Logging ### '''
|
||||||
LOG_DATE_FORMAT = os.environ.get('NOPAQUE_LOG_DATE_FORMAT',
|
LOG_DATE_FORMAT = os.environ.get('NOPAQUE_LOG_DATE_FORMAT',
|
||||||
|
Loading…
Reference in New Issue
Block a user