bugfix/170_180 #52
|
@ -127,12 +127,12 @@ class NewSnapshotView(ApiMixing):
|
||||||
logger.error("Error: No property for uuid: %s", ev_uuid)
|
logger.error("Error: No property for uuid: %s", ev_uuid)
|
||||||
return JsonResponse({'status': 'fail'}, status=500)
|
return JsonResponse({'status': 'fail'}, status=500)
|
||||||
|
|
||||||
url_args = reverse_lazy("device:details", args=(property.value,))
|
url_args = reverse_lazy("device:details", args=(prop.value,))
|
||||||
url = request.build_absolute_uri(url_args)
|
url = request.build_absolute_uri(url_args)
|
||||||
|
|
||||||
response = {
|
response = {
|
||||||
"status": "success",
|
"status": "success",
|
||||||
"dhid": property.value[:6].upper(),
|
"dhid": prop.value[:6].upper(),
|
||||||
"url": url,
|
"url": url,
|
||||||
# TODO replace with public_url when available
|
# TODO replace with public_url when available
|
||||||
"public_url": url
|
"public_url": url
|
||||||
|
|
|
@ -298,13 +298,17 @@ class ParseSnapshot:
|
||||||
if get_inxi(n, "type") == "USB":
|
if get_inxi(n, "type") == "USB":
|
||||||
interface = "USB"
|
interface = "USB"
|
||||||
|
|
||||||
|
speed = get_inxi(iface, "speed")
|
||||||
|
if not speed:
|
||||||
|
speed = get_inxi(n, "speed")
|
||||||
|
|
||||||
self.components.append(
|
self.components.append(
|
||||||
{
|
{
|
||||||
"type": "NetworkAdapter",
|
"type": "NetworkAdapter",
|
||||||
"model": model,
|
"model": model,
|
||||||
"manufacturer": get_inxi(n, 'vendor'),
|
"manufacturer": get_inxi(n, 'vendor'),
|
||||||
"serialNumber": get_inxi(iface, 'mac'),
|
"serialNumber": get_inxi(iface, 'mac'),
|
||||||
"speed": get_inxi(n, "speed"),
|
"speed": speed,
|
||||||
"interface": interface,
|
"interface": interface,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue