fix(registries): put anon docker at top (#5670)

pull/5702/head
Chaim Lev-Ari 2021-09-22 07:55:25 +03:00 committed by GitHub
parent e1f725d01a
commit ec3233fb09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View File

@ -54,6 +54,21 @@
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="md-checkbox" ng-if="$ctrl.isAdmin && !$ctrl.endpointType">
<input id="select_{{ $index }}" type="checkbox" disabled />
<label for="select_{{ $index }}"></label>
</span>
<span>DockerHub (anonymous)</span>
</td>
<td>
docker.io
</td>
<td>
-
</td>
</tr>
<tr
dir-paginate="item in ($ctrl.state.filteredDataSet = ($ctrl.dataset | filter:$ctrl.state.textFilter | orderBy:$ctrl.state.orderBy:$ctrl.state.reverseOrder | itemsPerPage: $ctrl.state.paginatedItemLimit))"
ng-class="{ active: item.Checked }"

View File

@ -1,5 +1,3 @@
import _ from 'lodash-es';
import { DockerHubViewModel } from 'Portainer/models/dockerhub';
import { RegistryTypes } from 'Portainer/models/registryTypes';
class EndpointRegistriesController {
@ -19,9 +17,8 @@ class EndpointRegistriesController {
getRegistries() {
return this.$async(async () => {
try {
const dockerhub = new DockerHubViewModel();
const registries = await this.EndpointService.registries(this.endpointId);
this.registries = _.concat(dockerhub, registries);
this.registries = registries;
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to retrieve registries');
}

View File

@ -1,6 +1,5 @@
import _ from 'lodash-es';
import { RegistryTypes } from 'Portainer/models/registryTypes';
import { DockerHubViewModel } from 'Portainer/models/dockerhub';
angular.module('portainer.app').controller('RegistriesController', [
'$q',
@ -59,7 +58,7 @@ angular.module('portainer.app').controller('RegistriesController', [
registries: RegistryService.registries(),
})
.then(function success(data) {
$scope.registries = _.concat(new DockerHubViewModel(), data.registries);
$scope.registries = data.registries;
})
.catch(function error(err) {
$scope.registries = [];