Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions priv/assets/css/ldf.css
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,18 @@ tbody tr.new { animation: flashin .7s ease-out; }

/* per-message ETSI conversion */
.rec-etsi { display: flex; gap: 8px; margin-top: 10px; }
.etsi-btn { padding: 5px 11px; font-size: 10.5px; letter-spacing: .08em; }
.etsi-btn {
font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
padding: 6px 12px; border-radius: 4px; cursor: pointer; transition: background .15s, box-shadow .15s;
border: 1px solid var(--live); background: rgba(46,230,166,.16); color: var(--live);
}
.etsi-btn:hover { background: rgba(46,230,166,.28); box-shadow: 0 0 0 3px rgba(46,230,166,.1); }
.etsi:empty { display: none; }
.etsi-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.etsi-label { color: var(--live); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.etsi-label.etsi-err { color: var(--danger); }
.etsi-hide { margin-left: auto; padding: 4px 10px; font-size: 10.5px; }
.etsi-copy { margin-left: auto; padding: 4px 11px; }
.etsi-hide { padding: 4px 10px; font-size: 10.5px; }
.etsi-pre { margin: 8px 0 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; max-height: 360px; overflow: auto; font-size: 11.5px; line-height: 1.45; white-space: pre; }
.etsi-pre code { color: var(--text); }

Expand Down
5 changes: 4 additions & 1 deletion src/controllers/ldf_www_controller.erl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ etsi_block(Format, MessageId, EscapedXml) ->
iolist_to_binary([
~"<div class=\"etsi-bar\"><span class=\"etsi-label\">ETSI ",
Format,
~"</span><button class=\"btn-ghost etsi-hide\" data-on:click=\"@get('/www/message/",
~"</span><button class=\"etsi-btn etsi-copy\" data-on:click=\"",
~"navigator.clipboard.writeText(el.closest('.etsi').querySelector('code').textContent);",
~"el.textContent='copied';setTimeout(()=>el.textContent='copy',1200)\">copy</button>",
~"<button class=\"btn-ghost etsi-hide\" data-on:click=\"@get('/www/message/",
MessageId,
~"/hide')\">hide</button></div><pre class=\"etsi-pre\"><code>",
EscapedXml,
Expand Down
2 changes: 1 addition & 1 deletion src/views/admin.dtl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="row">
<label class="seg"><input type="radio" value="email" data-bind:type checked> Email</label>
<label class="seg"><input type="radio" value="phone_number" data-bind:type> Phone</label>
<input type="text" data-bind:value placeholder="target@example.com / +4670…">
<input type="text" data-bind:value placeholder="target@example.com / +4670…" data-on:keydown="evt.key === 'Enter' && @post('/www/li')">
<button class="btn" data-on:click="@post('/www/li')">Add target</button>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/views/history.dtl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<div class="row">
<label class="seg"><input type="radio" value="email" data-bind:type checked> Email</label>
<label class="seg"><input type="radio" value="phone_number" data-bind:type> Phone</label>
<input type="text" data-bind:value placeholder="target@example.com">
<input type="text" data-bind:value placeholder="target@example.com" data-on:keydown="evt.key === 'Enter' && @post('/www/history')">
</div>
<div class="row" style="margin-top:12px">
<input type="datetime-local" step="1" data-bind:timestamp>
<input type="datetime-local" step="1" lang="sv-SE" data-bind:timestamp>
<button class="btn" data-on:click="@post('/www/history')">Submit request</button>
</div>
<p class="hint">Replays messages from this point in time onward (UTC).</p>
Expand Down
2 changes: 1 addition & 1 deletion src/views/message_row.dtl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="rec{% if new %} new{% endif %}"><div class="rec-head"><span class="rec-from">{% if email %}{{ email }}{% endif %}{% if phone %}<span class="rec-phone">{{ phone }}</span>{% endif %}{% if not email %}{% if not phone %}<span class="rec-phone">unidentified</span>{% endif %}{% endif %}</span><span class="rec-time">{{ time }}</span></div><div class="rec-body">{% if link %}<a href="{{ link }}" target="_blank" rel="noopener">{{ link }}</a>{% else %}{{ text }}{% endif %}</div><div class="rec-meta"><span><i>type</i>{{ type }}{% if action %} / {{ action }}{% endif %}</span><span><i>msg</i>{{ id }}</span><span><i>chat</i>{{ chat }}</span><span><i>sender</i>{{ sender }}</span><span><i>to</i>{{ recipient }}</span>{% if agent %}<span class="rec-agent"><i>agent</i>{{ agent }}</span>{% endif %}</div>{% if full_id %}<div class="rec-etsi"><button class="btn-ghost etsi-btn" data-on:click="@get('/www/message/{{ full_id }}/103707')">103707 XML</button><button class="btn-ghost etsi-btn" data-on:click="@get('/www/message/{{ full_id }}/103120')">103120 XML</button></div><div id="xml-{{ full_id }}" class="etsi"></div>{% endif %}</div>
<div class="rec{% if new %} new{% endif %}"><div class="rec-head"><span class="rec-from">{% if email %}{{ email }}{% endif %}{% if phone %}<span class="rec-phone">{{ phone }}</span>{% endif %}{% if not email %}{% if not phone %}<span class="rec-phone">unidentified</span>{% endif %}{% endif %}</span><span class="rec-time">{{ time }}</span></div><div class="rec-body">{% if link %}<a href="{{ link }}" target="_blank" rel="noopener">{{ link }}</a>{% else %}{{ text }}{% endif %}</div><div class="rec-meta"><span><i>type</i>{{ type }}{% if action %} / {{ action }}{% endif %}</span><span><i>msg</i>{{ id }}</span><span><i>chat</i>{{ chat }}</span><span><i>sender</i>{{ sender }}</span><span><i>to</i>{{ recipient }}</span>{% if agent %}<span class="rec-agent"><i>agent</i>{{ agent }}</span>{% endif %}</div>{% if full_id %}<div class="rec-etsi"><button class="etsi-btn" data-on:click="@get('/www/message/{{ full_id }}/103707')">103707 XML</button><button class="etsi-btn" data-on:click="@get('/www/message/{{ full_id }}/103120')">103120 XML</button></div><div id="xml-{{ full_id }}" class="etsi"></div>{% endif %}</div>
Loading