Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return {
worker: {
name: {
required,
maxLength: maxLength(15),
noStartEndHyphen, // Order is important for UI hints
resourceName,
uniqueWorkerName
},
volume: {
size: {
minVolumeSize: minVolumeSize(this.minimumVolumeSize)
}
},
minimum: {
minValue: minValue(0)
},
maximum: {
minValue: minValue(0)
},
maxSurge: {
numberOrPercentage
},
zones: {
required
}
}
}
},
machineTypes () {
} = {
loading: this.$state.progress,
save: this.$state.idle,
pending: false,
}
item: Price = {
id: uuid(), command: '', price: 1, enabled: true
}
@Validations()
validations = {
item: {
command: { required },
price: { minValue: minValue(1), required },
}
}
@Watch('item', { deep: true })
pending() {
if (this.state.loading === this.$state.success) {
this.state.pending = true;
}
}
async mounted() {
if (this.$route.params.id) {
await new Promise((resolve, reject) => {
this.socket.emit('price::getOne', this.$route.params.id, (data) => {
console.debug({price_data: data})
this.item = data;
@PropSync('alert') readonly data !: AlertResub
@Prop() readonly index !: number
customShow: 'html' | 'css' | 'js' = 'html';
fonts: {text: string; value: string}[] = [];
@Watch('$v', { deep: true })
emitValidation() {
this.$emit('update:isValid', !this.$v.$error)
}
@Validations()
validations = {
data: {
messageTemplate: {required},
variantAmount: {required, minValue: minValue(0)},
}
}
async mounted() {
if (this.data.advancedMode.html === null) {
this.data.advancedMode.html = text;
}
if (this.data.advancedMode.js === null) {
this.data.advancedMode.js = textjs;
}
const { response } = await new Promise(resolve => {
const request = new XMLHttpRequest();
request.open('GET', '/fonts', true);
request.onload = function() {
if (!(this.status >= 200 && this.status < 400)) {
validations () {
return {
item: {
name: {
required
},
quantity: {
required,
minValue: minValue(1),
maxLength: maxLength(20)
},
price: {
required,
minValue: minValue(1),
maxLength: maxLength(20)
},
discount_val: {
between: between(0, this.maxDiscount)
},
description: {
maxLength: maxLength(255)
}
}
}
},
created () {
}
const validations = {
worker: {
name: {
required,
uniqueWorkerName
},
volumeSize: {
minVolumeSize: minVolumeSize(1)
},
autoScalerMin: {
minValue: minValue(1)
},
autoScalerMax: {
minValue: minValue(1)
}
}
}
export default {
components: {
SizeInput,
MachineType,
VolumeType
},
props: {
worker: {
type: Object,
required: true
},
workers: {
methods: {
getRecordComponentName (type) {
let genericComponentName = 'Record'
let specificComponentName = genericComponentName + type
if (this.types.includes(type) && specificComponentName in this.$options.components) {
return specificComponentName
}
return genericComponentName
}
},
validations: {
rrset: {
ttl: {
required,
integer,
minValue: minValue(MinTTL)
}
}
},
computed: {
errors () {
return Object.entries(this.errorDict).filter(entry => !this.$v.rrset.ttl[entry[0]]).map(entry => entry[1])
},
left () {
return this.limit - this.current()
}
}
}
]
state: {
loading: number;
save: number;
pending: boolean;
} = {
loading: this.$state.progress,
save: this.$state.idle,
pending: false,
}
@Validations()
validations = {
item: {
waitBefore: {required, minValue: minValue(0)},
waitAfter: {required, minValue: minValue(0)},
animationInDuration: {required, minValue: minValue(100)},
animationOutDuration: {required, minValue: minValue(100)},
}
}
@Watch('item', { deep: true })
pending() {
if (this.state.loading === this.$state.success) {
this.state.pending = true;
}
}
save() {
this.$v.$touch();
if (!this.$v.$invalid) {
created () {
if (this.isEdit) {
this.loadEditData()
}
},
validations: {
formData: {
name: {
required,
minLength: minLength(3)
},
price: {
required,
numeric,
maxLength: maxLength(10),
minValue: minValue(0.1)
},
description: {
maxLength: maxLength(255)
}
}
},
methods: {
...mapActions('item', [
'addItem',
'fetchItem',
'updateItem'
]),
async loadEditData () {
let response = await this.fetchItem(this.$route.params.id)
this.formData = response.data.item
this.formData.unit = this.units.find(_unit => response.data.item.unit === _unit.name)
validations () {
return {
item: {
name: {
required
},
quantity: {
required,
minValue: minValue(1),
maxLength: maxLength(20)
},
price: {
required,
minValue: minValue(1),
maxLength: maxLength(20)
},
discount_val: {
between: between(0, this.maxDiscount)
},
description: {
maxLength: maxLength(255)
}
}
}
},
validations() {
return {
result1: {
required,
integer,
minValue: minValue(0)
},
result2: {
required,
integer,
minValue: minValue(0)
}
}
},