Major rebranding, i18n, dashboard, shared folders, role capabilities
- Rebrand: new app/agent icons, SKALD.md, warm "paper" CSS palette (terracotta accent, --radius tokens, WCAG contrast, reduced-motion), updated favicon, tray icon, skaldkonur asset - i18n: backend crate (i18n.rs, locale column, ui_locale config), frontend library (web/lib/i18n.js, I18nMixin, t(key)), translation files (web/i18n/), every component wired - Dashboard: <dashboard-page> replaces old home-page content; <app-copilot> becomes the landing page (full/dock layout modes) - Shared folders: API endpoints (shared_folders.rs), frontend page, can_write membership, container mount topology, user_fs routing - Role capabilities: new db table & authorization seam (data not enums), roles.attrs JSON for ui_mode / interface select - Setup: skald-setup prompts for language + password, sets ui_locale - General: components migrated to CSS variables, Lit conventions cleanup, connectors/catalog/marketplace/approval refactoring
This commit is contained in:
@@ -30,6 +30,9 @@ pub struct CreateUserBody {
|
||||
pub password: String,
|
||||
#[serde(default)]
|
||||
pub encrypted: bool,
|
||||
/// Chosen interface language — becomes the instance default (`ui_locale`).
|
||||
#[serde(default)]
|
||||
pub locale: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
@@ -54,11 +57,23 @@ pub async fn create_user(
|
||||
if body.password.is_empty() {
|
||||
return Err(ApiError::bad_request("password must not be empty"));
|
||||
}
|
||||
let locale = body.locale.as_deref().map(str::trim).filter(|s| !s.is_empty());
|
||||
if let Some(l) = locale {
|
||||
if !skald_core::i18n::is_supported(l) {
|
||||
return Err(ApiError::bad_request("unsupported locale"));
|
||||
}
|
||||
}
|
||||
|
||||
let id = skald
|
||||
.users()
|
||||
.register_user(username, None, "admin", Some(&body.password), body.encrypted)
|
||||
.await?;
|
||||
|
||||
// The first-run language choice is instance-wide: it lands in the registry
|
||||
// config as the default every user follows until they override it.
|
||||
if let Some(l) = locale {
|
||||
skald.config().set(skald_core::i18n::DEFAULT_LOCALE_KEY, l).await?;
|
||||
}
|
||||
|
||||
Ok(Json(CreateUserResult { user_id: id }))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user