diff --git a/api/cmd/portainer/main.go b/api/cmd/portainer/main.go index 60bb071e1..7c956a05c 100644 --- a/api/cmd/portainer/main.go +++ b/api/cmd/portainer/main.go @@ -127,6 +127,7 @@ func initSettings(settingsService portainer.SettingsService, flags *portainer.CL if err == portainer.ErrSettingsNotFound { settings := &portainer.Settings{ LogoURL: *flags.Logo, + DisplayDonationHeader: true, DisplayExternalContributors: false, AuthenticationMethod: portainer.AuthenticationInternal, LDAPSettings: portainer.LDAPSettings{ diff --git a/api/http/handler/settings.go b/api/http/handler/settings.go index 5e47c92f5..40b14977b 100644 --- a/api/http/handler/settings.go +++ b/api/http/handler/settings.go @@ -46,6 +46,7 @@ func NewSettingsHandler(bouncer *security.RequestBouncer) *SettingsHandler { type ( publicSettingsResponse struct { LogoURL string `json:"LogoURL"` + DisplayDonationHeader bool `json:"DisplayDonationHeader"` DisplayExternalContributors bool `json:"DisplayExternalContributors"` AuthenticationMethod portainer.AuthenticationMethod `json:"AuthenticationMethod"` AllowBindMountsForRegularUsers bool `json:"AllowBindMountsForRegularUsers"` @@ -56,6 +57,7 @@ type ( TemplatesURL string `valid:"required"` LogoURL string `valid:""` BlackListedLabels []portainer.Pair `valid:""` + DisplayDonationHeader bool `valid:""` DisplayExternalContributors bool `valid:""` AuthenticationMethod int `valid:"required"` LDAPSettings portainer.LDAPSettings `valid:""` @@ -90,6 +92,7 @@ func (handler *SettingsHandler) handleGetPublicSettings(w http.ResponseWriter, r publicSettings := &publicSettingsResponse{ LogoURL: settings.LogoURL, + DisplayDonationHeader: settings.DisplayDonationHeader, DisplayExternalContributors: settings.DisplayExternalContributors, AuthenticationMethod: settings.AuthenticationMethod, AllowBindMountsForRegularUsers: settings.AllowBindMountsForRegularUsers, @@ -118,6 +121,7 @@ func (handler *SettingsHandler) handlePutSettings(w http.ResponseWriter, r *http TemplatesURL: req.TemplatesURL, LogoURL: req.LogoURL, BlackListedLabels: req.BlackListedLabels, + DisplayDonationHeader: req.DisplayDonationHeader, DisplayExternalContributors: req.DisplayExternalContributors, LDAPSettings: req.LDAPSettings, AllowBindMountsForRegularUsers: req.AllowBindMountsForRegularUsers, diff --git a/api/portainer.go b/api/portainer.go index c437f0df6..751043810 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -73,6 +73,7 @@ type ( TemplatesURL string `json:"TemplatesURL"` LogoURL string `json:"LogoURL"` BlackListedLabels []Pair `json:"BlackListedLabels"` + DisplayDonationHeader bool `json:"DisplayDonationHeader"` DisplayExternalContributors bool `json:"DisplayExternalContributors"` AuthenticationMethod AuthenticationMethod `json:"AuthenticationMethod"` LDAPSettings LDAPSettings `json:"LDAPSettings"` @@ -389,7 +390,7 @@ type ( const ( // APIVersion is the version number of the Portainer API. - APIVersion = "1.15.2" + APIVersion = "1.15.3" // DBVersion is the version number of the Portainer database. DBVersion = 6 // DefaultTemplatesURL represents the default URL for the templates definitions. diff --git a/api/swagger.yaml b/api/swagger.yaml index 3e5abf7fc..28504caf4 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -56,7 +56,7 @@ info: **NOTE**: You can find more information on how to query the Docker API in the [Docker official documentation](https://docs.docker.com/engine/api/v1.30/) as well as in [this Portainer example](https://gist.github.com/deviantony/77026d402366b4b43fa5918d41bc42f8). - version: "1.15.2" + version: "1.15.3" title: "Portainer API" contact: email: "info@portainer.io" @@ -1869,7 +1869,7 @@ definitions: description: "Is analytics enabled" Version: type: "string" - example: "1.15.2" + example: "1.15.3" description: "Portainer API version" PublicSettingsInspectResponse: type: "object" @@ -1880,6 +1880,10 @@ definitions: description: "URL to a logo that will be displayed on the login page as well\ \ as on top of the sidebar. Will use default Portainer logo when value is\ \ empty string" + DisplayDonationHeader: + type: "boolean" + example: true + description: "Whether to display or not the donation message in the header."\ DisplayExternalContributors: type: "boolean" example: false @@ -1983,6 +1987,10 @@ definitions: \ when querying containers" items: $ref: "#/definitions/Settings_BlackListedLabels" + DisplayDonationHeader: + type: "boolean" + example: true + description: "Whether to display or not the donation message in the header." DisplayExternalContributors: type: "boolean" example: false @@ -2398,6 +2406,10 @@ definitions: \ when querying containers" items: $ref: "#/definitions/Settings_BlackListedLabels" + DisplayDonationHeader: + type: "boolean" + example: true + description: "Whether to display or not the donation message in the header." DisplayExternalContributors: type: "boolean" example: false diff --git a/app/components/about/about.html b/app/components/about/about.html new file mode 100644 index 000000000..918c8532a --- /dev/null +++ b/app/components/about/about.html @@ -0,0 +1,100 @@ + + + + + About Portainer + + + +
+
+ + + Portainer is a free and open-source software brought to you with by portainer.io and contributors. + + +
+
+ +
+
+ + + +
+

+ It is a community effort to make Portainer as feature-rich as simple it is to deploy and use. We need all the help we can get! +

+

+ Fund our work +

+

+

+ Contribute +

+

+

+ Spread the word +

    +
  • Talk to your friends and colleagues about how awesome Portainer is!
  • +
  • Follow us on Twitter
  • +
+

+
+
+
+
+
+ +
+
+ + + +
+

+ Documentation +

+

+

+ Community support +

+

+

+ Services +

+

+
+
+
+
+
+ +
+
+ + + +
+ Portainer has full support for Docker >=1.10 and Docker Swarm >= 1.2.3, and partial support for Docker 1.9 (some features may not be available). +
+
+
+
+
diff --git a/app/components/configs/configs.html b/app/components/configs/configs.html index 9c5fb4624..07093c63d 100644 --- a/app/components/configs/configs.html +++ b/app/components/configs/configs.html @@ -51,7 +51,7 @@ - + {{ config.Name }} {{ config.CreatedAt | getisodate }} diff --git a/app/components/container/container.html b/app/components/container/container.html index 15d960dda..f3f19fa93 100644 --- a/app/components/container/container.html +++ b/app/components/container/container.html @@ -12,15 +12,17 @@
- - - - - - - - - + + + + + + + +
+
+ +
diff --git a/app/components/containers/containers.html b/app/components/containers/containers.html index 2e5cb8491..d8bfcd681 100644 --- a/app/components/containers/containers.html +++ b/app/components/containers/containers.html @@ -32,7 +32,7 @@ - Add container + Add container
@@ -109,7 +109,7 @@ - + {{ container.Status }} diff --git a/app/components/createConfig/createConfigController.js b/app/components/createConfig/createConfigController.js index 6d390f97f..071b38bdd 100644 --- a/app/components/createConfig/createConfigController.js +++ b/app/components/createConfig/createConfigController.js @@ -60,7 +60,7 @@ function ($scope, $state, $document, Notifications, ConfigService, Authenticatio $scope.create = function () { var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); - var isAdmin = userDetails.role === 1 ? true : false; + var isAdmin = userDetails.role === 1; if (!validateForm(accessControlData, isAdmin)) { return; diff --git a/app/components/createContainer/createContainerController.js b/app/components/createContainer/createContainerController.js index 65c9fe817..17fba00ce 100644 --- a/app/components/createContainer/createContainerController.js +++ b/app/components/createContainer/createContainerController.js @@ -349,6 +349,12 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai } } + $scope.resetNetworkConfig = function() { + $scope.config.NetworkingConfig = { + EndpointsConfig: {} + }; + }; + function loadFromContainerNetworkConfig(d) { $scope.config.NetworkingConfig = { EndpointsConfig: {} @@ -550,7 +556,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai }); var userDetails = Authentication.getUserDetails(); - $scope.isAdmin = userDetails.role === 1 ? true : false; + $scope.isAdmin = userDetails.role === 1; } function validateForm(accessControlData, isAdmin) { @@ -574,7 +580,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); - var isAdmin = userDetails.role === 1 ? true : false; + var isAdmin = userDetails.role === 1; if (!validateForm(accessControlData, isAdmin)) { return; diff --git a/app/components/createContainer/createcontainer.html b/app/components/createContainer/createcontainer.html index 9f6edae53..32b329c94 100644 --- a/app/components/createContainer/createcontainer.html +++ b/app/components/createContainer/createcontainer.html @@ -9,7 +9,7 @@
-
+
@@ -28,7 +28,7 @@
- +
@@ -296,7 +296,7 @@
- diff --git a/app/components/createNetwork/createNetworkController.js b/app/components/createNetwork/createNetworkController.js index a973e4632..eedb272ca 100644 --- a/app/components/createNetwork/createNetworkController.js +++ b/app/components/createNetwork/createNetworkController.js @@ -93,7 +93,7 @@ function ($q, $scope, $state, PluginService, Notifications, NetworkService, Labe var networkConfiguration = prepareConfiguration(); var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); - var isAdmin = userDetails.role === 1 ? true : false; + var isAdmin = userDetails.role === 1; if (!validateForm(accessControlData, isAdmin)) { return; diff --git a/app/components/createSecret/createSecretController.js b/app/components/createSecret/createSecretController.js index de81a7bc3..18c9d3903 100644 --- a/app/components/createSecret/createSecretController.js +++ b/app/components/createSecret/createSecretController.js @@ -59,7 +59,7 @@ function ($scope, $state, Notifications, SecretService, LabelHelper, Authenticat var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); - var isAdmin = userDetails.role === 1 ? true : false; + var isAdmin = userDetails.role === 1; if (!validateForm(accessControlData, isAdmin)) { return; diff --git a/app/components/createService/createServiceController.js b/app/components/createService/createServiceController.js index 24f8a7e0e..09ff3805a 100644 --- a/app/components/createService/createServiceController.js +++ b/app/components/createService/createServiceController.js @@ -82,7 +82,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C }; $scope.addSecret = function() { - $scope.formValues.Secrets.push({}); + $scope.formValues.Secrets.push({ overrideTarget: false }); }; $scope.removeSecret = function(index) { @@ -243,7 +243,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C function prepareUpdateConfig(config, input) { config.UpdateConfig = { Parallelism: input.Parallelism || 0, - Delay: input.UpdateDelay || 0, + Delay: input.UpdateDelay * 1000000000 || 0, FailureAction: input.FailureAction, Order: input.UpdateOrder }; @@ -275,6 +275,9 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C if (secret.model) { var s = SecretHelper.secretConfig(secret.model); s.File.Name = s.SecretName; + if (secret.overrideTarget && secret.target && secret.target !== '') { + s.File.Name = secret.target; + } secrets.push(s); } }); @@ -387,7 +390,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); - var isAdmin = userDetails.role === 1 ? true : false; + var isAdmin = userDetails.role === 1; if (!validateForm(accessControlData, isAdmin)) { return; @@ -443,7 +446,7 @@ function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, C var settings = data.settings; $scope.allowBindMounts = settings.AllowBindMountsForRegularUsers; var userDetails = Authentication.getUserDetails(); - $scope.isAdmin = userDetails.role === 1 ? true : false; + $scope.isAdmin = userDetails.role === 1; }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to initialize view'); diff --git a/app/components/createService/createservice.html b/app/components/createService/createservice.html index e89dd5a07..196e97506 100644 --- a/app/components/createService/createservice.html +++ b/app/components/createService/createservice.html @@ -9,7 +9,7 @@
- +
@@ -23,7 +23,7 @@
- +
@@ -395,7 +395,7 @@

- Amount of time between updates. + Amount of time between updates. Time in seconds.

diff --git a/app/components/createService/includes/secret.html b/app/components/createService/includes/secret.html index fdf95a01d..aca1f5264 100644 --- a/app/components/createService/includes/secret.html +++ b/app/components/createService/includes/secret.html @@ -1,7 +1,7 @@
- Secrets will be available under /run/secrets/$SECRET_NAME in containers. + By default, secrets will be available under /run/secrets/$SECRET_NAME in containers.
@@ -12,16 +12,26 @@
-
+
secret
- +
+ target + +
+
+
+ + +
+ +
diff --git a/app/components/createStack/createStackController.js b/app/components/createStack/createStackController.js index 04f487490..ba2ccf5ba 100644 --- a/app/components/createStack/createStackController.js +++ b/app/components/createStack/createStackController.js @@ -67,7 +67,7 @@ function ($scope, $state, $document, StackService, CodeMirrorService, Authentica var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); - var isAdmin = userDetails.role === 1 ? true : false; + var isAdmin = userDetails.role === 1; var userId = userDetails.ID; if (!validateForm(accessControlData, isAdmin)) { diff --git a/app/components/createVolume/createVolumeController.js b/app/components/createVolume/createVolumeController.js index bffdf874e..491276484 100644 --- a/app/components/createVolume/createVolumeController.js +++ b/app/components/createVolume/createVolumeController.js @@ -43,7 +43,7 @@ function ($q, $scope, $state, VolumeService, PluginService, ResourceControlServi var volumeConfiguration = VolumeService.createVolumeConfiguration(name, driver, driverOptions); var accessControlData = $scope.formValues.AccessControlData; var userDetails = Authentication.getUserDetails(); - var isAdmin = userDetails.role === 1 ? true : false; + var isAdmin = userDetails.role === 1; if (!validateForm(accessControlData, isAdmin)) { return; diff --git a/app/components/endpoints/endpoints.html b/app/components/endpoints/endpoints.html index 5f9f0a183..921a00397 100644 --- a/app/components/endpoints/endpoints.html +++ b/app/components/endpoints/endpoints.html @@ -128,7 +128,7 @@ - + {{ endpoint.Name }} {{ endpoint.URL | stripprotocol }} diff --git a/app/components/images/images.html b/app/components/images/images.html index acafa7ae0..793da3767 100644 --- a/app/components/images/images.html +++ b/app/components/images/images.html @@ -122,7 +122,7 @@ - + {{ image.Id|truncate:20}} diff --git a/app/components/networks/networks.html b/app/components/networks/networks.html index ce2f9ce35..0c30c2d4b 100644 --- a/app/components/networks/networks.html +++ b/app/components/networks/networks.html @@ -98,7 +98,7 @@ - + {{ network.Name | truncate:40 }} {{ network.StackName ? network.StackName : '-' }} diff --git a/app/components/registries/registries.html b/app/components/registries/registries.html index e350b83a3..caa3935db 100644 --- a/app/components/registries/registries.html +++ b/app/components/registries/registries.html @@ -118,7 +118,7 @@ - + {{ registry.Name }} diff --git a/app/components/service/includes/restart.html b/app/components/service/includes/restart.html index e25b0e0dc..1e5293bda 100644 --- a/app/components/service/includes/restart.html +++ b/app/components/service/includes/restart.html @@ -51,7 +51,7 @@

- The time window used to evaluate the restart policy (default value is 0, which is unbounded). + The time window used to evaluate the restart policy (default value is 0, which is unbounded). Time in seconds.

diff --git a/app/components/service/includes/secrets.html b/app/components/service/includes/secrets.html index 4a2d16572..2383345b4 100644 --- a/app/components/service/includes/secrets.html +++ b/app/components/service/includes/secrets.html @@ -5,10 +5,18 @@ diff --git a/app/components/service/includes/updateconfig.html b/app/components/service/includes/updateconfig.html index 469b715d2..92b6ff34b 100644 --- a/app/components/service/includes/updateconfig.html +++ b/app/components/service/includes/updateconfig.html @@ -23,7 +23,7 @@

- Amount of time between updates. + Amount of time between updates. Time in seconds.

diff --git a/app/components/service/service.html b/app/components/service/service.html index 9cf5c4c00..b5d1a8d90 100644 --- a/app/components/service/service.html +++ b/app/components/service/service.html @@ -68,7 +68,8 @@ Image - + diff --git a/app/components/service/serviceController.js b/app/components/service/serviceController.js index cca9cbb64..761c7f708 100644 --- a/app/components/service/serviceController.js +++ b/app/components/service/serviceController.js @@ -1,12 +1,13 @@ angular.module('service', []) -.controller('ServiceController', ['$q', '$scope', '$transition$', '$state', '$location', '$timeout', '$anchorScroll', 'ServiceService', 'ConfigService', 'ConfigHelper', 'SecretService', 'SecretHelper', 'Service', 'ServiceHelper', 'LabelHelper', 'TaskService', 'NodeService', 'Notifications', 'Pagination', 'ModalService', -function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, ServiceService, ConfigService, ConfigHelper, SecretService, SecretHelper, Service, ServiceHelper, LabelHelper, TaskService, NodeService, Notifications, Pagination, ModalService) { +.controller('ServiceController', ['$q', '$scope', '$transition$', '$state', '$location', '$timeout', '$anchorScroll', 'ServiceService', 'ConfigService', 'ConfigHelper', 'SecretService', 'ImageService', 'SecretHelper', 'Service', 'ServiceHelper', 'LabelHelper', 'TaskService', 'NodeService', 'Notifications', 'Pagination', 'ModalService', +function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, ServiceService, ConfigService, ConfigHelper, SecretService, ImageService, SecretHelper, Service, ServiceHelper, LabelHelper, TaskService, NodeService, Notifications, Pagination, ModalService) { $scope.state = {}; $scope.state.pagination_count = Pagination.getPaginationCount('service_tasks'); $scope.tasks = []; $scope.sortType = 'Updated'; $scope.sortReverse = true; + $scope.availableImages = []; $scope.lastVersion = 0; @@ -74,10 +75,16 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, $scope.updateConfig = function updateConfig(service) { updateServiceArray(service, 'ServiceConfigs', service.ServiceConfigs); }; - $scope.addSecret = function addSecret(service, secret) { - if (secret && service.ServiceSecrets.filter(function(serviceSecret) { return serviceSecret.Id === secret.Id;}).length === 0) { - service.ServiceSecrets.push({ Id: secret.Id, Name: secret.Name, FileName: secret.Name, Uid: '0', Gid: '0', Mode: 444 }); - updateServiceArray(service, 'ServiceSecrets', service.ServiceSecrets); + $scope.addSecret = function addSecret(service, newSecret) { + if (newSecret.secret) { + var filename = newSecret.secret.Name; + if (newSecret.override) { + filename = newSecret.target; + } + if (service.ServiceSecrets.filter(function(serviceSecret) { return serviceSecret.Id === newSecret.secret.Id && serviceSecret.FileName === filename;}).length === 0) { + service.ServiceSecrets.push({ Id: newSecret.secret.Id, Name: newSecret.secret.Name, FileName: filename, Uid: '0', Gid: '0', Mode: 444 }); + updateServiceArray(service, 'ServiceSecrets', service.ServiceSecrets); + } } }; $scope.removeSecret = function removeSecret(service, index) { @@ -237,16 +244,16 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, config.UpdateConfig = { Parallelism: service.UpdateParallelism, - Delay: service.UpdateDelay, + Delay: service.UpdateDelay * 1000000000, FailureAction: service.UpdateFailureAction, Order: service.UpdateOrder }; config.TaskTemplate.RestartPolicy = { Condition: service.RestartCondition, - Delay: service.RestartDelay, + Delay: service.RestartDelay * 1000000000, MaxAttempts: service.RestartMaxAttempts, - Window: service.RestartWindow + Window: service.RestartWindow * 1000000000 }; if (service.Ports) { @@ -313,6 +320,12 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, service.LimitMemoryBytes = service.LimitMemoryBytes / 1024 / 1024 || 0; service.ReservationMemoryBytes = service.ReservationMemoryBytes / 1024 / 1024 || 0; } + + function transformDurations(service) { + service.RestartDelay = service.RestartDelay / 1000000000 || 5; + service.RestartWindow = service.RestartWindow / 1000000000 || 0; + service.UpdateDelay = service.UpdateDelay / 1000000000 || 0; + } function initView() { var apiVersion = $scope.applicationState.endpoint.apiVersion; @@ -326,6 +339,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, transformResources(service); translateServiceArrays(service); + transformDurations(service); $scope.service = service; originalService = angular.copy(service); @@ -333,7 +347,8 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, tasks: TaskService.tasks({ service: [service.Name] }), nodes: NodeService.nodes(), secrets: apiVersion >= 1.25 ? SecretService.secrets() : [], - configs: apiVersion >= 1.30 ? ConfigService.configs() : [] + configs: apiVersion >= 1.30 ? ConfigService.configs() : [], + availableImages: ImageService.images() }); }) .then(function success(data) { @@ -341,6 +356,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, $scope.nodes = data.nodes; $scope.configs = data.configs; $scope.secrets = data.secrets; + $scope.availableImages = ImageService.getUniqueTagListFromImages(data.availableImages); // Set max cpu value var maxCpus = 0; @@ -355,6 +371,9 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, $scope.state.sliderMaxCpu = 32; } + // Default values + $scope.state.addSecret = {override: false}; + $timeout(function() { $anchorScroll(); }); diff --git a/app/components/services/services.html b/app/components/services/services.html index 5d6357878..662f6b625 100644 --- a/app/components/services/services.html +++ b/app/components/services/services.html @@ -87,7 +87,7 @@ - + {{ service.Name }} {{ service.StackName ? service.StackName : '-' }} @@ -107,7 +107,7 @@ - + {{ p.PublishedPort }}:{{ p.TargetPort }} - diff --git a/app/components/settings/settings.html b/app/components/settings/settings.html index 1cc2e712b..a12aa4f0c 100644 --- a/app/components/settings/settings.html +++ b/app/components/settings/settings.html @@ -9,6 +9,43 @@ +
+
+ + +
+
+ +
+
+ + +
+
+
+
+ + You can specify the URL to your logo here. For an optimal display, logo dimensions should be 155px by 55px. + +
+
+ +
+ +
+
+
+
Security @@ -36,36 +73,6 @@
- -
- Logo -
-
-
- - -
-
-
-
- - You can specify the URL to your logo here. For an optimal display, logo dimensions should be 155px by 55px. - -
-
- -
- -
-
-
-
App Templates diff --git a/app/components/settings/settingsController.js b/app/components/settings/settingsController.js index ef177641b..a9ee117fa 100644 --- a/app/components/settings/settingsController.js +++ b/app/components/settings/settingsController.js @@ -9,6 +9,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_ $scope.formValues = { customLogo: false, customTemplates: false, + donationHeader: true, externalContributions: false, restrictBindMounts: false, restrictPrivilegedMode: false, @@ -45,6 +46,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_ settings.TemplatesURL = DEFAULT_TEMPLATES_URL; } + settings.DisplayDonationHeader = !$scope.formValues.donationHeader; settings.DisplayExternalContributors = !$scope.formValues.externalContributions; settings.AllowBindMountsForRegularUsers = !$scope.formValues.restrictBindMounts; settings.AllowPrivilegedModeForRegularUsers = !$scope.formValues.restrictPrivilegedMode; @@ -63,6 +65,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_ .then(function success(data) { Notifications.success('Settings updated'); StateManager.updateLogo(settings.LogoURL); + StateManager.updateDonationHeader(settings.DisplayDonationHeader); StateManager.updateExternalContributions(settings.DisplayExternalContributors); if (resetForm) { resetFormValues(); @@ -87,6 +90,7 @@ function ($scope, $state, Notifications, SettingsService, StateManager, DEFAULT_ if (settings.TemplatesURL !== DEFAULT_TEMPLATES_URL) { $scope.formValues.customTemplates = true; } + $scope.formValues.donationHeader = !settings.DisplayDonationHeader; $scope.formValues.externalContributions = !settings.DisplayExternalContributors; $scope.formValues.restrictBindMounts = !settings.AllowBindMountsForRegularUsers; $scope.formValues.restrictPrivilegedMode = !settings.AllowPrivilegedModeForRegularUsers; diff --git a/app/components/sidebar/sidebar.html b/app/components/sidebar/sidebar.html index db12a7dca..dd1b0d293 100644 --- a/app/components/sidebar/sidebar.html +++ b/app/components/sidebar/sidebar.html @@ -9,75 +9,75 @@