fix(ui): allow editing network restriction in update modal
This commit is contained in:
@@ -683,6 +683,51 @@ function UpdateFunctionModal({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={`bg-gray-800/30 border border-cyan-600/50 rounded-lg p-4 ${
|
||||||
|
isHtmlFunction ? "opacity-50 pointer-events-none" : ""
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<span className="text-lg">🔒</span>
|
||||||
|
<div>
|
||||||
|
<p className="text-cyan-300 font-medium text-sm">
|
||||||
|
Restrict Network
|
||||||
|
</p>
|
||||||
|
<p className="text-cyan-400 text-xs">
|
||||||
|
Run the container with Docker network disabled
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="relative">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={networkRestricted}
|
||||||
|
onChange={(e) => setNetworkRestricted(e.target.checked)}
|
||||||
|
className="sr-only peer"
|
||||||
|
disabled={isLoading || isHtmlFunction}
|
||||||
|
id="network-restricted-update"
|
||||||
|
/>
|
||||||
|
<label
|
||||||
|
htmlFor="network-restricted-update"
|
||||||
|
className="w-12 h-6 bg-gray-600 rounded-full peer-checked:bg-gradient-to-r peer-checked:from-cyan-500 peer-checked:to-blue-500 transition-all duration-300 cursor-pointer flex items-center relative"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className={`absolute w-5 h-5 bg-white rounded-full shadow-md transition-transform duration-300 ${
|
||||||
|
networkRestricted ? "translate-x-6" : "translate-x-0.5"
|
||||||
|
}`}
|
||||||
|
></div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{isHtmlFunction && (
|
||||||
|
<p className="text-xs text-cyan-400 mt-1">
|
||||||
|
Network restrictions are disabled for HTML startup files
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* FFmpeg Install Toggle */}
|
{/* FFmpeg Install Toggle */}
|
||||||
<div
|
<div
|
||||||
className={`bg-gray-800/30 border border-purple-600/50 rounded-lg p-4 ${
|
className={`bg-gray-800/30 border border-purple-600/50 rounded-lg p-4 ${
|
||||||
|
|||||||
Reference in New Issue
Block a user