mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
get ajax timeout from user config [skip ci]
This commit is contained in:
@@ -219,6 +219,7 @@ class General(BaseSettings):
|
|||||||
redis_host: Union[str, IPvAnyNetwork] = "localhost"
|
redis_host: Union[str, IPvAnyNetwork] = "localhost"
|
||||||
redis_port: int = 6379
|
redis_port: int = 6379
|
||||||
requires_ipv6_cidr: List[str] = ["cisco_ios", "cisco_nxos"]
|
requires_ipv6_cidr: List[str] = ["cisco_ios", "cisco_nxos"]
|
||||||
|
query_timeout: int = 15
|
||||||
|
|
||||||
|
|
||||||
class Branding(BaseSettings):
|
class Branding(BaseSettings):
|
||||||
|
@@ -8,6 +8,7 @@ const animsition = require('animsition');
|
|||||||
const ClipboardJS = require('clipboard');
|
const ClipboardJS = require('clipboard');
|
||||||
const frontEndConfig = require('./frontend.json');
|
const frontEndConfig = require('./frontend.json');
|
||||||
|
|
||||||
|
const cfgGeneral = frontEndConfig.general;
|
||||||
const inputMessages = frontEndConfig.messages;
|
const inputMessages = frontEndConfig.messages;
|
||||||
const pageContainer = $('#hg-page-container');
|
const pageContainer = $('#hg-page-container');
|
||||||
const formContainer = $('#hg-form');
|
const formContainer = $('#hg-form');
|
||||||
@@ -86,7 +87,7 @@ queryType.selectpicker({
|
|||||||
|
|
||||||
footerTermsBtn.popover({
|
footerTermsBtn.popover({
|
||||||
html: true,
|
html: true,
|
||||||
trigger: 'focus',
|
trigger: 'focus click',
|
||||||
template: footerPopoverTemplate,
|
template: footerPopoverTemplate,
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
content: $('#hg-footer-terms-html').html(),
|
content: $('#hg-footer-terms-html').html(),
|
||||||
@@ -94,7 +95,7 @@ footerTermsBtn.popover({
|
|||||||
|
|
||||||
footerHelpBtn.popover({
|
footerHelpBtn.popover({
|
||||||
html: true,
|
html: true,
|
||||||
trigger: 'focus',
|
trigger: 'focus click',
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
template: footerPopoverTemplate,
|
template: footerPopoverTemplate,
|
||||||
content: $('#hg-footer-help-html').html(),
|
content: $('#hg-footer-help-html').html(),
|
||||||
@@ -102,7 +103,7 @@ footerHelpBtn.popover({
|
|||||||
|
|
||||||
footerCreditBtn.popover({
|
footerCreditBtn.popover({
|
||||||
html: true,
|
html: true,
|
||||||
trigger: 'focus',
|
trigger: 'focus click',
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
title: $('#hg-footer-credit-title').html(),
|
title: $('#hg-footer-credit-title').html(),
|
||||||
content: $('#hg-footer-credit-content').html(),
|
content: $('#hg-footer-credit-content').html(),
|
||||||
@@ -116,8 +117,8 @@ $(document).ready(() => {
|
|||||||
$('.animsition').animsition({
|
$('.animsition').animsition({
|
||||||
inClass: 'fade-in',
|
inClass: 'fade-in',
|
||||||
outClass: 'fade-out',
|
outClass: 'fade-out',
|
||||||
inDuration: 800,
|
inDuration: 400,
|
||||||
outDuration: 800,
|
outDuration: 400,
|
||||||
transition: (url) => { window.location.href = url; },
|
transition: (url) => { window.location.href = url; },
|
||||||
});
|
});
|
||||||
formContainer.animsition('in');
|
formContainer.animsition('in');
|
||||||
@@ -215,7 +216,7 @@ const queryApp = (queryType, queryTypeName, locationList, queryTarget) => {
|
|||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
context: document.body,
|
context: document.body,
|
||||||
async: true,
|
async: true,
|
||||||
timeout: 15000,
|
timeout: cfgGeneral.query_timeout * 1000,
|
||||||
})
|
})
|
||||||
.done((data, textStatus, jqXHR) => {
|
.done((data, textStatus, jqXHR) => {
|
||||||
const displayHtml = `<pre>${jqXHR.responseText}</pre>`;
|
const displayHtml = `<pre>${jqXHR.responseText}</pre>`;
|
||||||
|
Reference in New Issue
Block a user