platform/lms-adm-fe release promotion snapshot
This commit is contained in:
@@ -68,6 +68,7 @@ export function PlatformsPage({ session }: { session: AuthSession }) {
|
||||
const [selectedMasterId, setSelectedMasterId] = useState('');
|
||||
const [selectedAgentId, setSelectedAgentId] = useState('');
|
||||
const [platformName, setPlatformName] = useState('');
|
||||
const [createError, setCreateError] = useState<string | null>(null);
|
||||
const [agentsLoading, setAgentsLoading] = useState(false);
|
||||
const [agentsError, setAgentsError] = useState<string | null>(null);
|
||||
const [registrationCode, setRegistrationCode] = useState<string | null>(null);
|
||||
@@ -203,6 +204,7 @@ export function PlatformsPage({ session }: { session: AuthSession }) {
|
||||
};
|
||||
|
||||
const handleOpenCreateModal = () => {
|
||||
setCreateError(null);
|
||||
setModalOpen(true);
|
||||
setSelectedAgentId('');
|
||||
setAgents([]);
|
||||
@@ -222,6 +224,7 @@ export function PlatformsPage({ session }: { session: AuthSession }) {
|
||||
};
|
||||
|
||||
const handleCreatePlatform = async () => {
|
||||
setCreateError(null);
|
||||
if (!selectedMasterId) return;
|
||||
if (!selectedAgentId) {
|
||||
setAgentsError('플랫폼에 연결할 에이전트를 선택해 주세요.');
|
||||
@@ -244,7 +247,7 @@ export function PlatformsPage({ session }: { session: AuthSession }) {
|
||||
message: created?.name ?? masterPlatforms.find((platform) => platform.id === selectedMasterId)?.name,
|
||||
});
|
||||
} catch (reason) {
|
||||
setError(reason instanceof Error ? reason.message : '플랫폼을 등록하지 못했습니다.');
|
||||
setCreateError(reason instanceof Error ? reason.message : '플랫폼을 등록하지 못했습니다.');
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
@@ -674,6 +677,11 @@ export function PlatformsPage({ session }: { session: AuthSession }) {
|
||||
placeholder="예: F1Tenth #01"
|
||||
/>
|
||||
</label>
|
||||
{createError ? (
|
||||
<p role="alert" className="mt-3 rounded-md border border-[#fecdd3] bg-[#fff1f2] px-3 py-2 text-[12px] font-bold text-[#be123c]">
|
||||
{createError}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end gap-2 border-t border-[#cbd5e1] px-5 py-4">
|
||||
|
||||
Reference in New Issue
Block a user