Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Linkding/Linkding.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ public function __construct() {

public function test()
{
$test = parent::appTest($this->url('api/bookmarks?limit=1'), $this->getHeaders());
$test = parent::appTest($this->url('api/bookmarks/?limit=1'), $this->getHeaders());
echo $test->status;
}

public function livestats()
{
$status = 'inactive';
$res = parent::execute($this->url('api/bookmarks?limit=1000'), $this->getHeaders());
$res = parent::execute($this->url('api/bookmarks/?limit=10000'), $this->getHeaders());
$details = json_decode($res->getBody());

$data = [];
if ($details) {
$status = 'active';
$data = [
"bookmark_count" => $details->count,
"bookmarkCount" => $details->count
];
}

Expand All @@ -42,7 +42,8 @@ private function getHeaders()
{
return [
"headers" => [
"Authorization" => "Token " . $this->config->access_token,
"accept" => "application/json",
"Authorization" => "Token " . $this->config->apikey
],
];
}
Expand Down
7 changes: 3 additions & 4 deletions Linkding/config.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
<div class="items">
<div class="input">
<label>{{ strtoupper(__('app.url')) }}</label>
{!! Form::text('config[override_url]', null, array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
{!! Form::text('config[override_url]', isset($item) ? $item->getconfig()->override_url : null, array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
</div>
<div class="input">
<label>Access Token</label>
{!! Form::text('config[access_token]', null, array('placeholder' => 'Access Token', 'data-config' => 'access_token', 'class' => 'form-control config-item')) !!}
<label>{{ __('app.apps.apikey') }}</label>
{!! Form::text('config[apikey]', isset($item) ? $item->getconfig()->apikey : null, array('placeholder' => __('app.apps.apikey'), 'data-config' => 'apikey', 'class' => 'form-control config-item')) !!}
</div>
<div class="input">
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
</div>
</div>

8 changes: 2 additions & 6 deletions Linkding/livestats.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<ul class="livestats">
<li>
<span class="title">Bookmarks</span>
@if ($bookmark_count >== 1000)
<strong>{!! $bookmark_count !!}</strong>
@else
<strong class="text-danger">1000+</strong>
@endif
<strong>{!! $bookmarkCount !!}</strong>
</li>
</ul>
</ul>
Loading