format/prettier

This commit is contained in:
2024-04-13 20:07:39 -04:00
parent 8007e71e1d
commit c52331a23a
8 changed files with 242 additions and 107 deletions

View File

@ -121,11 +121,17 @@ class TfNavigationElement extends LitElement {
*/
render_login() {
if (this?.credentials?.session?.name) {
return html`<a class="w3-bar-item w3-right" id="login" href="/login/logout?return=${url() + hash()}"
return html`<a
class="w3-bar-item w3-right"
id="login"
href="/login/logout?return=${url() + hash()}"
>logout ${this.credentials.session.name}</a
>`;
} else {
return html`<a class="w3-bar-item w3-right" id="login" href="/login?return=${url() + hash()}"
return html`<a
class="w3-bar-item w3-right"
id="login"
href="/login?return=${url() + hash()}"
>login</a
>`;
}
@ -146,8 +152,11 @@ class TfNavigationElement extends LitElement {
<select
@change=${this.set_active_identity}
class="w3-button w3-cyan w3-bar-item w3-right"
style="max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap">
${this.identities.map(x => html`<option ?selected=${x === this.identity}>${x}</option>`)}
style="max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap"
>
${this.identities.map(
(x) => html`<option ?selected=${x === this.identity}>${x}</option>`
)}
</select>
`;
} else {
@ -155,7 +164,8 @@ class TfNavigationElement extends LitElement {
<link type="text/css" rel="stylesheet" href="/static/w3.css" />
<button
@click=${this.create_identity}
class="w3-button w3-blue w3-right">
class="w3-button w3-blue w3-right"
>
Create an Identity
</button>
`;
@ -226,9 +236,7 @@ class TfNavigationElement extends LitElement {
display: inline-block;
}
</style>
<div
class="w3-black w3-bar"
>
<div class="w3-black w3-bar">
<span
class="w3-bar-item"
style="cursor: pointer"
@ -237,7 +245,8 @@ class TfNavigationElement extends LitElement {
>
<span
class="w3-bar-item"
style=${'white-space: nowrap' + (this.show_version ? '' : '; display: none')}
style=${'white-space: nowrap' +
(this.show_version ? '' : '; display: none')}
title=${this.version?.name +
' ' +
Object.entries(this.version || {})
@ -280,20 +289,21 @@ class TfNavigationElement extends LitElement {
@click=${() => (self.show_permissions = !self.show_permissions)}
>🎛️</a
>
${status.message ? html`
<span
class="w3-bar-item"
style="vertical-align: top; white-space: pre; color: ${this
.status.color ?? kErrorColor}"
>${this.status.message}</span
>
` : undefined}
${status.message
? html`
<span
class="w3-bar-item"
style="vertical-align: top; white-space: pre; color: ${this
.status.color ?? kErrorColor}"
>${this.status.message}</span
>
`
: undefined}
${this.render_permissions()}
${Object.keys(this.spark_lines)
.sort()
.map((x) => this.spark_lines[x])}
${this.render_login()}
${this.render_identity()}
${this.render_login()} ${this.render_identity()}
</div>
`;
}