Compare commits

..

No commits in common. "abde709e540321cf19bf438f1bacb8939b53b1e1" and "66234b14bcb4c040d08944eceb17620749fc957e" have entirely different histories.

4 changed files with 20 additions and 14 deletions

View File

@ -320,7 +320,8 @@ class TfMessageElement extends LitElement {
</button> </button>
`; `;
} else { } else {
return html` <div class="w3-container w3-margin-bottom"> return html`
<div class="w3-container w3-margin-bottom">
${repeat( ${repeat(
this.message.child_messages || [], this.message.child_messages || [],
(x) => x.id, (x) => x.id,
@ -341,8 +342,8 @@ class TfMessageElement extends LitElement {
style="box-sizing: border-box" style="box-sizing: border-box"
@click=${() => self.set_expanded(false)} @click=${() => self.set_expanded(false)}
> >
Collapse Collapse</button
</button>`; >`;
} }
} else { } else {
return undefined; return undefined;
@ -552,8 +553,12 @@ class TfMessageElement extends LitElement {
` `
: undefined; : undefined;
return html` return html`
<div class="w3-section w3-container">${reply}</div> <div class="w3-section w3-container">
<footer>${this.render_children()}</footer> ${reply}
</div>
<footer>
${this.render_children()}
</footer>
`; `;
} }

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "💾", "emoji": "💾",
"previous": "&tzZFIe7Y54O4sx1QtAPdemkXh+p5qHXSG/dlS7NP6OQ=.sha256" "previous": "&mvGTlWKFR5QM/3nb4fJ2WQq0n/gNKvBmhGDkAvb8ki8=.sha256"
} }

View File

@ -8,7 +8,7 @@ async function query(sql, args) {
async function get_biggest() { async function get_biggest() {
return query(` return query(`
select author, size from messages_stats group by author order by size desc limit 10; select author, sum(length(content)) as size from messages group by author order by size desc limit 10;
`); `);
} }
@ -62,14 +62,15 @@ function nice_size(bytes) {
} }
async function main() { async function main() {
await app.setDocument('<p style="color: #fff">Analyzing feeds...</p>'); await app.setDocument(
let most_follows = get_most_follows(); '<p style="color: #fff">Finding the top 10 largest feeds...</p>'
);
let most_follows = await get_most_follows();
let total = await get_total(); let total = await get_total();
let identities = await ssb.getAllIdentities(); let identities = await ssb.getAllIdentities();
let following1 = await ssb.following(identities, 1); let following1 = await ssb.following(identities, 1);
let following2 = await ssb.following(identities, 2); let following2 = await ssb.following(identities, 2);
let biggest = await get_biggest(); let biggest = await get_biggest();
most_follows = await most_follows;
let names = await get_names( let names = await get_names(
[].concat( [].concat(
biggest.map((x) => x.author), biggest.map((x) => x.author),
@ -93,7 +94,7 @@ async function main() {
} }
let html = `<body style="color: #000; background-color: #ddd">\n let html = `<body style="color: #000; background-color: #ddd">\n
<h1>Storage Summary</h1> <h1>Storage Summary</h1>
<h2>Top Accounts by Size</h2> <h2>Top 10 Accounts by Size</h2>
<ol>`; <ol>`;
for (let item of biggest) { for (let item of biggest) {
html += `<li> html += `<li>
@ -104,7 +105,7 @@ async function main() {
} }
html += ` html += `
</ol> </ol>
<h2>Top Accounts by Follows</h2> <h2>Top 10 Accounts by Follows</h2>
<ol>`; <ol>`;
for (let item of most_follows) { for (let item of most_follows) {
html += `<li> html += `<li>

View File

@ -950,7 +950,7 @@ bool tf_ssb_db_blob_store(tf_ssb_t* ssb, const uint8_t* blob, size_t size, char*
result = r == SQLITE_DONE; result = r == SQLITE_DONE;
if (!result) if (!result)
{ {
tf_printf("Blob store failed: %s.\n", sqlite3_errmsg(db)); tf_printf("Blob store failed: %s.", sqlite3_errmsg(db));
} }
rows = sqlite3_changes(db); rows = sqlite3_changes(db);
} }