mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
fix authError behavior, fix overlapping chart behavior
This commit is contained in:
parent
a14f4ae83b
commit
edeef107f0
@ -12,7 +12,8 @@
|
||||
--chart-background: white;
|
||||
--shadow-color: rgba(0, 0, 0, 0.25);
|
||||
--input-shadow-color: rgba(0, 255, 0, 1);
|
||||
--error-color: white;
|
||||
--error-color: red;
|
||||
--auth-error-color: white;
|
||||
--legend-background: rgba(255, 255, 255, 0.75);
|
||||
--title-color: #666;
|
||||
--text-color: black;
|
||||
@ -258,7 +259,7 @@
|
||||
width: 60%;
|
||||
padding: .5rem;
|
||||
|
||||
color: var(--error-color);
|
||||
color: var(--auth-error-color);
|
||||
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
@ -906,9 +907,9 @@ async function draw(idx, chart, url_params, query) {
|
||||
|
||||
if (error) {
|
||||
const errorMatch = errorMessages.find(({ regex }) => error.match(regex))
|
||||
if (errorMatch) {
|
||||
const match = error.match(errorMatch.regex)
|
||||
const message = errorMatch.messageFunc(match)
|
||||
const match = error.match(errorMatch.regex)
|
||||
const message = errorMatch.messageFunc(match)
|
||||
if (message) {
|
||||
const authError = new Error(message)
|
||||
throw authError
|
||||
}
|
||||
@ -1019,13 +1020,15 @@ async function drawAll() {
|
||||
firstLoad = false;
|
||||
} else {
|
||||
enableReloadButton();
|
||||
enableRunButton();
|
||||
}
|
||||
if (!results.includes(false)) {
|
||||
if (results.includes(true)) {
|
||||
const element = document.querySelector('.inputs');
|
||||
element.classList.remove('unconnected');
|
||||
const add = document.querySelector('#add');
|
||||
add.style.display = 'block';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
const charts = document.querySelector('#charts')
|
||||
charts.style.height = '0px';
|
||||
}
|
||||
@ -1050,6 +1053,13 @@ function disableReloadButton() {
|
||||
reloadButton.classList.add('disabled')
|
||||
}
|
||||
|
||||
function disableRunButton() {
|
||||
const runButton = document.getElementById('run')
|
||||
runButton.value = 'Reloading...'
|
||||
runButton.disabled = true
|
||||
runButton.classList.add('disabled')
|
||||
}
|
||||
|
||||
function enableReloadButton() {
|
||||
const reloadButton = document.getElementById('reload')
|
||||
reloadButton.value = 'Reload'
|
||||
@ -1057,11 +1067,19 @@ function enableReloadButton() {
|
||||
reloadButton.classList.remove('disabled')
|
||||
}
|
||||
|
||||
function enableRunButton() {
|
||||
const runButton = document.getElementById('run')
|
||||
runButton.value = 'Ok'
|
||||
runButton.disabled = false
|
||||
runButton.classList.remove('disabled')
|
||||
}
|
||||
|
||||
function reloadAll() {
|
||||
updateParams();
|
||||
drawAll();
|
||||
saveState();
|
||||
disableReloadButton()
|
||||
disableReloadButton();
|
||||
disableRunButton();
|
||||
}
|
||||
|
||||
document.getElementById('params').onsubmit = function(event) {
|
||||
|
Loading…
Reference in New Issue
Block a user