mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-28 02:11:40 +00:00
adde ( ) - and . to regex
This commit is contained in:
@@ -245,6 +245,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
re: RegExp('^[A-Za-z0-9 \\-)(]*[A-Za-z0-9][A-Za-z0-9 \\-)(.]*$'),
|
||||||
selectedTab: 0,
|
selectedTab: 0,
|
||||||
// camera edit variables
|
// camera edit variables
|
||||||
isCameraNameEdit: false,
|
isCameraNameEdit: false,
|
||||||
@@ -266,9 +267,9 @@
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
checkCameraName() {
|
checkCameraName() {
|
||||||
let re = new RegExp('^[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*$');
|
|
||||||
if (this.newCameraName !== this.cameraList[this.currentCameraIndex]) {
|
if (this.newCameraName !== this.cameraList[this.currentCameraIndex]) {
|
||||||
if (re.test(this.newCameraName)) {
|
if (this.re.test(this.newCameraName)) {
|
||||||
for (let cam in this.cameraList) {
|
for (let cam in this.cameraList) {
|
||||||
if (this.newCameraName === this.cameraList[cam]) {
|
if (this.newCameraName === this.cameraList[cam]) {
|
||||||
return "Camera by that name already Exists"
|
return "Camera by that name already Exists"
|
||||||
@@ -281,9 +282,9 @@
|
|||||||
return ""
|
return ""
|
||||||
},
|
},
|
||||||
checkPipelineName() {
|
checkPipelineName() {
|
||||||
let re = new RegExp('^[A-Za-z0-9 _]*[A-Za-z0-9][A-Za-z0-9 _]*$');
|
|
||||||
if (this.newPipelineName !== this.pipelineList[this.currentPipelineIndex - 1] || this.isPipelineNameEdit === false) {
|
if (this.newPipelineName !== this.pipelineList[this.currentPipelineIndex - 1] || this.isPipelineNameEdit === false) {
|
||||||
if (re.test(this.newPipelineName)) {
|
if (this.re.test(this.newPipelineName)) {
|
||||||
for (let pipe in this.pipelineList) {
|
for (let pipe in this.pipelineList) {
|
||||||
if (this.newPipelineName === this.pipelineList[pipe]) {
|
if (this.newPipelineName === this.pipelineList[pipe]) {
|
||||||
return "A pipeline with this name already exists"
|
return "A pipeline with this name already exists"
|
||||||
|
|||||||
Reference in New Issue
Block a user