mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 17:55:51 +00:00
Fix for new resource cache
This commit is contained in:
parent
336cdfe6a1
commit
504fb5fb13
@ -90,44 +90,44 @@ class QApps extends LitElement {
|
||||
--mdc-text-transform: none;
|
||||
--mdc-tab-color-default: var(--black);
|
||||
--mdc-tab-text-label-color-default: var(--black);
|
||||
}
|
||||
}
|
||||
|
||||
#pages {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 10px 5px 5px 5px;
|
||||
margin: 0px 20px 20px 20px;
|
||||
}
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 10px 5px 5px 5px;
|
||||
margin: 0px 20px 20px 20px;
|
||||
}
|
||||
|
||||
#pages > button {
|
||||
user-select: none;
|
||||
padding: 5px;
|
||||
margin: 0 5px;
|
||||
border-radius: 10%;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
font: inherit;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
color: var(--black);
|
||||
}
|
||||
#pages > button {
|
||||
user-select: none;
|
||||
padding: 5px;
|
||||
margin: 0 5px;
|
||||
border-radius: 10%;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
font: inherit;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
color: var(--black);
|
||||
}
|
||||
|
||||
#pages > button:not([disabled]):hover,
|
||||
#pages > button:focus {
|
||||
color: #ccc;
|
||||
background-color: #eee;
|
||||
}
|
||||
#pages > button:not([disabled]):hover,
|
||||
#pages > button:focus {
|
||||
color: #ccc;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
#pages > button[selected] {
|
||||
font-weight: bold;
|
||||
color: var(--white);
|
||||
background-color: #ccc;
|
||||
}
|
||||
#pages > button[selected] {
|
||||
font-weight: bold;
|
||||
color: var(--white);
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
#pages > button[disabled] {
|
||||
#pages > button[disabled] {
|
||||
opacity: 0.5;
|
||||
cursor: default;
|
||||
}
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#apps-list-page {
|
||||
background: var(--white);
|
||||
@ -579,7 +579,7 @@ class QApps extends LitElement {
|
||||
url: `/arbitrary/relaymode?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
|
||||
this.relayMode = relayMode;
|
||||
this.relayMode = relayMode
|
||||
setTimeout(getRelayMode, 600000)
|
||||
}
|
||||
|
||||
@ -645,9 +645,9 @@ class QApps extends LitElement {
|
||||
changeTheme() {
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
if (checkTheme === 'dark') {
|
||||
this.theme = 'dark';
|
||||
this.theme = 'dark'
|
||||
} else {
|
||||
this.theme = 'light';
|
||||
this.theme = 'light'
|
||||
}
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
}
|
||||
@ -784,7 +784,7 @@ class QApps extends LitElement {
|
||||
this.pages.forEach((pageNumber) => {
|
||||
const pageBtn = document.createElement('button')
|
||||
pageBtn.textContent = pageNumber
|
||||
let offset = 0;
|
||||
let offset = 0
|
||||
pageBtn.addEventListener('click', (e) => {
|
||||
if (parseInt(e.target.textContent) > 1) {
|
||||
offset = (parseInt(e.target.textContent) - 1) * 20
|
||||
@ -910,12 +910,14 @@ class QApps extends LitElement {
|
||||
}
|
||||
|
||||
renderDownload(downObj) {
|
||||
if (downObj.status.description === "Published but not yet downloaded" || downObj.status.status === "MISSING_DATA") {
|
||||
return html`<mwc-button ?disabled="${this.btnDisabled}" dense unelevated label="${translate("appspage.schange36")}" icon="download" @click=${() => this.downloadApp(downObj)}></mwc-button>`
|
||||
} else if (downObj.status.description === "Ready" || downObj.status.status === "DOWNLOADED") {
|
||||
return html`<a class="visitSite" href="../qdn/browser/index.html?name=${downObj.name}&service=${this.service}"><mwc-button class="green" dense unelevated label="${translate("appspage.schange39")}" icon="open_in_browser"></mwc-button></a>`
|
||||
if (downObj.status != null) {
|
||||
if (downObj.status.description === "Published but not yet downloaded" || downObj.status.status === "MISSING_DATA") {
|
||||
return html`<mwc-button ?disabled="${this.btnDisabled}" dense unelevated label="${translate("appspage.schange36")}" icon="download" @click=${() => this.downloadApp(downObj)}></mwc-button>`
|
||||
} else if (downObj.status.description === "Ready" || downObj.status.status === "DOWNLOADED") {
|
||||
return html`<a class="visitSite" href="../qdn/browser/index.html?name=${downObj.name}&service=${this.service}"><mwc-button class="green" dense unelevated label="${translate("appspage.schange39")}" icon="open_in_browser"></mwc-button></a>`
|
||||
}
|
||||
} else {
|
||||
return html``
|
||||
return html`<mwc-button ?disabled="${this.btnDisabled}" dense unelevated label="${translate("appspage.schange36")}" icon="download" @click=${() => this.downloadApp(downObj)}></mwc-button>`
|
||||
}
|
||||
}
|
||||
|
||||
@ -1183,42 +1185,47 @@ class QApps extends LitElement {
|
||||
let title = name
|
||||
let description = ""
|
||||
let categoryName = this.renderCatText()
|
||||
let tags = "";
|
||||
let tags = ""
|
||||
let sizeReadable = ""
|
||||
|
||||
if (appObj.metadata != null) {
|
||||
title = appObj.metadata.title;
|
||||
description = appObj.metadata.description;
|
||||
categoryName = appObj.metadata.categoryName;
|
||||
title = appObj.metadata.title
|
||||
description = appObj.metadata.description
|
||||
categoryName = appObj.metadata.categoryName
|
||||
if (appObj.metadata.tags != null && appObj.metadata.tags.length > 0) {
|
||||
tags = "Tags: " + appObj.metadata.tags.join(", ")
|
||||
}
|
||||
}
|
||||
|
||||
if (appObj.size != null) {
|
||||
sizeReadable = this.bytesToSize(appObj.size);
|
||||
sizeReadable = this.bytesToSize(appObj.size)
|
||||
}
|
||||
|
||||
return html`
|
||||
<div class="resourceTitle">
|
||||
${title}
|
||||
</div>
|
||||
<div class="resourceDescription">
|
||||
${description}
|
||||
</div>
|
||||
<div class="resourceTitle">${title}</div>
|
||||
<div class="resourceDescription">${description}</div>
|
||||
<div class="resourceCategoryTags">
|
||||
${categoryName}
|
||||
${tags.length > 0 ? " | " : ""}
|
||||
${tags}
|
||||
${sizeReadable.length > 0 ? " | " : ""}
|
||||
${translate("appspage.schange27")}: ${sizeReadable}
|
||||
${tags.length > 0 ? " | " : ""}
|
||||
${tags}
|
||||
${sizeReadable.length > 0 ? " | " : ""}
|
||||
${translate("appspage.schange27")}: ${sizeReadable}
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
renderPublishedBy(appObj) {
|
||||
return html`<div class="resourceRegisteredName">${appObj.name}</div>
|
||||
<div class="resourceStatus">${translate("appspage.schange28")}: <span title="${appObj.status.description}">${appObj.status.title}</span></div>`
|
||||
if (appObj.status != null) {
|
||||
return html`
|
||||
<div class="resourceRegisteredName">${appObj.name}</div>
|
||||
<div class="resourceStatus">${translate("appspage.schange28")}: <span title="${appObj.status.description}">${appObj.status.title}</span></div>
|
||||
`
|
||||
} else {
|
||||
return html`
|
||||
<div class="resourceRegisteredName">${appObj.name}</div>
|
||||
<div class="resourceStatus">${translate("appspage.schange28")}: <span title="Published but not yet downloaded">Published</span></div>
|
||||
`
|
||||
}
|
||||
}
|
||||
|
||||
renderSize(appObj) {
|
||||
|
@ -86,41 +86,41 @@ class Websites extends LitElement {
|
||||
}
|
||||
|
||||
#pages {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 10px 5px 5px 5px;
|
||||
margin: 0px 20px 20px 20px;
|
||||
}
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 10px 5px 5px 5px;
|
||||
margin: 0px 20px 20px 20px;
|
||||
}
|
||||
|
||||
#pages > button {
|
||||
user-select: none;
|
||||
#pages > button {
|
||||
user-select: none;
|
||||
padding: 5px;
|
||||
margin: 0 5px;
|
||||
border-radius: 10%;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
font: inherit;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
margin: 0 5px;
|
||||
border-radius: 10%;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
font: inherit;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
color: var(--black);
|
||||
}
|
||||
}
|
||||
|
||||
#pages > button:not([disabled]):hover,
|
||||
#pages > button:focus {
|
||||
color: #ccc;
|
||||
background-color: #eee;
|
||||
}
|
||||
#pages > button:not([disabled]):hover,
|
||||
#pages > button:focus {
|
||||
color: #ccc;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
#pages > button[selected] {
|
||||
font-weight: bold;
|
||||
color: var(--white);
|
||||
background-color: #ccc;
|
||||
}
|
||||
#pages > button[selected] {
|
||||
font-weight: bold;
|
||||
color: var(--white);
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
#pages > button[disabled] {
|
||||
opacity: 0.5;
|
||||
cursor: default;
|
||||
}
|
||||
#pages > button[disabled] {
|
||||
opacity: 0.5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#websites-list-page {
|
||||
background: var(--white);
|
||||
@ -428,7 +428,7 @@ class Websites extends LitElement {
|
||||
url: `/arbitrary/relaymode?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
|
||||
this.relayMode = relayMode;
|
||||
this.relayMode = relayMode
|
||||
setTimeout(getRelayMode, 600000)
|
||||
}
|
||||
|
||||
@ -494,9 +494,9 @@ class Websites extends LitElement {
|
||||
changeTheme() {
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
if (checkTheme === 'dark') {
|
||||
this.theme = 'dark';
|
||||
this.theme = 'dark'
|
||||
} else {
|
||||
this.theme = 'light';
|
||||
this.theme = 'light'
|
||||
}
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
}
|
||||
@ -619,7 +619,7 @@ class Websites extends LitElement {
|
||||
} else {
|
||||
offset = 0
|
||||
}
|
||||
this.getData(offset);
|
||||
this.getData(offset)
|
||||
const selectedPage = parseInt(this.pagesControl.querySelector('[selected]').textContent)
|
||||
this.updateItemsFromPage(selectedPage - 1)
|
||||
})
|
||||
@ -628,14 +628,14 @@ class Websites extends LitElement {
|
||||
this.pages.forEach((pageNumber) => {
|
||||
const pageBtn = document.createElement('button')
|
||||
pageBtn.textContent = pageNumber
|
||||
let offset = 0;
|
||||
let offset = 0
|
||||
pageBtn.addEventListener('click', (e) => {
|
||||
if (parseInt(e.target.textContent) > 1) {
|
||||
offset = (parseInt(e.target.textContent) - 1) * 20
|
||||
} else {
|
||||
offset = 0
|
||||
}
|
||||
this.getData(offset);
|
||||
this.getData(offset)
|
||||
this.updateItemsFromPage(parseInt(e.target.textContent))
|
||||
})
|
||||
if (pageNumber === page) {
|
||||
@ -652,7 +652,7 @@ class Websites extends LitElement {
|
||||
} else {
|
||||
offset = 0
|
||||
}
|
||||
this.getData(offset);
|
||||
this.getData(offset)
|
||||
const selectedPage = parseInt(this.pagesControl.querySelector('[selected]').textContent)
|
||||
this.updateItemsFromPage(selectedPage + 1)
|
||||
})
|
||||
@ -992,7 +992,7 @@ class Websites extends LitElement {
|
||||
let title = name
|
||||
let description = ""
|
||||
let categoryName = this.renderCatText()
|
||||
let tags = "";
|
||||
let tags = ""
|
||||
let sizeReadable = ""
|
||||
|
||||
if (websiteObj.metadata != null) {
|
||||
@ -1005,29 +1005,36 @@ class Websites extends LitElement {
|
||||
}
|
||||
|
||||
if (websiteObj.size != null) {
|
||||
sizeReadable = this.bytesToSize(websiteObj.size);
|
||||
sizeReadable = this.bytesToSize(websiteObj.size)
|
||||
}
|
||||
|
||||
return html`
|
||||
<div class="resourceTitle">
|
||||
<a class="visitSite" href="browser/index.html?name=${name}&service=${this.service}">${title}</a>
|
||||
</div>
|
||||
<div class="resourceDescription">
|
||||
${description}
|
||||
</div>
|
||||
<div class="resourceDescription">${description}</div>
|
||||
<div class="resourceCategoryTags">
|
||||
${categoryName}
|
||||
${tags.length > 0 ? " | " : ""}
|
||||
${tags}
|
||||
${sizeReadable.length > 0 ? " | " : ""}
|
||||
${translate("websitespage.schange27")}: ${sizeReadable}
|
||||
${tags.length > 0 ? " | " : ""}
|
||||
${tags}
|
||||
${sizeReadable.length > 0 ? " | " : ""}
|
||||
${translate("websitespage.schange27")}: ${sizeReadable}
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
renderPublishedBy(websiteObj) {
|
||||
return html`<div class="resourceRegisteredName">${websiteObj.name}</div>
|
||||
<div class="resourceStatus">${translate("websitespage.schange28")}: <span title="${websiteObj.status.description}">${websiteObj.status.title}</span></div>`
|
||||
if (websiteObj.status != null) {
|
||||
return html`
|
||||
<div class="resourceRegisteredName">${websiteObj.name}</div>
|
||||
<div class="resourceStatus">${translate("websitespage.schange28")}: <span title="${websiteObj.status.description}">${websiteObj.status.title}</span></div>
|
||||
`
|
||||
} else {
|
||||
return html`
|
||||
<div class="resourceRegisteredName">${websiteObj.name}</div>
|
||||
<div class="resourceStatus">${translate("websitespage.schange28")}: <span title="Published but not yet downloaded">Published</span></div>
|
||||
`
|
||||
}
|
||||
}
|
||||
|
||||
renderSize(websiteObj) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user