尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证正在加载完整 README。 以下为已保存的摘录。
Admin toolkit for Rust, server-rendered on Topcoat (UI and reactivity) and Toasty
(ORM). Declare a resource per model and get its list, create, edit, detail and delete pages, with
no SPA build step.
Run the showcase, a blog's admin panel that exercises every feature, through the Topcoat CLI:
topcoat dev builds the showcase, bundles its assets beside the binary, serves it, and rebuilds it
when a source file changes. cargo run -p showcase alone stops with an error: it finds no asset
bundle.查看完整 README ↗Admin toolkit for Rust, server-rendered on Topcoat (UI and reactivity) and Toasty (ORM). Declare a resource per model and get its list, create, edit, detail and delete pages, with no SPA build step.
Tablo is experimental: until 1.0, a minor version may break the API.
Tablo needs Rust 1.99 or newer; every crate declares that as its rust-version.
Run the showcase, a blog's admin panel that exercises every feature, through the Topcoat CLI:
cargo install topcoat-cli --version 0.11 --locked
topcoat dev -p showcase
# open http://localhost:3000/admin/users
topcoat dev builds the showcase, bundles its assets beside the binary, serves it, and rebuilds it
when a source file changes. cargo run -p showcase alone stops with an error: it finds no asset
bundle.
Depend on the tablo facade, pick a database driver, and build the stylesheet with tablo-build
(the first-panel chapter has the full manifest, including the
topcoat and toasty pins):
cargo add tablo --features sqlite
cargo add --build tablo-build
sqlite, postgresql, mysql and turso each turn on Toasty's driver of the same name; the
toolkit enables none of them itself, and the testing feature adds the in-memory client
tablo::testing.
examples/quickstart is the smallest complete app; CI builds it from outside this repository.
A model derives the table and detail page it reads as by default, and a resource names it, its form and its policy:
use tablo::prelude::*;
#[derive(Debug, Clone, toasty::Model, tablo::ModelColumns)]
pub struct User {
#[key]
#[auto]
pub id: uuid::Uuid,
pub name: String,
#[default(jiff::Timestamp::now())]
pub created_at: jiff::Timestamp,
}
pub struct UserResource;
impl Resource for UserResource {
type Model = User;
type Form = NoForm<Self::Model>; // list-only: no create or edit pages
fn declare() -> ResourceDef<Self> {
ResourceDef::new().policy(ReadOnly) // the default policy denies everything
}
}
The panel registers it and frames its pages in the shell, and the app mounts the panel on its own router, beside its other routes:
fn router(db: toasty::Db) -> topcoat::Result<Router> {
Ok(Router::builder()
.discover()
.with(db)
.panel(
Panel::new("admin")
.resource::<UserResource>()
.auth(Auth::disabled()), // drop this line to require a login
)?
.build())
}
One router mounts several panels at distinct prefixes, each with its own resources, shell and
login. To add create and edit pages, derive tablo::ModelForm on the model, name the UserForm it
writes as the resource's Form, and give it a policy that allows Create and Update. The
first panel chapter builds a complete app with forms and login.
mdbook build docs/guide.view!,
#[component], routing, cookies and sessions).Small fixes can go straight to a pull request; open an issue first for larger changes. The contributing guide covers the layout, the checks and the rules.
MIT — see LICENSE.