mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
fix(container): fix various creating container issues EE-6287 (#10595)
* fix(container): show placeholder for image field EE-6287 * fix(container): correct query params for search button field EE-6287 * fix(container): use btoa to encode registry credential EE-6287 * fix(container): allow creating non-existing option EE-6287 * fix(ui/forms): typeahead component * fix(container): select the default registry EE-6287 * fix(container): always enable deploy button when always pull is off EE-6287 * fix(container): reset command fields outside current event to avoid validation on broken values EE-6287 * fix(container): query registry with endpoint ID param EE-6287 --------- Co-authored-by: Chaim Lev-Ari <chaim.levi-ari@portainer.io>
This commit is contained in:
parent
e43d076269
commit
d089dfbca0
17 changed files with 190 additions and 137 deletions
|
@ -1,5 +1,5 @@
|
|||
import _ from 'lodash-es';
|
||||
import { hideShaSum, joinCommand, nodeStatusBadge, taskStatusBadge, trimSHA } from './utils';
|
||||
import { hideShaSum, joinCommand, nodeStatusBadge, taskStatusBadge, trimSHA, trimVersionTag } from './utils';
|
||||
|
||||
function includeString(text, values) {
|
||||
return values.some(function (val) {
|
||||
|
@ -184,20 +184,7 @@ angular
|
|||
})
|
||||
.filter('trimversiontag', function () {
|
||||
'use strict';
|
||||
return function trimversiontag(fullName) {
|
||||
if (!fullName) {
|
||||
return fullName;
|
||||
}
|
||||
var versionIdx = fullName.lastIndexOf(':');
|
||||
if (versionIdx < 0) {
|
||||
return fullName;
|
||||
}
|
||||
var hostIdx = fullName.indexOf('/');
|
||||
if (hostIdx > versionIdx) {
|
||||
return fullName;
|
||||
}
|
||||
return fullName.substring(0, versionIdx);
|
||||
};
|
||||
return trimVersionTag;
|
||||
})
|
||||
.filter('unique', function () {
|
||||
return _.uniqBy;
|
||||
|
|
|
@ -1,6 +1,24 @@
|
|||
import { NodeStatus, TaskState } from 'docker-types/generated/1.41';
|
||||
import _ from 'lodash';
|
||||
|
||||
export function trimVersionTag(fullName: string) {
|
||||
if (!fullName) {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const versionIdx = fullName.lastIndexOf(':');
|
||||
if (versionIdx < 0) {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const hostIdx = fullName.indexOf('/');
|
||||
if (hostIdx > versionIdx) {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
return fullName.substring(0, versionIdx);
|
||||
}
|
||||
|
||||
export function trimSHA(imageName: string) {
|
||||
if (!imageName) {
|
||||
return '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue