mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
Co-authored-by: Simon Meng <simon.meng@portainer.io>
This commit is contained in:
parent
ccf6babc02
commit
f2faccdb10
3 changed files with 20 additions and 2 deletions
|
@ -1,6 +1,17 @@
|
|||
import _ from 'lodash-es';
|
||||
|
||||
class KubernetesFormValidationHelper {
|
||||
static getInvalidKeys(names) {
|
||||
const res = {};
|
||||
_.forEach(names, (name, index) => {
|
||||
const valid = /^[-._a-zA-Z0-9]+$/.test(name);
|
||||
if (!valid) {
|
||||
res[index] = true;
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
static getDuplicates(names) {
|
||||
const groupped = _.groupBy(names);
|
||||
const res = {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue