Skip to content

Commit

Permalink
Merge pull request mvnpm#9418 from ia3andy/fix-ws
Browse files Browse the repository at this point in the history
Fix styling issues and websocket link
  • Loading branch information
ia3andy authored Oct 2, 2024
2 parents 88dd2bf + b55bf6c commit 74cd3ab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 30 deletions.
25 changes: 9 additions & 16 deletions src/main/resources/web/app/mvnpm-event-log.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {LitElement, html, css} from 'lit';
import {customElement, state, property} from 'lit/decorators.js';

export const WEBSOCKET_BASE = window.location.protocol === "https:" ? "wss:" : "ws:" + "//" + window.location.host;
export const WEBSOCKET_BASE = `${window.location.protocol === "https:" ? "wss:" : "ws:"}//${window.location.host}`;

/**
* This component shows the Event log
Expand Down Expand Up @@ -110,6 +110,13 @@ export class MvnpmEventLog extends LitElement {
render() {
return html`
<div class="console">
${this.liveSync ? html` <p>Listening for new events
<l-dot-stream
size="20"
speed="2.5"
color="#66a5b1"
></l-dot-stream>
</p>`: ''}
${this._renderInitEventLog()}
</div>
`;
Expand All @@ -118,26 +125,12 @@ export class MvnpmEventLog extends LitElement {
private _renderInitEventLog() {
if (this._initEventLog && this._initEventLog.length > 0) {
return html`
<l-dot-stream
size="20"
speed="2.5"
color="#66a5b1"
></l-dot-stream><br/>
${this._initEventLog.map((entry) => {
return html`${this._renderLine(entry)}`
})}
`;
} else if (this.liveSync) {
return html`
<p>Nothing in the event log <br/>
<l-dot-stream
size="20"
speed="2.5"
color="#66a5b1"
></l-dot-stream>
</p>`;
} else {
return html`<p>Nothing in the event log</p>`;
return html`<p style="color: gray">Nothing yet in the event log</p>`;
}
}

Expand Down
22 changes: 8 additions & 14 deletions src/main/resources/web/app/mvnpm-progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ export class MvnpmProgress extends LitElement {
return html`
<div class="lane">
<h3>Queue</h3>
${this.liveSync ? html`<l-dot-stream
size="30"
speed="2.5"
color="#66a5b1"
></l-dot-stream>`:''}
${this._renderInitQueue()}
</div>
<div class="lane uploading">
Expand All @@ -197,22 +202,11 @@ export class MvnpmProgress extends LitElement {
private _renderInitQueue() {
if (this._initQueue && this._initQueue.length > 0) {
return html`
<vaadin-message-list .items="${this._initQueue}"></vaadin-message-list>
<l-dot-stream
size="30"
speed="2.5"
color="#66a5b1"
></l-dot-stream>`;
<vaadin-message-list .items="${this._initQueue}"></vaadin-message-list>`;
} else if (this.liveSync) {
return html`
<l-dot-stream
size="40"
speed="2.5"
color="#66a5b1"
></l-dot-stream> <br/>Waiting for items
`;
return html`Waiting for work`;
} else {
return html`No items`;
return html`<p style="color: gray">Nothing in the queue</p>`;
}
}

Expand Down

0 comments on commit 74cd3ab

Please sign in to comment.