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
1 change: 1 addition & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ jobs:
deploy:
name: Deploy to AWS VM
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: [self-hosted, linux, x64, unsdg-runner]
timeout-minutes: 20
environment: production
Expand Down
54 changes: 36 additions & 18 deletions frontend/components/editModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,26 +302,44 @@ const EditModal: React.FC<EditModalProps> = ({
</div>

<div className="flex items-center gap-2 flex-shrink-0">
<label className="text-sm text-gray-600 font-medium">
Score:
</label>
<input
type="number"
min="0"
max="1"
step="0.001"
value={confidence}
onChange={(e) =>
<label className="text-sm text-gray-600 font-medium">
Score:
</label>

<input
type="number"
min="0"
max="1"
step="0.001"
value={confidence}
onChange={(e) => {
const rawValue = e.target.value;

if (rawValue === "") {
setEditableResults((prev) => ({
...prev,
[sdgKey]: { ...value, prediction: parseFloat(e.target.value) || 0 },
}))
[sdgKey]: { ...value, prediction: 0 },
}));
return;
}
className="w-20 px-2 py-1 border border-gray-300 rounded text-sm focus:outline-none focus:ring-2 focus:ring-[#5b92e5] focus:border-transparent"
/>
<span className="text-sm text-gray-500">
({Math.round(Number(confidence) * 100)}%)
</span>

const score = Number(rawValue);

if (!Number.isFinite(score)) return;

setEditableResults((prev) => ({
...prev,
[sdgKey]: {
...value,
prediction: Math.min(1, Math.max(0, score)),
},
}));
}}
className="w-20 px-2 py-1 border border-gray-300 rounded text-sm focus:outline-none focus:ring-2 focus:ring-[#5b92e5] focus:border-transparent"
/>
<span className="text-sm text-gray-500">
({Math.round(Number(confidence) * 100)}%)
</span>
<button
onClick={() => removeSDG(sdgKey)}
className="ml-2 text-red-500 hover:text-red-700 transition-colors"
Expand All @@ -337,7 +355,7 @@ const EditModal: React.FC<EditModalProps> = ({
<div
className="bg-[#5b92e5] h-2 rounded-full transition-all duration-300"
style={{
width: `${Math.round(Number(confidence) * 100)}%`,
width: `${Math.min(100, Math.max(0, Number(confidence) * 100 || 0))}%`,
}}
></div>
</div>
Expand Down
Loading