Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions monkeyai/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ADMIN_IMAGE ?= $(REGISTRY)/monkeyai-admin:$(TAG)
BACKEND_IMAGE ?= $(REGISTRY)/monkeyai-backend:$(TAG)
MIGRATE_IMAGE ?= $(REGISTRY)/monkeyai-migrate:$(TAG)
NGINX_ACME_IMAGE ?= $(REGISTRY)/nginx-acme:1.31.6-acme0.4.1-r1
PRIVATE_ROOT ?= ../..

.PHONY: image image-admin image-backend image-migrate image-nginx-acme push push-admin push-backend push-migrate push-nginx-acme images

Expand All @@ -24,10 +25,11 @@ image-admin:
image-backend:
docker buildx build \
--platform $(PLATFORM) \
--file $(PRIVATE_ROOT)/monkeyai/Dockerfile \
--tag $(BACKEND_IMAGE) \
--secret id=netrc,src=${HOME}/.netrc \
--load \
./backend
$(PRIVATE_ROOT)
@echo "Backend image: $(BACKEND_IMAGE)"

image-migrate:
Expand Down Expand Up @@ -63,10 +65,11 @@ push-admin:
push-backend:
docker buildx build \
--platform $(PLATFORM) \
--file $(PRIVATE_ROOT)/monkeyai/Dockerfile \
--tag $(BACKEND_IMAGE) \
--secret id=netrc,src=${HOME}/.netrc \
--push \
./backend
$(PRIVATE_ROOT)
@echo "Pushed: $(BACKEND_IMAGE)"

push-migrate:
Expand Down
3 changes: 3 additions & 0 deletions monkeyai/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { BillingSettingsPage } from "@/pages/billing-settings-page"
import { ExpertsPage } from "@/pages/experts-page"
import { KnowledgeBasesPage } from "@/pages/knowledge-bases-page"
import { LoginPage } from "@/pages/login-page"
import { LicensePage } from "@/pages/license-page"
import { ClientLoginPage } from "@/pages/client-login-page"
import { MembersAndGroupsPage } from "@/pages/members-and-groups-page"
import { ModelStatisticsPage } from "@/pages/model-statistics-page"
Expand Down Expand Up @@ -133,6 +134,8 @@ export function App() {
<OperationLogsPage />
) : page.path === CONSOLE_ROUTES.otherSettings ? (
<OtherSettingsPage />
) : page.path === CONSOLE_ROUTES.license ? (
<LicensePage />
) : (
<ConsolePage />
)
Expand Down
4 changes: 4 additions & 0 deletions monkeyai/admin/src/components/app-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ export function AppSidebar({
title: t("pages.otherSettings.title"),
url: CONSOLE_ROUTES.otherSettings,
},
{
title: t("pages.license.title"),
url: CONSOLE_ROUTES.license,
},
],
},
]
Expand Down
43 changes: 43 additions & 0 deletions monkeyai/admin/src/components/ui/file-input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { useId, useRef } from "react"

import { Button } from "@/components/ui/button"

type FileInputProps = {
accept?: string
chooseLabel: string
file: File | null
onChange: (file: File | null) => void
}

export function FileInput({
accept,
chooseLabel,
file,
onChange,
}: FileInputProps) {
const inputId = useId()
const inputRef = useRef<HTMLInputElement>(null)

return (
<div className="flex min-w-0 items-center gap-3">
<input
ref={inputRef}
id={inputId}
className="sr-only"
type="file"
accept={accept}
onChange={(event) => onChange(event.target.files?.[0] ?? null)}
/>
<Button
type="button"
variant="outline"
onClick={() => inputRef.current?.click()}
>
{chooseLabel}
</Button>
<span className="min-w-0 truncate text-sm text-muted-foreground">
{file?.name ?? "—"}
</span>
</div>
)
}
1 change: 1 addition & 0 deletions monkeyai/admin/src/i18n/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const ar = {
systemSettings: "إعدادات النظام",
},
pages: {
license: enUS.pages.license,
realtimeStatus: {
title: "الحالة المباشرة",
description: "راقب أداء النماذج ونشاط المنتج خلال الساعة الأخيرة.",
Expand Down
1 change: 1 addition & 0 deletions monkeyai/admin/src/i18n/locales/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const deDE = {
systemSettings: "Systemeinstellungen",
},
pages: {
license: enUS.pages.license,
realtimeStatus: {
title: "Live-Status",
description:
Expand Down
27 changes: 27 additions & 0 deletions monkeyai/admin/src/i18n/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,33 @@ export const enUS = {
systemSettings: "System Settings",
},
pages: {
license: {
title: "License",
description: "View seats and validity, and upload a new license file.",
status: "License status",
states: { missing: "Missing", valid: "Valid", expired: "Expired", invalid: "Invalid" },
seats: "Member seats",
client: "Licensed customer",
licenseId: "License ID",
validFrom: "Valid from",
validUntil: "Valid until",
loading: "Loading license information…",
refresh: "Refresh",
machineTitle: "Machine code",
machineDescription: "Provide this machine code when requesting a license.",
machineCode: "Current machine code",
machineHint: "This code identifies the current deployment.",
copy: "Copy machine code",
machineCodeCopied: "Machine code copied",
copyFailed: "Could not copy. Please copy the code manually.",
importTitle: "Import license",
importDescription: "Choose a platform-issued .lic file to replace the current license after validation.",
file: "License file",
chooseFile: "Choose file",
import: "Import",
importing: "Validating and importing…",
importSuccess: "License imported",
},
realtimeStatus: {
title: "Live Status",
description:
Expand Down
1 change: 1 addition & 0 deletions monkeyai/admin/src/i18n/locales/es-419.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export const es419 = {
systemSettings: "Configuración del sistema",
},
pages: {
license: enUS.pages.license,
realtimeStatus: {
title: "Estado en tiempo real",
description:
Expand Down
1 change: 1 addition & 0 deletions monkeyai/admin/src/i18n/locales/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const frFR = {
systemSettings: "Paramètres système",
},
pages: {
license: enUS.pages.license,
realtimeStatus: {
title: "État en temps réel",
description:
Expand Down
1 change: 1 addition & 0 deletions monkeyai/admin/src/i18n/locales/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export const jaJP = {
systemSettings: "システム設定",
},
pages: {
license: enUS.pages.license,
realtimeStatus: {
title: "リアルタイム状態",
description:
Expand Down
1 change: 1 addition & 0 deletions monkeyai/admin/src/i18n/locales/ko-KR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const koKR = {
systemSettings: "시스템 설정",
},
pages: {
license: enUS.pages.license,
realtimeStatus: {
title: "실시간 상태",
description: "최근 1시간의 모델 성능과 서비스 활동을 확인합니다.",
Expand Down
1 change: 1 addition & 0 deletions monkeyai/admin/src/i18n/locales/ru-RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export const ruRU = {
systemSettings: "Системные настройки",
},
pages: {
license: enUS.pages.license,
realtimeStatus: {
title: "Состояние в реальном времени",
description:
Expand Down
27 changes: 27 additions & 0 deletions monkeyai/admin/src/i18n/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,33 @@ export const zhCN = {
systemSettings: "系统设置",
},
pages: {
license: {
title: "License 管理",
description: "查看授权席位与有效期,上传新的 License 文件。",
status: "授权状态",
states: { missing: "未授权", valid: "有效", expired: "已过期", invalid: "无效" },
seats: "成员席位数",
client: "授权客户",
licenseId: "License ID",
validFrom: "生效时间",
validUntil: "到期时间",
loading: "正在读取授权信息…",
refresh: "刷新",
machineTitle: "机器码",
machineDescription: "申请授权时请提供此机器码。",
machineCode: "当前机器码",
machineHint: "机器码与此部署实例绑定。",
copy: "复制机器码",
machineCodeCopied: "机器码已复制",
copyFailed: "复制失败,请手动复制机器码",
importTitle: "导入 License",
importDescription: "请选择平台签发的 .lic 文件,验证通过后替换现有授权。",
file: "License 文件",
chooseFile: "选择文件",
import: "导入",
importing: "正在验证并导入…",
importSuccess: "License 导入成功",
},
realtimeStatus: {
title: "实时状态",
description: "查看最近一小时内的模型运行与业务活跃状态。",
Expand Down
1 change: 1 addition & 0 deletions monkeyai/admin/src/i18n/locales/zh-TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const zhTW = {
systemSettings: "系統設定",
},
pages: {
license: enUS.pages.license,
realtimeStatus: {
title: "即時狀態",
description: "查看最近一小時內的模型運行與業務活躍狀態。",
Expand Down
8 changes: 8 additions & 0 deletions monkeyai/admin/src/lib/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const CONSOLE_ROUTES = {
membersAndGroups: "/console/settings/members",
operationLogs: "/console/settings/operation-logs",
otherSettings: "/console/settings/other",
license: "/console/settings/license",
} as const

export const DEFAULT_CONSOLE_PATH = CONSOLE_ROUTES.realtimeStatus
Expand Down Expand Up @@ -127,6 +128,13 @@ export const CONSOLE_PAGES = [
titleKey: "pages.otherSettings.title",
descriptionKey: "pages.otherSettings.description",
},
{
path: CONSOLE_ROUTES.license,
sectionKey: "sections.systemSettings",
sectionPath: CONSOLE_ROUTES.membersAndGroups,
titleKey: "pages.license.title",
descriptionKey: "pages.license.description",
},
] as const

export function getConsolePage(pathname: string) {
Expand Down
Loading
Loading