Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added minimal web UI #16158

Merged
merged 10 commits into from Oct 20, 2020
Merged

Added minimal web UI #16158

merged 10 commits into from Oct 20, 2020

Conversation

alexey-milovidov
Copy link
Member

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Added minimal web UI to ClickHouse.

@robot-clickhouse robot-clickhouse added doc-alert pr-feature Pull request with new product feature labels Oct 19, 2020
@alexey-milovidov
Copy link
Member Author

TODO: add an option to clamp settings instead of throw in HTTP interface.

@alexey-milovidov
Copy link
Member Author

TSan: #15984

@alexey-milovidov alexey-milovidov self-assigned this Oct 20, 2020
@alexey-milovidov alexey-milovidov merged commit b4f0e08 into master Oct 20, 2020
@alexey-milovidov alexey-milovidov deleted the minimal-ui branch October 20, 2020 08:57
@@ -0,0 +1,437 @@
<html> <!-- TODO If I write DOCTYPE HTML something changes but I don't know what. -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xhr.open('POST', url, true);
xhr.send(query);

xhr.onreadystatechange = function()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, any particular reason you're mixing modern CSS features (var) with old IE-style JS? (XHR+onreadystatechange, for..in, event.charCode etc)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I "learned" HTML, JS and CSS during my middle-school years in early 2000s (actually never read a book).
I continue to mix my old habits with copy-pasting code from Stackoverflow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to use Fetch API but it was not working from file:// page to request the server (most likely due to cross-origin policy, but setting parameter to disable it did not help).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have intention to present this simple page as an example of small self-contained code, so everyone can suggest changes to help me to make it perfect from every kind of sense.

var is_null = (cell === null);
var content = document.createTextNode(is_null ? 'ᴺᵁᴸᴸ' : cell);
td.appendChild(content);
td.className = response.meta[col_idx].type.match(/^(U?Int|Decimal|Float)/) ? 'right' : 'left';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suboptimal, will change.

@vkingnew
Copy link

just use clickhouse server ip to use ,like http://ip:8123/play

@vkingnew
Copy link

the window is small,50% of the page is better, and Could you provide SQL formatter?

@bgranvea
Copy link
Contributor

bgranvea commented Dec 9, 2020

nice! the first limitations that I notice:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature Pull request with new product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants