mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
feat(gpu): rework docker GPU for UI performance [EE-4918] (#8518)
This commit is contained in:
parent
769c8372fb
commit
fd916bc8a2
52 changed files with 692 additions and 285 deletions
|
@ -21,6 +21,7 @@ angular.module('portainer.docker').controller('CreateContainerController', [
|
|||
'$timeout',
|
||||
'$transition$',
|
||||
'$filter',
|
||||
'$analytics',
|
||||
'Container',
|
||||
'ContainerHelper',
|
||||
'Image',
|
||||
|
@ -35,6 +36,7 @@ angular.module('portainer.docker').controller('CreateContainerController', [
|
|||
'FormValidator',
|
||||
'RegistryService',
|
||||
'SystemService',
|
||||
'SettingsService',
|
||||
'PluginService',
|
||||
'HttpRequestHelper',
|
||||
'endpoint',
|
||||
|
@ -46,6 +48,7 @@ angular.module('portainer.docker').controller('CreateContainerController', [
|
|||
$timeout,
|
||||
$transition$,
|
||||
$filter,
|
||||
$analytics,
|
||||
Container,
|
||||
ContainerHelper,
|
||||
Image,
|
||||
|
@ -60,6 +63,7 @@ angular.module('portainer.docker').controller('CreateContainerController', [
|
|||
FormValidator,
|
||||
RegistryService,
|
||||
SystemService,
|
||||
SettingsService,
|
||||
PluginService,
|
||||
HttpRequestHelper,
|
||||
endpoint
|
||||
|
@ -1042,6 +1046,18 @@ angular.module('portainer.docker').controller('CreateContainerController', [
|
|||
});
|
||||
}
|
||||
|
||||
async function sendAnalytics() {
|
||||
const publicSettings = await SettingsService.publicSettings();
|
||||
const analyticsAllowed = publicSettings.EnableTelemetry;
|
||||
const image = `${$scope.formValues.RegistryModel.Registry.URL}/${$scope.formValues.RegistryModel.Image}`;
|
||||
if (analyticsAllowed && $scope.formValues.GPU.enabled) {
|
||||
$analytics.eventTrack('gpuContainerCreated', {
|
||||
category: 'docker',
|
||||
metadata: { gpu: $scope.formValues.GPU, containerImage: image },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function applyResourceControl(newContainer) {
|
||||
const userId = Authentication.getUserDetails().ID;
|
||||
const resourceControl = newContainer.Portainer.ResourceControl;
|
||||
|
@ -1101,7 +1117,8 @@ angular.module('portainer.docker').controller('CreateContainerController', [
|
|||
return validateForm(accessControlData, $scope.isAdmin);
|
||||
}
|
||||
|
||||
function onSuccess() {
|
||||
async function onSuccess() {
|
||||
await sendAnalytics();
|
||||
Notifications.success('Success', 'Container successfully created');
|
||||
$state.go('docker.containers', {}, { reload: true });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue