Closed kpribic closed 3 years ago
NOTE: Seems related to closed ticket https://github.com/sipcapture/homer-app/issues/133
@kpribic the current design is fully compatible with HEPsub producing "links" rather than data. We just need a handler for it in the UI so the change is quite a minor one. Do you already have any such prototype to assist with this type of testing?
Not at the moment, didn't make sense to do any serious development before there is agreement on what can be (and what is accepted by you guys to be) done in homer7. I could fix up a dummy pub-sub client next week that just returns some HTML (eg. based on your hepsub implementation) for start.
From our side its a go, you can use the hepsub helloworld
example to mock up something you're thinking of in 5 minutes.
I already had a functional hepsub-elastic so I worked from that. I just replaced the Elastic query with:res.send("myHTMLstuff").end();
. That didn't work at first, it appears that homer-app filters for valid json. After formatting my response to json it was passed through to homer-ui.
If it's a problem I could send the HTML we talked about as a json tag. Whatever is easier on your side, it's not much of a difference from agent perspective. For example:
{
"subtype": "html",
"data": "<table> ...bunchOfHTML... </table>"
}
Regarding the actual HTML content, I'd say this is a good enough test:
<style>
table, td, th {
border: 1px solid #ddd;
text-align: left;
}
table {
border-collapse: collapse;
width: 100%;
}
th, td {
padding: 15px;
}
</style>
<table style="width: 30%;">
<colgroup>
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
<col style="width: 25%;">
</colgroup>
<tbody>
<tr>
<td colspan="4"><p><strong>INFO</strong></p></td>
</tr>
<tr>
<td colspan="4" ><p>Some general information for user.</p></td>
</tr>
<tr>
<td colspan="4">More information.</td>
</tr>
<tr>
<th colspan="4">LOG Type 1</th>
</tr>
<tr>
<td>
<a href="https://knowyourmeme.com/memes/rickroll">Link dc 1</a>
</td>
<td>
<a href="https://knowyourmeme.com/memes/rickroll">Link dc 2</a>
</td>
<td>
<div><p><a href="https://knowyourmeme.com/memes/rickroll">Link dc 3</a></p></div>
</td>
<td><br></td>
</tr>
<tr>
<td colspan="4"><strong>LOG Type 2</strong></td>
</tr>
<tr>
<td>
<a href="https://knowyourmeme.com/memes/rickroll">Link1</a>
</td>
<td>
<a href="https://knowyourmeme.com/memes/rickroll">Link2</a>
</td>
<td>
<a href="https://knowyourmeme.com/memes/rickroll">Link3</a>
</td>
<td>
<a href="https://knowyourmeme.com/memes/rickroll">Link4</a>
</td>
</tr>
<tr>
<td colspan="4"><strong>CDR</strong></td>
</tr>
<tr>
<td colspan="1"><a href="https://knowyourmeme.com/memes/rickroll">LINK DC A</a></td>
<td colspan="1"><a href="https://knowyourmeme.com/memes/rickroll">LINK DC B</a></td>
<td colspan="1"><br></td>
<td colspan="1"><br></td>
</tr>
<tr>
<td colspan="4"><strong>Media stats</strong></td>
</tr>
<tr>
<td colspan="1" ><a href="https://knowyourmeme.com/memes/rickroll">Link 1</a></td>
<td colspan="1" ><a href="https://knowyourmeme.com/memes/rickroll">Link 2</a></td>
<td colspan="1" ><br></td>
<td colspan="1" ><br></td>
</tr>
<tr>
<td colspan="4"
data-highlight-colour="blue"><strong>External systems</strong></td>
</tr>
<tr>
<td colspan="1" ><a href="https://knowyourmeme.com/memes/rickroll">System 1</a></td>
<td colspan="1" ><a href="https://knowyourmeme.com/memes/rickroll">System 2</a></td>
<td colspan="1" ><a href="https://knowyourmeme.com/memes/rickroll">System 3</a></td>
<td colspan="1" ><br></td>
</tr>
</tbody>
</table>
the version 1.3.0 has been released. Please install it and retest it.
"Share link" feature is great for getting INTO Homer7, however there is no elegant way to go somewhere else FROM Homer7 after using all the advanced correlation features. For example opening billing system at a specific CDR that has complex UI that does bunch of other stuff.
Since generating external links can be pretty complex (and very specific to deployment) after all the data has been correlated I think it would be best to leave that link generating logic to external application that connects to Homer via hepsub. Only difference would be that instead of logs it would return external links.
This is not a big change however it is very a powerful extension. Minimum modifications required to make it work: