dbui-client 0.0.64

WASM web client sources for dbui
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::templates::card::card;

use anyhow::Result;
use maud::{html, Markup};

pub(crate) fn table(ctx: &crate::ctx::ClientContext, k: &str) -> Result<Markup> {
  Ok(html! {
    (card(ctx, html! {
      h3 {
        span.icon data-uk-icon=("icon: bookmark") {}
        " "
        (k)
      }
      a.(ctx.user_profile().link_class()) href="" onclick=(crate::html::onclick_event("run-sql", &format!("table-{}", k), &format!("'select * from {} limit 100'", k))) { "View First 100 Rows" }
    }))
    div#(format!("table-{}-results", k)) { }
  })
}