Closed mercury233 closed 1 year ago
Ahhh, that's a good idea.
If you're ok to email me or upload a database with an example view, I'll take some time today to try and get that working. :smile:
Thanks, got it. :smile:
@mercury233 It should work now. :smile:
Note - it's only a first attempt (in ba3054273c7a573cebffa35fcaccc89569d9cd24), but it should function ok. Most of the wording in the UI that says "Table" or "Tables" will probably need changing to be "Table/View" or "Tables/Views"... but that can come later. :smile:
I've updated the database, but the view don't update when i refresh the page, unless I select the view in list again.
BTW, I think there should be an option to make texts render as raw text, so the line breaks will work. And I'm glad to see the XSS filter works well
I've updated the database, but the view don't update when i refresh the page, unless I select the view in list again.
Oh. That's means there's a bug in the way we're pulling data out of cache. I can disable the cache for now to "make it work", but I'll need to investigate in more depth to find out a proper solution. I'll get that disabling done in a few minutes.
Also, I changed the display so it doesn't force all of the columns to the same width. Now desc
should take up the most room on the page. I'm not sure if that's better or not... if you don't like it, let me know and I'll change it back. :smile:
Ahhh... actually I know what the problem is. At the moment when a database is uploaded using DB4S, memcache doesn't get told about it so uses old data.
Working on a fix now. :smile:
It looks much better now, thanks! what about custom css
Custom CSS?
I need more details. :smile:
Yes, so I can decide how wide the second column should be, and more.
Hmmm, it's a good suggestion, but I think it would be difficult to implement at the moment.
We'd probably need to add some kind of form or field or "something" :wink: to the settings page, which lets a person pick settings for displaying their tables/views. That's probably a few days worth of development time.
Unless I am making it more complicated than it needs to be? If there's a simpler way, I'm open to suggestions. :smile:
@mercury233 Sort and paging now work for views too. eg clicking on a column header, or the arrows to go up/down/etc.
.table>thead>tr>th:nth-child(2) {
width: 20em;
}
.table>tbody>tr>td:nth-child(3) {
font-size: 12px;
}
I guess one field to post CSS like this, and one class for the main table, should be enough for me.
Anyway, custom css can change the page entirely, and will have much security problem, so it is just a idea...
Ahhh. That's probably do-able, but not today. :smile:
You're right we need to be careful with it. The code we use for stripping out potential XSS (and similar) is "bluemonday". We configure it with a few slightly custom rules so it doesn't strip out AngularJS tags from tables.
At a guess, we'll need to work out what "acceptable" custom CSS should be, then update our bluemonday configuration to allow that too. In theory that would work without opening up security problems. :smile:
Isn't that what codeMonkey or some development tools in a browswer can do? Adjust the CSS 'on the fly'?
Sure, but this is a different thing. @mercury233's idea is to have some kind of thing in the settings page for a database which lets custom css be defined, and that gets sent out with the rest of the page when people view a database. Thus customised looking views.
The concept sounds both useful and decent. Implementing it could be a bit tricky, as we need to make sure that if people add dodgy custom CSS (eg for cross site scripting or whatever), that it doesn't work.
That means we need the server side part to recognise dodgy CSS and barf on it. Or at least have a white list of acceptable CSS and only accept that. Otherwise we end up serving up potentially malicious code... (!)
Browser side development tools don't really fit into that particular equation, apart from the person figuring out what css they want to include in the first place. And well... anyone that wants custom CSS (at first) will need to be familiar with it already. :smile:
BTW, I think there should be an option to make texts render as raw text, so the line breaks will work.
Ahhh, I missed that. I'll investigate this today too. It should be possible. :smile:
@mercury233 Line breaks should be displayed ok now. :smile:
Closing this, as view support was added ages ago. :smile:
Now my database is hard to read in page because it have too much columns.
Can we use the "View" feature of sqlite to make it easier to read?