remove post listings from web interface, process deletes (fix #33), stop caching objects

This commit is contained in:
Will Murphy 2020-12-22 21:20:39 -06:00
parent 458db4f2ea
commit dbe924aa7d
17 changed files with 69 additions and 59 deletions

13
package-lock.json generated
View file

@ -2645,7 +2645,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -3060,7 +3061,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -3116,6 +3118,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -3159,12 +3162,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},

View file

@ -28,7 +28,7 @@ router.post('/', net.validators.activity, net.security.verifySignature, function
.catch(e => console.log(e))
break
case 'Create':
toDo.saveObject = true
// toDo.saveObject = true
pub.actor.getOrCreateActor(req.user, true)
.then(user => {
const to = [
@ -40,6 +40,7 @@ router.post('/', net.validators.activity, net.security.verifySignature, function
return pub.activity.addToOutbox(user, announce)
}).catch(e => console.log(e))
break
case 'Delete':
case 'Undo':
pub.activity.undo(req.body.object, req.body.actor)
.catch(err => console.log(err.message))

1
web/dist/css/app.bf8cceb6.css vendored Normal file
View file

@ -0,0 +1 @@
#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50}.fas[data-v-520300bd]{margin-right:8px}h2[data-v-520300bd]{overflow:hidden;text-overflow:ellipsis}.profile[data-v-12d255e1]{width:300px}.profile-grid[data-v-12d255e1]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-line-pack:justify;align-content:space-between}.profile-image{width:75px}.icon[data-v-4bd8f499]{width:32px;height:32px}.invisible{display:none}.ellipsis:after{content:"\2026"}.w3-container.w3-content[data-v-335c9ffa]{max-width:800px}.profile-main[data-v-335c9ffa]{height:256px;width:256px}

View file

@ -1 +0,0 @@
#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50}.fas[data-v-c1288b72]{margin-right:8px}.profile[data-v-9c330358]{width:300px}.profile-grid[data-v-9c330358]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-line-pack:justify;align-content:space-between}.profile-image{width:75px}.icon[data-v-26eca70a]{width:32px;height:32px}.invisible{display:none}.ellipsis:after{content:"\2026"}.w3-container.w3-content[data-v-94492214]{max-width:800px}.profile-main[data-v-94492214]{height:256px;width:256px}

2
web/dist/index.html vendored
View file

@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/web/favicon.ico><link rel=stylesheet href=/web/w3.css><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Lato"><link rel=stylesheet href=/web/fontawesome/all.min.css><title>web</title><link href=/web/css/app.d86bd55d.css rel=preload as=style><link href=/web/js/app.08039a55.js rel=modulepreload as=script><link href=/web/js/chunk-vendors.f470a39b.js rel=modulepreload as=script><link href=/web/css/app.d86bd55d.css rel=stylesheet></head><body><noscript><strong>We're sorry but web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script type=module src=/web/js/chunk-vendors.f470a39b.js></script><script type=module src=/web/js/app.08039a55.js></script><script>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script><script src=/web/js/chunk-vendors-legacy.e214c0f7.js nomodule></script><script src=/web/js/app-legacy.b6253b62.js nomodule></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/web/favicon.ico><link rel=stylesheet href=/web/w3.css><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Lato"><link rel=stylesheet href=/web/fontawesome/all.min.css><title>web</title><link href=/web/css/app.bf8cceb6.css rel=preload as=style><link href=/web/js/app.636bc9fa.js rel=preload as=script><link href=/web/js/chunk-vendors.e214c0f7.js rel=preload as=script><link href=/web/css/app.bf8cceb6.css rel=stylesheet></head><body><noscript><strong>We're sorry but web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/web/js/chunk-vendors.e214c0f7.js></script><script src=/web/js/app.636bc9fa.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
web/dist/js/app.636bc9fa.js.map vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

47
web/package-lock.json generated
View file

@ -3026,7 +3026,8 @@
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
"integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
"dev": true
"dev": true,
"optional": true
},
"coa": {
"version": "2.0.2",
@ -5633,7 +5634,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -5654,12 +5656,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -5674,17 +5678,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -5801,7 +5808,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -5813,6 +5821,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -5827,6 +5836,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -5834,12 +5844,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -5858,6 +5870,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -5938,7 +5951,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -5950,6 +5964,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -6035,7 +6050,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -6071,6 +6087,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -6090,6 +6107,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -6133,12 +6151,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
@ -10194,7 +10214,8 @@
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
"integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
"dev": true
"dev": true,
"optional": true
},
"rx-lite-aggregates": {
"version": "4.0.8",

View file

@ -22,12 +22,12 @@
<p>Couldn't connect with your host.</p>
<p>You could try going back to your app and entering @{{ groupHandle }} in the search instead</p>
</div>
<div class="w3-container w3-content w3-padding-64">
<!-- <div class="w3-container w3-content w3-padding-64">
<h2 class="w3-wide w3-center">Recent group posts</h2>
<div>
<post-card v-for="post of stream" :activity="post" :key="post.id"/>
</div>
</div>
</div> -->
</div>
</template>
@ -116,21 +116,21 @@ export default {
.then(json => {
this.actor = json
})
.then(() => {
return window.fetch(this.actor.outbox, {
method: 'get',
mode: 'cors',
headers: {
accept: 'application/activity+json'
}
})
})
.then(res => res.json())
.then(outbox => {
this.stream = outbox.orderedItems // || fetch page
.filter(act => act.type === 'Announce')
.slice(0, this.postLimit)
})
// .then(() => {
// return window.fetch(this.actor.outbox, {
// method: 'get',
// mode: 'cors',
// headers: {
// accept: 'application/activity+json'
// }
// })
// })
// .then(res => res.json())
// .then(outbox => {
// this.stream = outbox.orderedItems // || fetch page
// .filter(act => act.type === 'Announce')
// .slice(0, this.postLimit)
// })
.catch(err => this.error = err.message)
}
}