mirror of
https://github.com/Kovah/LinkAce.git
synced 2025-04-20 23:11:56 +02:00
Merge branch 'main' into dev-v2
This commit is contained in:
commit
92c179a4e9
@ -3,8 +3,7 @@ _ide_*
|
||||
/.git
|
||||
/.idea
|
||||
/.tmp
|
||||
/storage/app/backup-temp
|
||||
/storage/app/backups
|
||||
/storage/app/backups/*
|
||||
/storage/debugbar/*
|
||||
/storage/framework/cache/*
|
||||
/storage/framework/sessions/*
|
||||
|
@ -51,7 +51,11 @@ class ImportCommand extends Command
|
||||
if ($this->option('skip-check')) {
|
||||
$this->info('Skipping link check.');
|
||||
} else {
|
||||
Artisan::queue('links:check');
|
||||
if (config('mail.host') !== null) {
|
||||
Artisan::queue('links:check');
|
||||
} else {
|
||||
$this->warn('Links are configured to be checked, but email is not configured!');
|
||||
}
|
||||
}
|
||||
|
||||
$this->info(trans('import.import_successfully', [
|
||||
|
@ -21,7 +21,7 @@ class LinkController extends Controller
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$links = Link::byUser(auth()->id())
|
||||
$links = Link::byUser()
|
||||
->orderBy(
|
||||
$request->input('order_by', 'created_at'),
|
||||
$request->input('order_dir', 'DESC')
|
||||
|
@ -21,7 +21,7 @@ class ListController extends Controller
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$lists = LinkList::byUser(auth()->id())
|
||||
$lists = LinkList::byUser()
|
||||
->orderBy(
|
||||
$request->input('order_by', 'created_at'),
|
||||
$request->input('order_dir', 'DESC')
|
||||
|
@ -21,7 +21,7 @@ class TagController extends Controller
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$tags = Tag::byUser(auth()->id())
|
||||
$tags = Tag::byUser()
|
||||
->orderBy(
|
||||
$request->input('order_by', 'created_at'),
|
||||
$request->input('order_dir', 'DESC')
|
||||
|
@ -18,22 +18,22 @@ class DashboardController extends Controller
|
||||
*/
|
||||
public function index(): View
|
||||
{
|
||||
$recentLinks = Link::byUser(auth()->user()->id)
|
||||
$recentLinks = Link::byUser()
|
||||
->latest()
|
||||
->limit(5)
|
||||
->get();
|
||||
|
||||
$recentTags = Tag::byUser(auth()->user()->id)
|
||||
$recentTags = Tag::byUser()
|
||||
->latest()
|
||||
->limit(25)
|
||||
->get();
|
||||
|
||||
$recentLists = LinkList::byUser(auth()->user()->id)
|
||||
$recentLists = LinkList::byUser()
|
||||
->latest()
|
||||
->limit(15)
|
||||
->get();
|
||||
|
||||
$brokenLinks = Link::byUser(auth()->user()->id)
|
||||
$brokenLinks = Link::byUser()
|
||||
->where('status', '>', 1)
|
||||
->count();
|
||||
|
||||
|
@ -23,19 +23,19 @@ class TrashController extends Controller
|
||||
public function index(): View
|
||||
{
|
||||
$links = Link::onlyTrashed()
|
||||
->byUser(auth()->id())
|
||||
->byUser()
|
||||
->get();
|
||||
|
||||
$lists = LinkList::onlyTrashed()
|
||||
->byUser(auth()->id())
|
||||
->byUser()
|
||||
->get();
|
||||
|
||||
$tags = Tag::onlyTrashed()
|
||||
->byUser(auth()->id())
|
||||
->byUser()
|
||||
->get();
|
||||
|
||||
$notes = Note::onlyTrashed()
|
||||
->byUser(auth()->id())
|
||||
->byUser()
|
||||
->get();
|
||||
|
||||
return view('app.trash.index', [
|
||||
|
@ -27,7 +27,7 @@ class FetchController extends Controller
|
||||
return response()->json([]);
|
||||
}
|
||||
|
||||
$tags = Tag::byUser(auth()->user()->id)
|
||||
$tags = Tag::byUser()
|
||||
->where('name', 'like', '%' . escapeSearchQuery($query) . '%')
|
||||
->oldest('name')
|
||||
->get();
|
||||
@ -57,7 +57,7 @@ class FetchController extends Controller
|
||||
return response()->json([]);
|
||||
}
|
||||
|
||||
$tags = LinkList::byUser(auth()->user()->id)
|
||||
$tags = LinkList::byUser()
|
||||
->where('name', 'like', '%' . escapeSearchQuery($query) . '%')
|
||||
->oldest('name')
|
||||
->get();
|
||||
@ -88,7 +88,7 @@ class FetchController extends Controller
|
||||
return response()->json([]);
|
||||
}
|
||||
|
||||
$link = Link::byUser(auth()->user()->id)
|
||||
$link = Link::byUser()
|
||||
->where('url', trim($query))
|
||||
->where('id', '!=', $request->input('ignore_id', 0))
|
||||
->first();
|
||||
|
@ -29,7 +29,7 @@ class LinkController extends Controller
|
||||
session()->put('links.index.orderBy', $orderBy);
|
||||
session()->put('links.index.orderDir', $orderDir);
|
||||
|
||||
$links = Link::byUser(auth()->id())
|
||||
$links = Link::byUser()
|
||||
->with('tags')
|
||||
->orderBy($orderBy, $orderDir)
|
||||
->paginate(getPaginationLimit());
|
||||
|
@ -28,7 +28,7 @@ class ListController extends Controller
|
||||
session()->put('lists.index.orderBy', $orderBy);
|
||||
session()->put('lists.index.orderDir', $orderDir);
|
||||
|
||||
$lists = LinkList::byUser(auth()->id())
|
||||
$lists = LinkList::byUser()
|
||||
->withCount('links')
|
||||
->orderBy($orderBy, $orderDir);
|
||||
|
||||
@ -88,7 +88,7 @@ class ListController extends Controller
|
||||
public function show(Request $request, LinkList $list): View
|
||||
{
|
||||
$links = $list->links()
|
||||
->byUser(auth()->id())
|
||||
->byUser()
|
||||
->orderBy(
|
||||
$request->input('orderBy', 'created_at'),
|
||||
$request->input('orderDir', 'desc')
|
||||
|
@ -28,7 +28,7 @@ class TagController extends Controller
|
||||
session()->put('tags.index.orderBy', $orderBy);
|
||||
session()->put('tags.index.orderDir', $orderDir);
|
||||
|
||||
$tags = Tag::byUser(auth()->id())
|
||||
$tags = Tag::byUser()
|
||||
->withCount('links')
|
||||
->orderBy($orderBy, $orderDir);
|
||||
|
||||
@ -88,7 +88,7 @@ class TagController extends Controller
|
||||
*/
|
||||
public function show(Request $request, Tag $tag): View
|
||||
{
|
||||
$links = $tag->links()->byUser(auth()->id())
|
||||
$links = $tag->links()->byUser()
|
||||
->orderBy(
|
||||
$request->input('orderBy', 'created_at'),
|
||||
$request->input('orderDir', 'desc')
|
||||
|
@ -24,7 +24,7 @@ use Illuminate\Support\Str;
|
||||
* @property string|null $deleted_at
|
||||
* @property-read Link $link
|
||||
* @property-read User $user
|
||||
* @method static Builder|Link byUser($user_id)
|
||||
* @method static Builder|Link byUser($user_id = null)
|
||||
*/
|
||||
class Note extends Model
|
||||
{
|
||||
@ -52,12 +52,15 @@ class Note extends Model
|
||||
/**
|
||||
* Scope for the user relation
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param int $user_id
|
||||
* @param Builder $query
|
||||
* @param int|null $user_id
|
||||
* @return Builder
|
||||
*/
|
||||
public function scopeByUser(Builder $query, int $user_id): Builder
|
||||
public function scopeByUser(Builder $query, int $user_id = null): Builder
|
||||
{
|
||||
if (is_null($user_id) && auth()->check()) {
|
||||
$user_id = auth()->id();
|
||||
}
|
||||
return $query->where('user_id', $user_id);
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ use OwenIt\Auditing\Contracts\Auditable;
|
||||
* @property int $user_id
|
||||
* @property string $key
|
||||
* @property mixed $value
|
||||
* @method static Builder|Setting byUser($user_id)
|
||||
* @method static Builder|Setting byUser($user_id = null)
|
||||
* @method static Builder|Setting systemOnly()
|
||||
*/
|
||||
class Setting extends Model implements Auditable
|
||||
@ -93,12 +93,15 @@ class Setting extends Model implements Auditable
|
||||
/**
|
||||
* Scope for the user relation
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param int $user_id
|
||||
* @param Builder $query
|
||||
* @param int|null $user_id
|
||||
* @return Builder
|
||||
*/
|
||||
public function scopeByUser(Builder $query, int $user_id): Builder
|
||||
public function scopeByUser(Builder $query, int $user_id = null): Builder
|
||||
{
|
||||
if (is_null($user_id) && auth()->check()) {
|
||||
$user_id = auth()->id();
|
||||
}
|
||||
return $query->where('user_id', $user_id);
|
||||
}
|
||||
|
||||
|
@ -23,22 +23,22 @@ class TrashRepository
|
||||
switch ($model) {
|
||||
case 'links':
|
||||
$entries = Link::onlyTrashed()
|
||||
->byUser(auth()->id())
|
||||
->byUser()
|
||||
->get();
|
||||
break;
|
||||
case 'lists':
|
||||
$entries = LinkList::onlyTrashed()
|
||||
->byUser(auth()->id())
|
||||
->byUser()
|
||||
->get();
|
||||
break;
|
||||
case 'tags':
|
||||
$entries = Tag::onlyTrashed()
|
||||
->byUser(auth()->id())
|
||||
->byUser()
|
||||
->get();
|
||||
break;
|
||||
case 'notes':
|
||||
$entries = Note::onlyTrashed()
|
||||
->byUser(auth()->id())
|
||||
->byUser()
|
||||
->get();
|
||||
break;
|
||||
}
|
||||
|
2380
package-lock.json
generated
2380
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "linkace",
|
||||
"version": "1.10.1",
|
||||
"version": "1.10.2",
|
||||
"description": "A small, selfhosted bookmark manager with advanced features, built with Laravel and Docker",
|
||||
"homepage": "https://github.com/Kovah/LinkAce",
|
||||
"repository": {
|
||||
|
4
resources/assets/js/components/TagsSelect.js
vendored
4
resources/assets/js/components/TagsSelect.js
vendored
@ -26,6 +26,10 @@ export default class TagsSelect {
|
||||
delimiter: ',',
|
||||
persist: false,
|
||||
create: this.selectAllowsCreation(),
|
||||
onItemAdd:function(){
|
||||
this.setTextboxValue('');
|
||||
this.refreshOptions();
|
||||
},
|
||||
load: (query, callback) => {
|
||||
this.handleTagLoading(query, callback);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user