1.0.13
This commit is contained in:
1 parent
a88d3d5788
commit
8f3a7eb435
96 files changed
+5235
-1870
No files matched your search
@@ -159,6 +159,15 @@
|
||||
// Ulimits
|
||||
let ulimits = $state<{ name: string; soft: string; hard: string }[]>([]);
|
||||
|
||||
// GPU settings
|
||||
let gpuEnabled = $state(false);
|
||||
let gpuMode = $state<'all' | 'count' | 'specific'>('all');
|
||||
let gpuCount = $state(1);
|
||||
let gpuDeviceIds = $state<string[]>([]);
|
||||
let gpuDriver = $state('');
|
||||
let gpuCapabilities = $state<string[]>(['gpu']);
|
||||
let runtime = $state('');
|
||||
|
||||
let loading = $state(false);
|
||||
let errors = $state<{ name?: string; image?: string }>({});
|
||||
|
||||
@@ -405,6 +414,23 @@
|
||||
hard: parseInt(u.hard) || 0
|
||||
}));
|
||||
|
||||
let deviceRequests: any[] | undefined = undefined;
|
||||
if (gpuEnabled) {
|
||||
const dr: any = {
|
||||
capabilities: gpuCapabilities.length > 0 ? [gpuCapabilities] : [['gpu']],
|
||||
driver: gpuDriver || undefined
|
||||
};
|
||||
if (gpuMode === 'all') {
|
||||
dr.count = -1;
|
||||
} else if (gpuMode === 'count') {
|
||||
dr.count = gpuCount || 1;
|
||||
} else {
|
||||
dr.count = 0;
|
||||
dr.deviceIDs = gpuDeviceIds.filter(id => id.trim());
|
||||
}
|
||||
deviceRequests = [dr];
|
||||
}
|
||||
|
||||
const payload = {
|
||||
name: name.trim(),
|
||||
image: image.trim(),
|
||||
@@ -430,6 +456,8 @@
|
||||
capAdd: capAdd.length > 0 ? capAdd : undefined,
|
||||
capDrop: capDrop.length > 0 ? capDrop : undefined,
|
||||
devices: devices.length > 0 ? devices : undefined,
|
||||
deviceRequests,
|
||||
runtime: runtime || undefined,
|
||||
dns: dnsServers.length > 0 ? dnsServers : undefined,
|
||||
dnsSearch: dnsSearch.length > 0 ? dnsSearch : undefined,
|
||||
dnsOptions: dnsOptions.length > 0 ? dnsOptions : undefined,
|
||||
@@ -529,6 +557,13 @@
|
||||
dnsOptions = [];
|
||||
securityOptions = [];
|
||||
ulimits = [];
|
||||
gpuEnabled = false;
|
||||
gpuMode = 'all';
|
||||
gpuCount = 1;
|
||||
gpuDeviceIds = [];
|
||||
gpuDriver = '';
|
||||
gpuCapabilities = ['gpu'];
|
||||
runtime = '';
|
||||
// Reset pull/scan state
|
||||
activeTab = skipPullTab ? 'container' : 'pull';
|
||||
pullStatus = 'idle';
|
||||
@@ -564,7 +599,7 @@
|
||||
</script>
|
||||
|
||||
<Dialog.Root bind:open onOpenChange={(isOpen) => isOpen && focusFirstInput()}>
|
||||
<Dialog.Content class="max-w-4xl w-full max-h-[90vh] sm:max-h-[85vh] p-0 flex flex-col overflow-hidden !zoom-in-0 !zoom-out-0" showCloseButton={false}>
|
||||
<Dialog.Content class="max-w-4xl w-full h-[85vh] p-0 flex flex-col overflow-hidden !zoom-in-0 !zoom-out-0" showCloseButton={false}>
|
||||
<Dialog.Header class="px-5 py-4 border-b bg-muted/30 shrink-0 sticky top-0 z-10">
|
||||
<Dialog.Title class="text-base font-semibold">Create new container</Dialog.Title>
|
||||
<button
|
||||
@@ -706,6 +741,13 @@
|
||||
bind:capDrop
|
||||
bind:securityOptions
|
||||
bind:deviceMappings
|
||||
bind:gpuEnabled
|
||||
bind:gpuMode
|
||||
bind:gpuCount
|
||||
bind:gpuDeviceIds
|
||||
bind:gpuDriver
|
||||
bind:gpuCapabilities
|
||||
bind:runtime
|
||||
bind:dnsServers
|
||||
bind:dnsSearch
|
||||
bind:dnsOptions
|
||||
|
||||
Reference in new issue
Block a user