mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 22:41:27 +00:00
Merge pull request #2043 from pixelfed/staging
Add modlog notifications
This commit is contained in:
commit
b008e0a47b
18 changed files with 293 additions and 120 deletions
66
app/Observers/ModLogObserver.php
Normal file
66
app/Observers/ModLogObserver.php
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Notification;
|
||||
use App\ModLog;
|
||||
use App\Services\ModLogService;
|
||||
use Log;
|
||||
|
||||
class ModLogObserver
|
||||
{
|
||||
/**
|
||||
* Handle the mod log "created" event.
|
||||
*
|
||||
* @param \App\ModLog $modLog
|
||||
* @return void
|
||||
*/
|
||||
public function created(ModLog $modLog)
|
||||
{
|
||||
ModLogService::boot()->load($modLog)->fanout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the mod log "updated" event.
|
||||
*
|
||||
* @param \App\ModLog $modLog
|
||||
* @return void
|
||||
*/
|
||||
public function updated(ModLog $modLog)
|
||||
{
|
||||
ModLogService::boot()->load($modLog)->fanout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the mod log "deleted" event.
|
||||
*
|
||||
* @param \App\ModLog $modLog
|
||||
* @return void
|
||||
*/
|
||||
public function deleted(ModLog $modLog)
|
||||
{
|
||||
ModLogService::boot()->load($modLog)->unfanout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the mod log "restored" event.
|
||||
*
|
||||
* @param \App\ModLog $modLog
|
||||
* @return void
|
||||
*/
|
||||
public function restored(ModLog $modLog)
|
||||
{
|
||||
ModLogService::boot()->load($modLog)->fanout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the mod log "force deleted" event.
|
||||
*
|
||||
* @param \App\ModLog $modLog
|
||||
* @return void
|
||||
*/
|
||||
public function forceDeleted(ModLog $modLog)
|
||||
{
|
||||
ModLogService::boot()->load($modLog)->unfanout();
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ namespace App\Providers;
|
|||
use App\Observers\{
|
||||
AvatarObserver,
|
||||
NotificationObserver,
|
||||
ModLogObserver,
|
||||
StatusHashtagObserver,
|
||||
UserObserver,
|
||||
UserFilterObserver,
|
||||
|
@ -12,6 +13,7 @@ use App\Observers\{
|
|||
use App\{
|
||||
Avatar,
|
||||
Notification,
|
||||
ModLog,
|
||||
StatusHashtag,
|
||||
User,
|
||||
UserFilter
|
||||
|
@ -35,6 +37,7 @@ class AppServiceProvider extends ServiceProvider
|
|||
|
||||
Avatar::observe(AvatarObserver::class);
|
||||
Notification::observe(NotificationObserver::class);
|
||||
ModLog::observe(ModLogObserver::class);
|
||||
StatusHashtag::observe(StatusHashtagObserver::class);
|
||||
User::observe(UserObserver::class);
|
||||
UserFilter::observe(UserFilterObserver::class);
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
namespace App\Services;
|
||||
|
||||
use Auth;
|
||||
use App\ModLog;
|
||||
use App\Notification;
|
||||
use App\User;
|
||||
|
||||
class ModLogService {
|
||||
|
@ -95,4 +97,46 @@ class ModLogService {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public function load($modLog)
|
||||
{
|
||||
$this->log = $modLog;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function fanout()
|
||||
{
|
||||
$log = $this->log;
|
||||
|
||||
$msg = "{$log->user_username} commented on a modlog";
|
||||
$rendered = "<span class='font-weight-bold'>{$log->user_username}</span> commented on a <a href='/i/admin/users/modlogs/{$log->user_id}}' class='font-weight-bold text-decoration-none'>modlog</a>";
|
||||
$item_id = $log->id;
|
||||
$item_type = 'App\ModLog';
|
||||
$action = 'admin.user.modlog.comment';
|
||||
|
||||
$admins = User::whereNull('status')
|
||||
->whereNotIn('id', [$log->user_id])
|
||||
->whereIsAdmin(true)
|
||||
->pluck('profile_id')
|
||||
->toArray();
|
||||
|
||||
foreach($admins as $user) {
|
||||
$n = new Notification;
|
||||
$n->profile_id = $user;
|
||||
$n->actor_id = $log->admin->profile_id;
|
||||
$n->item_id = $item_id;
|
||||
$n->item_type = $item_type;
|
||||
$n->action = $action;
|
||||
$n->message = $msg;
|
||||
$n->rendered = $rendered;
|
||||
$n->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function unfanout()
|
||||
{
|
||||
Notification::whereItemType('App\ModLog')
|
||||
->whereItemId($this->log->id)
|
||||
->delete();
|
||||
}
|
||||
}
|
|
@ -13,7 +13,8 @@ class NotificationTransformer extends Fractal\TransformerAbstract
|
|||
protected $defaultIncludes = [
|
||||
'account',
|
||||
'status',
|
||||
'relationship'
|
||||
'relationship',
|
||||
'modlog'
|
||||
];
|
||||
|
||||
public function transform(Notification $notification)
|
||||
|
@ -54,6 +55,7 @@ class NotificationTransformer extends Fractal\TransformerAbstract
|
|||
'share' => 'share',
|
||||
'like' => 'favourite',
|
||||
'comment' => 'comment',
|
||||
'admin.user.modlog.comment' => 'modlog'
|
||||
];
|
||||
return $verbs[$verb];
|
||||
}
|
||||
|
@ -62,4 +64,25 @@ class NotificationTransformer extends Fractal\TransformerAbstract
|
|||
{
|
||||
return $this->item($notification->actor, new RelationshipTransformer());
|
||||
}
|
||||
|
||||
public function includeModlog(Notification $notification)
|
||||
{
|
||||
$n = $notification;
|
||||
if($n->item_id && $n->item_type == 'App\ModLog') {
|
||||
$ml = $n->item;
|
||||
if(!empty($ml)) {
|
||||
$res = $this->item($ml, function($ml) {
|
||||
return [
|
||||
'id' => $ml->object_uid,
|
||||
'url' => url('/i/admin/users/modlogs/' . $ml->object_uid)
|
||||
];
|
||||
});
|
||||
return $res;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
208
package-lock.json
generated
208
package-lock.json
generated
|
@ -820,10 +820,20 @@
|
|||
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz",
|
||||
"integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw=="
|
||||
},
|
||||
"@nuxt/opencollective": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.3.0.tgz",
|
||||
"integrity": "sha512-Vf09BxCdj1iT2IRqVwX5snaY2WCTkvM0O4cWWSO1ThCFuc4if0Q/nNwAgCxRU0FeYHJ7DdyMUNSdswCLKlVqeg==",
|
||||
"requires": {
|
||||
"chalk": "^2.4.2",
|
||||
"consola": "^2.10.1",
|
||||
"node-fetch": "^2.6.0"
|
||||
}
|
||||
},
|
||||
"@trevoreyre/autocomplete-vue": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@trevoreyre/autocomplete-vue/-/autocomplete-vue-2.0.3.tgz",
|
||||
"integrity": "sha512-8P0aaNQ7FV56QinQo08OdT9WJtVaaC/elNqM0Mg/ich6kbxO2Y0NQtAP//jQM9Z6j1NXq/UVI1o+Xl97nSGt0g=="
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@trevoreyre/autocomplete-vue/-/autocomplete-vue-2.1.0.tgz",
|
||||
"integrity": "sha512-N3qShgDwNgoHsvQ1X4iF2aKJ8vhGMz+xzmQbKCALu1PY4M827l5r62vcE7Gp/CyVeYumeFwC5OfVJyozDfkjLg=="
|
||||
},
|
||||
"@types/events": {
|
||||
"version": "3.0.0",
|
||||
|
@ -1372,9 +1382,9 @@
|
|||
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
|
||||
},
|
||||
"aws4": {
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz",
|
||||
"integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A=="
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz",
|
||||
"integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug=="
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.18.1",
|
||||
|
@ -1636,37 +1646,20 @@
|
|||
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24="
|
||||
},
|
||||
"bootstrap": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.0.tgz",
|
||||
"integrity": "sha512-dqCYJNs/Fxa3IVQ+v/lC694POCThUjZsA4wwqs8l+yk67B6ww2Ki++WaM6CVGe5+tArBBrknzjjh01/NT5rLjA=="
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz",
|
||||
"integrity": "sha512-tbx5cHubwE6e2ZG7nqM3g/FZ5PQEDMWmMGNrCUBVRPHXTJaH7CBDdsLeu3eCh3B1tzAxTnAbtmrzvWEvT2NNEA=="
|
||||
},
|
||||
"bootstrap-vue": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.1.0.tgz",
|
||||
"integrity": "sha512-dftb5fc42x7QLv814nN+3Cx8MMuCB+xrGQjOmSXH81ET0+yo7KYb4lUN3/pOnf+8Tkv8oaawZ1OOth5/AZfktg==",
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.4.1.tgz",
|
||||
"integrity": "sha512-EMSCcBPhrd+zjbTp8cmVUPn/5jYE+SQbbvQR1PpthujYyxxltSEsBFXF/XNfKouPdvRy8rVgc/KgThQ+YouRZA==",
|
||||
"requires": {
|
||||
"@nuxt/opencollective": "^0.3.0",
|
||||
"bootstrap": ">=4.3.1 <5.0.0",
|
||||
"popper.js": "^1.16.0",
|
||||
"portal-vue": "^2.1.6",
|
||||
"bootstrap": ">=4.4.1 <5.0.0",
|
||||
"popper.js": "^1.16.1",
|
||||
"portal-vue": "^2.1.7",
|
||||
"vue-functional-data-merge": "^3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/opencollective": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.3.0.tgz",
|
||||
"integrity": "sha512-Vf09BxCdj1iT2IRqVwX5snaY2WCTkvM0O4cWWSO1ThCFuc4if0Q/nNwAgCxRU0FeYHJ7DdyMUNSdswCLKlVqeg==",
|
||||
"requires": {
|
||||
"chalk": "^2.4.2",
|
||||
"consola": "^2.10.1",
|
||||
"node-fetch": "^2.6.0"
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"brace-expansion": {
|
||||
|
@ -1906,7 +1899,7 @@
|
|||
},
|
||||
"camelcase-keys": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
|
||||
"integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
|
||||
"requires": {
|
||||
"camelcase": "^2.0.0",
|
||||
|
@ -2222,9 +2215,9 @@
|
|||
"integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg=="
|
||||
},
|
||||
"consola": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.11.0.tgz",
|
||||
"integrity": "sha512-2bcAqHastlPSCvZ+ur8bgHInGAWvUnysWz3h3xRX+/XZoCY7avolJJnVXOPGoVoyCcg1b231XixonoArmgxaoA=="
|
||||
"version": "2.11.3",
|
||||
"resolved": "https://registry.npmjs.org/consola/-/consola-2.11.3.tgz",
|
||||
"integrity": "sha512-aoW0YIIAmeftGR8GSpw6CGQluNdkWMWh3yEFjH/hmynTYnMtibXszii3lxCXmk8YxJtI3FAK5aTiquA5VH68Gw=="
|
||||
},
|
||||
"console-browserify": {
|
||||
"version": "1.2.0",
|
||||
|
@ -4187,7 +4180,7 @@
|
|||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
|
@ -4349,12 +4342,12 @@
|
|||
}
|
||||
},
|
||||
"globule": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz",
|
||||
"integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==",
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/globule/-/globule-1.3.1.tgz",
|
||||
"integrity": "sha512-OVyWOHgw29yosRHCHo7NncwR1hW5ew0W/UrvtwvjefVJeQ26q4/8r8FmPsSF1hJ93IgWkyv16pCTz6WblMzm/g==",
|
||||
"requires": {
|
||||
"glob": "~7.1.1",
|
||||
"lodash": "~4.17.10",
|
||||
"lodash": "~4.17.12",
|
||||
"minimatch": "~3.0.2"
|
||||
}
|
||||
},
|
||||
|
@ -4504,9 +4497,9 @@
|
|||
"integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg=="
|
||||
},
|
||||
"howler": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/howler/-/howler-2.1.2.tgz",
|
||||
"integrity": "sha512-oKrTFaVXsDRoB/jik7cEpWKTj7VieoiuzMYJ7E/EU5ayvmpRhumCv3YQ3823zi9VTJkSWAhbryHnlZAionGAJg=="
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/howler/-/howler-2.1.3.tgz",
|
||||
"integrity": "sha512-PSGbOi1EYgw80C5UQbxtJM7TmzD+giJunIMBYyH3RVzHZx2fZLYBoes0SpVVHi/SFa1GoNtgXj/j6I7NOKYBxQ=="
|
||||
},
|
||||
"hpack.js": {
|
||||
"version": "2.1.6",
|
||||
|
@ -4951,12 +4944,9 @@
|
|||
"integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI="
|
||||
},
|
||||
"is-finite": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
|
||||
"integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz",
|
||||
"integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w=="
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
|
@ -5103,9 +5093,9 @@
|
|||
"integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw=="
|
||||
},
|
||||
"js-base64": {
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz",
|
||||
"integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw=="
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz",
|
||||
"integrity": "sha512-Vg8czh0Q7sFBSUMWWArX/miJeBWYBPpdU/3M/DKSaekLMqrqVPaedp+5mZhie/r0lgrcaYBfwXatEew6gwgiQQ=="
|
||||
},
|
||||
"js-levenshtein": {
|
||||
"version": "1.1.6",
|
||||
|
@ -5271,7 +5261,7 @@
|
|||
},
|
||||
"load-json-file": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
|
||||
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
|
@ -5291,7 +5281,7 @@
|
|||
},
|
||||
"pify": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
||||
}
|
||||
}
|
||||
|
@ -5554,7 +5544,7 @@
|
|||
},
|
||||
"meow": {
|
||||
"version": "3.7.0",
|
||||
"resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
|
||||
"integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
|
||||
"requires": {
|
||||
"camelcase-keys": "^2.0.0",
|
||||
|
@ -5789,6 +5779,11 @@
|
|||
"lower-case": "^1.1.1"
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
},
|
||||
"node-forge": {
|
||||
"version": "0.9.0",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz",
|
||||
|
@ -5815,7 +5810,7 @@
|
|||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
|
||||
"integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8="
|
||||
}
|
||||
}
|
||||
|
@ -5878,9 +5873,9 @@
|
|||
}
|
||||
},
|
||||
"node-sass": {
|
||||
"version": "4.13.0",
|
||||
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.0.tgz",
|
||||
"integrity": "sha512-W1XBrvoJ1dy7VsvTAS5q1V45lREbTlZQqFbiHb3R3OTTCma0XBtuG6xZ6Z4506nR4lmHPTqVRwxT6KgtWC97CA==",
|
||||
"version": "4.13.1",
|
||||
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.1.tgz",
|
||||
"integrity": "sha512-TTWFx+ZhyDx1Biiez2nB0L3YrCZ/8oHagaDalbuBSlqXgUPsdkUSzJsVxeDO9LtPB49+Fh3WQl3slABo6AotNw==",
|
||||
"requires": {
|
||||
"async-foreach": "^0.1.3",
|
||||
"chalk": "^1.1.1",
|
||||
|
@ -5908,7 +5903,7 @@
|
|||
},
|
||||
"chalk": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||
"requires": {
|
||||
"ansi-styles": "^2.2.1",
|
||||
|
@ -5938,7 +5933,7 @@
|
|||
},
|
||||
"supports-color": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
||||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
|
||||
},
|
||||
"yallist": {
|
||||
|
@ -6186,7 +6181,7 @@
|
|||
},
|
||||
"os-homedir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
|
||||
},
|
||||
"os-locale": {
|
||||
|
@ -6431,14 +6426,14 @@
|
|||
}
|
||||
},
|
||||
"popper.js": {
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.0.tgz",
|
||||
"integrity": "sha512-+G+EkOPoE5S/zChTpmBSSDYmhXJ5PsW8eMhH8cP/CQHMFPBG/kC9Y5IIw6qNYgdJ+/COf0ddY2li28iHaZRSjw=="
|
||||
"version": "1.16.1",
|
||||
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz",
|
||||
"integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ=="
|
||||
},
|
||||
"portal-vue": {
|
||||
"version": "2.1.6",
|
||||
"resolved": "https://registry.npmjs.org/portal-vue/-/portal-vue-2.1.6.tgz",
|
||||
"integrity": "sha512-lvCF85D4e8whd0nN32D8FqKwwkk7nYUI3Ku8UAEx4Z1reomu75dv5evRUTZNaj1EalxxWNXiNl0EHRq36fG8WA=="
|
||||
"version": "2.1.7",
|
||||
"resolved": "https://registry.npmjs.org/portal-vue/-/portal-vue-2.1.7.tgz",
|
||||
"integrity": "sha512-+yCno2oB3xA7irTt0EU5Ezw22L2J51uKAacE/6hMPMoO/mx3h4rXFkkBkT4GFsMDv/vEe8TNKC3ujJJ0PTwb6g=="
|
||||
},
|
||||
"portfinder": {
|
||||
"version": "1.0.25",
|
||||
|
@ -7102,9 +7097,9 @@
|
|||
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
|
||||
},
|
||||
"psl": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz",
|
||||
"integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw=="
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz",
|
||||
"integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ=="
|
||||
},
|
||||
"public-encrypt": {
|
||||
"version": "4.0.3",
|
||||
|
@ -7279,7 +7274,7 @@
|
|||
},
|
||||
"pify": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
||||
}
|
||||
}
|
||||
|
@ -7474,9 +7469,9 @@
|
|||
"integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs="
|
||||
},
|
||||
"request": {
|
||||
"version": "2.88.0",
|
||||
"resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
|
||||
"integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
|
||||
"version": "2.88.2",
|
||||
"resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
|
||||
"integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
|
||||
"requires": {
|
||||
"aws-sign2": "~0.7.0",
|
||||
"aws4": "^1.8.0",
|
||||
|
@ -7485,7 +7480,7 @@
|
|||
"extend": "~3.0.2",
|
||||
"forever-agent": "~0.6.1",
|
||||
"form-data": "~2.3.2",
|
||||
"har-validator": "~5.1.0",
|
||||
"har-validator": "~5.1.3",
|
||||
"http-signature": "~1.2.0",
|
||||
"is-typedarray": "~1.0.0",
|
||||
"isstream": "~0.1.2",
|
||||
|
@ -7495,7 +7490,7 @@
|
|||
"performance-now": "^2.1.0",
|
||||
"qs": "~6.5.2",
|
||||
"safe-buffer": "^5.1.2",
|
||||
"tough-cookie": "~2.4.3",
|
||||
"tough-cookie": "~2.5.0",
|
||||
"tunnel-agent": "^0.6.0",
|
||||
"uuid": "^3.3.2"
|
||||
},
|
||||
|
@ -7682,9 +7677,9 @@
|
|||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"sass": {
|
||||
"version": "1.23.7",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.23.7.tgz",
|
||||
"integrity": "sha512-cYgc0fanwIpi0rXisGxl+/wadVQ/HX3RhpdRcjLdj2o2ye/sxUTpAxIhbmJy3PLQgRFbf6Pn8Jsrta2vdXcoOQ==",
|
||||
"version": "1.25.0",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.25.0.tgz",
|
||||
"integrity": "sha512-uQMjye0Y70SEDGO56n0j91tauqS9E1BmpKHtiYNQScXDHeaE9uHwNEqQNFf4Bes/3DHMNinB6u79JsG10XWNyw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chokidar": ">=2.0.0 <4.0.0"
|
||||
|
@ -7744,7 +7739,7 @@
|
|||
},
|
||||
"os-locale": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
|
||||
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
|
||||
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
|
||||
"requires": {
|
||||
"lcid": "^1.0.0"
|
||||
|
@ -7757,7 +7752,7 @@
|
|||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
|
@ -7860,7 +7855,7 @@
|
|||
"dependencies": {
|
||||
"source-map": {
|
||||
"version": "0.4.4",
|
||||
"resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
|
||||
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
|
||||
"requires": {
|
||||
"amdefine": ">=0.0.4"
|
||||
|
@ -8816,14 +8811,26 @@
|
|||
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
|
||||
},
|
||||
"tough-cookie": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
|
||||
"integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
|
||||
"integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
|
||||
"requires": {
|
||||
"psl": "^1.1.24",
|
||||
"punycode": "^1.4.1"
|
||||
"psl": "^1.1.28",
|
||||
"punycode": "^2.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"punycode": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
||||
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"tributejs": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/tributejs/-/tributejs-4.1.1.tgz",
|
||||
"integrity": "sha512-jc+PcaiNzMjCn2LAQb3i4ic94EsSfLW8Jlk1sK2cb6hLcZFalU9ThcF8rxuKkTUKv1GIvTwN8XseLzCXLxB4lw=="
|
||||
},
|
||||
"trim-newlines": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
|
||||
|
@ -9149,9 +9156,9 @@
|
|||
"integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ=="
|
||||
},
|
||||
"vue": {
|
||||
"version": "2.6.10",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz",
|
||||
"integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ=="
|
||||
"version": "2.6.11",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.11.tgz",
|
||||
"integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ=="
|
||||
},
|
||||
"vue-carousel": {
|
||||
"version": "0.18.0",
|
||||
|
@ -9234,9 +9241,9 @@
|
|||
}
|
||||
},
|
||||
"vue-template-compiler": {
|
||||
"version": "2.6.10",
|
||||
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.10.tgz",
|
||||
"integrity": "sha512-jVZkw4/I/HT5ZMvRnhv78okGusqe0+qH2A0Em0Cp8aq78+NK9TII263CDVz2QXZsIT+yyV/gZc/j/vlwa+Epyg==",
|
||||
"version": "2.6.11",
|
||||
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.11.tgz",
|
||||
"integrity": "sha512-KIq15bvQDrcCjpGjrAhx4mUlyyHfdmTaoNfeoATHLAiWB+MU3cx4lOzMwrnUh9cCxy0Lt1T11hAFY6TQgroUAA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"de-indent": "^1.0.2",
|
||||
|
@ -9256,6 +9263,11 @@
|
|||
"date-fns": "^1.29.0"
|
||||
}
|
||||
},
|
||||
"vue-tribute": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/vue-tribute/-/vue-tribute-1.0.4.tgz",
|
||||
"integrity": "sha512-wkvmBxpXWdWCHsyiTMObRenRwbsYqe30avvM7sD4gocEY8eYKGT4J17Z8RMUwrTNckUmwsZXvBzA/q8wh/eBeA=="
|
||||
},
|
||||
"watchpack": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz",
|
||||
|
@ -9813,9 +9825,9 @@
|
|||
}
|
||||
},
|
||||
"zuck.js": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/zuck.js/-/zuck.js-1.5.4.tgz",
|
||||
"integrity": "sha512-vCNaP+mLHzslUJrIj3FakFfno9wKWJatlTKYCW7EjxN4xkodfEIcm5QrE+J9UdPSTn9TTaXrDRgaJZeG3Er7HA=="
|
||||
"version": "1.5.6",
|
||||
"resolved": "https://registry.npmjs.org/zuck.js/-/zuck.js-1.5.6.tgz",
|
||||
"integrity": "sha512-/nzdLWt8qTsw+qin90vUTQ4hVmzARYn1esiDXY8oBUXJ2PFdZms0qDn6JVFkIgZp5rLBrDcsZUum3o6pneI3YQ=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
22
package.json
22
package.json
|
@ -12,31 +12,32 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.18.1",
|
||||
"bootstrap": ">=4.4.0",
|
||||
"bootstrap": "^4.4.1",
|
||||
"cross-env": "^5.2.1",
|
||||
"jquery": "^3.4.1",
|
||||
"lodash": ">=4.17.13",
|
||||
"popper.js": "^1.16.0",
|
||||
"popper.js": "^1.16.1",
|
||||
"resolve-url-loader": "^2.3.2",
|
||||
"sass": "^1.23.7",
|
||||
"sass": "^1.25.0",
|
||||
"sass-loader": "^7.3.1",
|
||||
"vue": "^2.6.10",
|
||||
"vue": "^2.6.11",
|
||||
"vue-masonry-css": "^1.0.3",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"@trevoreyre/autocomplete-vue": "^2.0.3",
|
||||
"bootstrap-vue": "^2.1.0",
|
||||
"@trevoreyre/autocomplete-vue": "^2.1.0",
|
||||
"bootstrap-vue": "^2.4.1",
|
||||
"filesize": "^3.6.1",
|
||||
"howler": "^2.1.2",
|
||||
"howler": "^2.1.3",
|
||||
"infinite-scroll": "^3.0.6",
|
||||
"laravel-echo": "^1.6.1",
|
||||
"laravel-mix": "^4.1.4",
|
||||
"node-sass": "^4.13.0",
|
||||
"node-sass": "^4.13.1",
|
||||
"promise-polyfill": "8.1.0",
|
||||
"quill": "^1.3.7",
|
||||
"readmore-js": "^2.2.1",
|
||||
"sweetalert": "^2.1.2",
|
||||
"tributejs": "^4.1.1",
|
||||
"twitter-text": "^2.0.5",
|
||||
"vue-carousel": "^0.18.0",
|
||||
"vue-content-loader": "^0.2.2",
|
||||
|
@ -44,7 +45,8 @@
|
|||
"vue-infinite-loading": "^2.4.4",
|
||||
"vue-loading-overlay": "^3.2.0",
|
||||
"vue-timeago": "^5.1.2",
|
||||
"zuck.js": "^1.5.4"
|
||||
"vue-tribute": "^1.0.4",
|
||||
"zuck.js": "^1.5.6"
|
||||
},
|
||||
"collective": {
|
||||
"type": "opencollective",
|
||||
|
|
BIN
public/css/app.css
vendored
BIN
public/css/app.css
vendored
Binary file not shown.
BIN
public/css/appdark.css
vendored
BIN
public/css/appdark.css
vendored
Binary file not shown.
BIN
public/css/landing.css
vendored
BIN
public/css/landing.css
vendored
Binary file not shown.
BIN
public/js/components.js
vendored
BIN
public/js/components.js
vendored
Binary file not shown.
BIN
public/js/compose.js
vendored
BIN
public/js/compose.js
vendored
Binary file not shown.
BIN
public/js/profile.js
vendored
BIN
public/js/profile.js
vendored
Binary file not shown.
BIN
public/js/status.js
vendored
BIN
public/js/status.js
vendored
Binary file not shown.
BIN
public/js/timeline.js
vendored
BIN
public/js/timeline.js
vendored
Binary file not shown.
BIN
public/js/vendor.js
vendored
BIN
public/js/vendor.js
vendored
Binary file not shown.
Binary file not shown.
|
@ -4,7 +4,7 @@
|
|||
<div class="card notification-card shadow-none border">
|
||||
<div class="card-header bg-white">
|
||||
<p class="mb-0 d-flex align-items-center justify-content-between">
|
||||
<span><i class="far fa-bell fa-lg text-white"></i></span>
|
||||
<span data-toggle="tooltip" data-placement="bottom"><i class="fas fa-redo fa-lg text-white"></i></span>
|
||||
<span class="small text-dark text-uppercase font-weight-bold">Alerts</span>
|
||||
<a class="text-decoration-none text-muted" href="/account/activity"><i class="fas fa-inbox fa-lg"></i></a>
|
||||
</p>
|
||||
|
@ -43,6 +43,11 @@
|
|||
<a :href="n.account.url" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> shared your <a class="font-weight-bold" v-bind:href="n.status.reblog.url">post</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div v-else-if="n.type == 'modlog'">
|
||||
<p class="my-0">
|
||||
<a :href="n.account.url" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> updated a <a class="font-weight-bold" v-bind:href="n.modlog.url">modlog</a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="small text-muted font-weight-bold" :title="n.created_at">{{timeAgo(n.created_at)}}</div>
|
||||
</div>
|
||||
|
@ -193,6 +198,32 @@
|
|||
}
|
||||
});
|
||||
}, interval);
|
||||
},
|
||||
|
||||
refreshNotifications() {
|
||||
let self = this;
|
||||
axios.get('/api/pixelfed/v1/notifications')
|
||||
.then(res => {
|
||||
let data = res.data.filter(n => {
|
||||
if(n.type == 'share' || self.notificationMaxId >= n.id) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if(data.length > 0) {
|
||||
let ids = data.map(n => n.id);
|
||||
let max = Math.max(ids);
|
||||
if(max <= self.notificationMaxId) {
|
||||
return;
|
||||
} else {
|
||||
self.notificationMaxId = max;
|
||||
self.notifications = data;
|
||||
let beep = new Audio('/static/beep.mp3');
|
||||
beep.volume = 0.7;
|
||||
beep.play();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -675,9 +675,9 @@ export default {
|
|||
},
|
||||
|
||||
fetchData() {
|
||||
let self = this;
|
||||
axios.get('/api/v2/profile/'+this.statusUsername+'/status/'+this.statusId)
|
||||
.then(response => {
|
||||
let self = this;
|
||||
self.status = response.data.status;
|
||||
self.user = response.data.user;
|
||||
window._sharedData.curUser = self.user;
|
||||
|
@ -696,15 +696,7 @@ export default {
|
|||
this.loaded = true;
|
||||
$('head title').text(this.status.account.username + ' posted a photo: ' + this.status.favourites_count + ' likes');
|
||||
}).catch(error => {
|
||||
if(!error.response) {
|
||||
} else {
|
||||
switch(error.response.status) {
|
||||
case 401:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
swal('Oops!', 'An error occured, please try refreshing the page.', 'error');
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue