Commit c093b2ba authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Added the responses to a query to the detail view

parent 13f4e3d9
......@@ -15,6 +15,7 @@ import com.frostnerd.smokescreen.dialog.DnsRuleDialog
import com.google.android.material.snackbar.Snackbar
import kotlinx.android.synthetic.main.activity_dns_rules.*
import kotlinx.android.synthetic.main.fragment_querylog_detail.*
import org.minidns.record.A
import org.minidns.record.Record
import java.text.DateFormat
import java.util.*
......@@ -144,6 +145,15 @@ class QueryLogDetailFragment : Fragment() {
} else {
resolvedBy.text = query.askedServer?.replace("tls::", "")?.replace("https::", "") ?: "-"
}
responses.text = query.getParsedResponses().filter {
it.type == query.type
}.joinToString {
val payload = it.payload
payload.toString()
}.let {
if(it.isBlank()) "-"
else it
}
}
}
......
<vector android:height="32dp" android:viewportHeight="512"
android:viewportWidth="192" android:width="12dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M176,432c0,44.112 -35.888,80 -80,80s-80,-35.888 -80,-80 35.888,-80 80,-80 80,35.888 80,80zM25.26,25.199l13.6,272C39.499,309.972 50.041,320 62.83,320h66.34c12.789,0 23.331,-10.028 23.97,-22.801l13.6,-272C167.425,11.49 156.496,0 142.77,0H49.23C35.504,0 24.575,11.49 25.26,25.199z"/>
</vector>
......@@ -209,6 +209,37 @@
android:layout_marginTop="8dp"
android:layout_height="wrap_content"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_marginTop="24dp"
android:layout_height="wrap_content">
<ImageView
android:layout_width="24dp"
android:id="@+id/responseImage"
android:src="@drawable/ic_exclamation"
android:tint="?android:attr/textColor"
android:layout_height="24dp"/>
<TextView
android:layout_width="wrap_content"
android:textSize="18sp"
android:layout_toEndOf="@id/responseImage"
android:text="@string/windows_querylogging_responses"
android:textStyle="italic"
android:layout_marginStart="8dp"
android:id="@+id/queryResponseText"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:textSize="18sp"
android:id="@+id/responses"
android:layout_alignStart="@id/queryResponseText"
android:layout_below="@id/queryResponseText"
android:layout_marginTop="8dp"
android:layout_height="wrap_content"/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
<Button
......
......@@ -83,6 +83,7 @@
<string name="windows_querylogging_used_server">Used server</string>
<string name="windows_querylogging_protocol">Protocol</string>
<string name="windows_querylogging_latency">Latency</string>
<string name="windows_querylogging_responses">Responses</string>
<string name="windows_querylogging_create_dnsrule">Create dns rule for this host</string>
<string name="windows_querylogging_dnsrule_created">Dns rule has been created.</string>
</resources>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment