resolve conflict

This commit is contained in:
Cayo Puigdefabregas 2022-05-16 18:33:34 +02:00
commit edeae562d6
3 changed files with 9 additions and 9 deletions

View File

@ -40,10 +40,10 @@ from ereuse_devicehub.resources.action.views.snapshot import (
from ereuse_devicehub.resources.device.models import ( from ereuse_devicehub.resources.device.models import (
SAI, SAI,
Cellphone, Cellphone,
ComputerMonitor,
Device, Device,
Keyboard, Keyboard,
MemoryCardReader, MemoryCardReader,
Monitor,
Mouse, Mouse,
Smartphone, Smartphone,
Tablet, Tablet,
@ -127,7 +127,7 @@ class FilterForm(FlaskForm):
# Generic Filters # Generic Filters
if "All Devices" == self.device_type: if "All Devices" == self.device_type:
filter_type = COMPUTERS + ["Monitor"] + MOBILE filter_type = COMPUTERS + MONITORS + MOBILE
elif "All Computers" == self.device_type: elif "All Computers" == self.device_type:
filter_type = COMPUTERS filter_type = COMPUTERS
@ -305,7 +305,7 @@ class NewDeviceForm(FlaskForm):
"Smartphone": Smartphone, "Smartphone": Smartphone,
"Tablet": Tablet, "Tablet": Tablet,
"Cellphone": Cellphone, "Cellphone": Cellphone,
"Monitor": Monitor, "ComputerMonitor": ComputerMonitor,
"Mouse": Mouse, "Mouse": Mouse,
"Keyboard": Keyboard, "Keyboard": Keyboard,
"SAI": SAI, "SAI": SAI,
@ -421,7 +421,7 @@ class NewDeviceForm(FlaskForm):
path_snapshot = save_json(json_snapshot, self.tmp_snapshots, g.user.email) path_snapshot = save_json(json_snapshot, self.tmp_snapshots, g.user.email)
snapshot_json = schema.load(json_snapshot) snapshot_json = schema.load(json_snapshot)
if self.type.data == 'Monitor': if self.type.data == 'ComputerMonitor':
snapshot_json['device'].resolution_width = self.resolution.data snapshot_json['device'].resolution_width = self.resolution.data
snapshot_json['device'].size = self.screen.data snapshot_json['device'].size = self.screen.data
@ -432,7 +432,7 @@ class NewDeviceForm(FlaskForm):
snapshot = upload_form.build(snapshot_json) snapshot = upload_form.build(snapshot_json)
move_json(self.tmp_snapshots, path_snapshot, g.user.email) move_json(self.tmp_snapshots, path_snapshot, g.user.email)
if self.type.data == 'Monitor': if self.type.data == 'ComputerMonitor':
snapshot.device.resolution = self.resolution.data snapshot.device.resolution = self.resolution.data
snapshot.device.screen = self.screen.data snapshot.device.screen = self.screen.data

View File

@ -4,7 +4,7 @@ $(document).ready(() => {
}) })
function deviceInputs() { function deviceInputs() {
if ($("#type").val() == "Monitor") { if ($("#type").val() == "ComputerMonitor") {
$("#screen").show(); $("#screen").show();
$("#resolution").show(); $("#resolution").show();
$("#imei").hide(); $("#imei").hide();

View File

@ -36,9 +36,9 @@
<label for="name" class="form-label">Type *</label> <label for="name" class="form-label">Type *</label>
<select id="type" class="form-control" name="type" required=""> <select id="type" class="form-control" name="type" required="">
<option value="">Select one Type</option> <option value="">Select one Type</option>
<optgroup label="Computer Monitor"> <optgroup label="Monitor">
<option value="Monitor" <option value="ComputerMonitor"
{% if form.type.data == 'Monitor' %} selected="selected"{% endif %}>Monitor</option> {% if form.type.data == 'Monitor' %} selected="selected"{% endif %}>Computer Monitor</option>
</optgroup> </optgroup>
<optgroup label="Mobile"> <optgroup label="Mobile">
<option value="Smartphone" <option value="Smartphone"