mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Merge pull request #66457 from AVMusorin/add-play-now-param
Allow run query instantly in play
This commit is contained in:
commit
3419b916a9
@ -522,6 +522,9 @@
|
||||
const current_url = new URL(window.location);
|
||||
const opened_locally = location.protocol == 'file:';
|
||||
|
||||
/// Run query instantly after page is loaded if the run parameter is present.
|
||||
const run_immediately = current_url.searchParams.has("run");
|
||||
|
||||
const server_address = current_url.searchParams.get('url');
|
||||
if (server_address) {
|
||||
document.getElementById('url').value = server_address;
|
||||
@ -599,6 +602,9 @@
|
||||
const title = "ClickHouse Query: " + query;
|
||||
|
||||
let history_url = window.location.pathname + '?user=' + encodeURIComponent(user);
|
||||
if (run_immediately) {
|
||||
history_url += "&run=1";
|
||||
}
|
||||
if (server_address != location.origin) {
|
||||
/// Save server's address in URL if it's not identical to the address of the play UI.
|
||||
history_url += '&url=' + encodeURIComponent(server_address);
|
||||
@ -1160,6 +1166,10 @@
|
||||
});
|
||||
}
|
||||
|
||||
if (run_immediately) {
|
||||
post();
|
||||
}
|
||||
|
||||
document.getElementById('toggle-light').onclick = function() {
|
||||
setColorTheme('light', true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user