Share chat dock tab: adding date column, removing password column.

This commit is contained in:
John Livingston 2024-06-19 11:45:37 +02:00
parent 9f4a92609b
commit 22ea1a36ae
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 8 additions and 2 deletions

View File

@ -117,6 +117,7 @@ declare const LOC_SHARE_CHAT_DOCK: string
declare const LOC_SHARE_CHAT_DOCK_TIPS: string
declare const LOC_TOKEN_LABEL: string
declare const LOC_TOKEN_PASSWORD: string
declare const LOC_TOKEN_DATE: string
declare const LOC_TOKEN_ACTION_CREATE: string
declare const LOC_TOKEN_ACTION_REVOKE: string
declare const LOC_TOKEN_DEFAULT_LABEL: string

View File

@ -16,13 +16,18 @@ export function tplTokenList (el: LivechatTokenListElement): TemplateResult {
<tr>
<th scope="col"></th>
<th scope="col">${ptTr(LOC_TOKEN_LABEL)}</th>
<th scope="col">${ptTr(LOC_TOKEN_PASSWORD)}</th>
<th scope="col">${ptTr(LOC_TOKEN_DATE)}</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
${
repeat(el.tokenList ?? [], (token) => token.id, (token) => {
let dateStr: string = ''
try {
const date = new Date(token.date)
dateStr = date.toLocaleDateString() + ' ' + date.toLocaleTimeString()
} catch (err) {}
return html`<tr>
<td>${
el.mode === 'select'
@ -43,7 +48,7 @@ export function tplTokenList (el: LivechatTokenListElement): TemplateResult {
</td>
<td>
<label for=${`livechat-token-radio-${token.id}`}>
${token.password}
${dateStr}
</label>
</td>
<td>