version: mark CoderAI 0.1.0 and surface it in the admin web UI

Add a canonical codai.__version__ = "0.1.0" as the single source of truth (kept
separate from Config.version, which is the config-schema/migration version). The
admin template renderer injects it as coderai_version, and base.html shows it as a
small "v0.1.0" pill next to the CoderAI logo on every page.
Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
parent a535c27f
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# Canonical product version for CoderAI — single source of truth. Both the API
# metadata and the admin web UI read from here.
__version__ = "0.1.0"
# Configure the CUDA caching allocator BEFORE torch is imported anywhere. # Configure the CUDA caching allocator BEFORE torch is imported anywhere.
# expandable_segments lets the allocator return freed pages to the driver even # expandable_segments lets the allocator return freed pages to the driver even
# from partially-used segments. Without it, a single small live tensor (e.g. a # from partially-used segments. Without it, a single small live tensor (e.g. a
......
...@@ -100,8 +100,10 @@ def _tmpl(request: Request, name: str, ctx: dict = None): ...@@ -100,8 +100,10 @@ def _tmpl(request: Request, name: str, ctx: dict = None):
picked up on a normal reload instead of being masked by the browser cache. picked up on a normal reload instead of being masked by the browser cache.
""" """
from codai.api.urlutils import get_public_prefix from codai.api.urlutils import get_public_prefix
from codai import __version__ as _coderai_version
c = ctx or {} c = ctx or {}
c.setdefault("root_path", get_public_prefix(request)) c.setdefault("root_path", get_public_prefix(request))
c.setdefault("coderai_version", _coderai_version)
resp = templates.TemplateResponse(request, name, c) resp = templates.TemplateResponse(request, name, c)
resp.headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0" resp.headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0"
resp.headers["Pragma"] = "no-cache" resp.headers["Pragma"] = "no-cache"
......
...@@ -54,6 +54,7 @@ body,.table-wrap,.modal-box,.chat-messages,.studio .model-list,.studio .chat-msg ...@@ -54,6 +54,7 @@ body,.table-wrap,.modal-box,.chat-messages,.studio .model-list,.studio .chat-msg
font-size:9px;font-weight:700;color:#fff;letter-spacing:-.01em; font-size:9px;font-weight:700;color:#fff;letter-spacing:-.01em;
} }
.nav-logo-name{font-size:13px;font-weight:700;letter-spacing:-.01em} .nav-logo-name{font-size:13px;font-weight:700;letter-spacing:-.01em}
.nav-logo-version{margin-left:6px;padding:1px 6px;border-radius:999px;font-size:10px;font-weight:600;line-height:1.4;color:var(--muted,#8b8f98);background:rgba(127,127,127,.14);letter-spacing:.01em}
/* nav links */ /* nav links */
.nav-links{display:flex;align-items:center;gap:1px} .nav-links{display:flex;align-items:center;gap:1px}
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<a href="{{ root_path }}/admin" class="nav-logo"> <a href="{{ root_path }}/admin" class="nav-logo">
<div class="nav-logo-mark">AI</div> <div class="nav-logo-mark">AI</div>
<span class="nav-logo-name">CoderAI</span> <span class="nav-logo-name">CoderAI</span>
{% if coderai_version %}<span class="nav-logo-version" title="CoderAI version">v{{ coderai_version }}</span>{% endif %}
</a> </a>
<div class="nav-links"> <div class="nav-links">
<a href="{{ root_path }}/admin" class="nav-link {% if request.url.path == '/admin' %}active{% endif %}">Overview</a> <a href="{{ root_path }}/admin" class="nav-link {% if request.url.path == '/admin' %}active{% endif %}">Overview</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment