Changeset - 0a11698fecc4
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 20 months ago 2023-05-30 06:37:08
drewp@bigasterisk.com
2 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
light9/homepage/ServiceButtonRow.ts
Show inline comments
 
import { LitElement, html, css } from "lit";
 
import { customElement, property } from "lit/decorators.js";
 
export { StatsLine } from "./StatsLine";
 

	
 
@customElement("service-button-row")
 
export class ServiceButtonRow extends LitElement {
 
  @property() name: string = "?";
 
  @property({ attribute: "metrics" }) hasMetrics: boolean = false;
 
  @property({ type:Boolean, attribute: "metrics" }) hasMetrics: boolean = false;
 
  static styles = [
 
    css`
 
      :host {
 
        padding-bottom: 10px;
 
        border-bottom: 1px solid #333;
 
      }
 
      a {
 
        color: #7d7dec;
 
      }
 
      div {
 
        display: flex;
 
        justify-content: space-between;
 
        padding: 2px 3px;
 
      }
 
      .left {
 
        display: inline-block;
 
        margin-right: 3px;
 
        flex-grow: 1;
 
      }
 
      .window {
 
      }
 
      .serviceGrid > td {
 
        border: 5px solid red;
 
        display: inline-block;
light9/web/ResourceDisplay.ts
Show inline comments
 
@@ -55,50 +55,51 @@ export class ResourceDisplay extends Lit
 
  render() {
 
    return html` <span class="${this.resClasses()}">
 
      <a href="${this.href()}" id="uri"> <!-- type icon goes here -->${this.label}</a>
 
    </span>`;
 
    // <template is="dom-if" if="{{rename}}">
 
    //   <button on-click="onRename">Rename</button>
 

	
 
    //   <paper-dialog id="renameDialog" modal on-iron-overlay-closed="onRenameClosed">
 
    //     <p>
 
    //       New label:
 
    //       <input id="renameTo" autofocus type="text" value="{{renameTo::input}}" on-keydown="onRenameKey" />
 
    //     </p>
 
    //     <div class="buttons">
 
    //       <paper-button dialog-dismiss>Cancel</paper-button>
 
    //       <paper-button dialog-confirm>OK</paper-button>
 
    //     </div>
 
    //   </paper-dialog>
 
    // </template>
 
    //    `;
 
  }
 
  // callers might set this as string or pass a NamedNode.
 
  @property() uri?: NamedNode | string;
 

	
 
  @state() label: string = "";
 
  @property() rename: boolean = false;
 
  @property() minor: boolean = false;
 
  
 
  @property({type: Boolean}) rename: boolean = false;
 
  @property({type: Boolean}) minor: boolean = false;
 
  // @state() renameTo: String; notify: true };
 

	
 
  constructor() {
 
    super();
 
    getTopGraph().then((g) => {
 
      this.graph = g;
 
      this.runUriHandler();
 
    });
 
  }
 

	
 
  realUri(): NamedNode {
 
    if (!this.uri) {
 
      return new NamedNode("");
 
    }
 
    return typeof this.uri === "string" ? new NamedNode(this.uri) : this.uri;
 
  }
 

	
 
  href() {
 
    if (!this.uri) {
 
      return "javascript:;";
 
    }
 
    return typeof this.uri === "string" ? this.uri : this.uri.value;
 
  }
 

	
0 comments (0 inline, 0 general)