Whether you can run Live View smoothly depends on client-side performance. Click
here to know how to choose the right PC or
VisualStation for a better Surveillance Station Live View experience.
`);
},
getFilteredOptions: function(key, options) {
if (key === 'resolution' && this.questions.codec.value === 'MJPEG') {
var filteredOptions = Object.assign({}, options);
delete filteredOptions['3840'];
return filteredOptions;
}
return options;
},
findRecommend: function() {
var vm = this;
this.req_sending = true;
this.show_all_result = false;
this.result = {};
var query = [];
for (var key in this.questions) {
query.push({ name: key, value: this.questions[key].value });
}
query.push({ name: 'lang', value: SYNO_WEB.langCode });
var selectedResolutionValue = this.questions.resolution.value;
var displayResolution = '720p';
if (1280 < selectedResolutionValue) {
displayResolution = this.questions.resolution.option[selectedResolutionValue];
}
this.columns.totalFPS = this.columns.totalFPS.replace(/\(\w+\)/, "(" + displayResolution +")");
$.ajax({
url: "api/support/nvr_selector_recommend_models",
data: query,
}).done(function(data) {
SYNO_WEB.scrollTo("#results");
vm.result = data;
vm.$nextTick(function() {
if (vm.$refs.resultsTitle) {
vm.$refs.resultsTitle.focus();
}
});
}).always(function() {
SYNO_WEB.updateQueryString(query.filter(function(x) { return Object.keys(vm.questions).indexOf(x.name) != -1 }));
req_sending = false;
});
},
getModelPic: function(model) {
return 'api/products/getPhoto?product='+encodeURIComponent(model.name)+'&type=img_s&sort=0';
},
getRecommandBitrate: function() {
var vm = this;
var query = [];
for (var key in this.questions) {
query.push({ name: key, value: this.questions[key].value });
}
query.push({ name: 'lang', value: SYNO_WEB.langCode });
query.push({name: "onlyBitrate", value: "1"});
$.ajax({
url: "api/support/nvr_selector_recommend_models",
data: query,
}).done(function(data) {
const parseFloatResult = parseFloat(data.recommendBitrate, 10);
const fixedTwoDecimalResult = parseFloatResult.toFixed(2);
vm.questions.mbps.value = fixedTwoDecimalResult;
});
},
},
watch: {
'questions.codec.value': function() {
if (vm.questions.codec.value === 'MJPEG' && vm.questions.resolution.value == 3840) {
vm.questions.resolution.value = 640;
}
this.getRecommandBitrate();
},
'questions.resolution.value': function() {
this.getRecommandBitrate();
},
'questions.fps.value': function() {
this.getRecommandBitrate();
}
}
});
});