diff --git a/Linkding/Linkding.php b/Linkding/Linkding.php new file mode 100644 index 0000000000..fc6485fb55 --- /dev/null +++ b/Linkding/Linkding.php @@ -0,0 +1,49 @@ +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()); + $details = json_decode($res->getBody()); + + $data = []; + if ($details) { + $status = 'active'; + $data = [ + "bookmark_count" => $details->count, + ]; + } + + return parent::getLiveStats($status, $data); + } + + public function url($endpoint) + { + $api_url = parent::normaliseurl($this->config->url) . $endpoint; + return $api_url; + } + + private function getHeaders() + { + return [ + "headers" => [ + "Authorization" => "Token " . $this->config->access_token, + ], + ]; + } +} diff --git a/Linkding/app.json b/Linkding/app.json new file mode 100644 index 0000000000..0d0e49cc78 --- /dev/null +++ b/Linkding/app.json @@ -0,0 +1,10 @@ +{ + "appid": "1a039cf9812aee2944f3e2c472288fab189bc1a9", + "name": "Linkding", + "website": "https://linkding.link/", + "license": "MIT License", + "description": "A self-hosted bookmark manager designed to be minimal, fast, and easy to set up.", + "enhanced": true, + "tile_background": "dark", + "icon": "linkding.png" +} \ No newline at end of file diff --git a/Linkding/config.blade.php b/Linkding/config.blade.php new file mode 100644 index 0000000000..dbf84ab082 --- /dev/null +++ b/Linkding/config.blade.php @@ -0,0 +1,15 @@ +

{{ __('app.apps.config') }} ({{ __('app.optional') }}) @include('items.enable')

+
+
+ + {!! Form::text('config[override_url]', null, array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!} +
+
+ + {!! Form::text('config[access_token]', null, array('placeholder' => 'Access Token', 'data-config' => 'access_token', 'class' => 'form-control config-item')) !!} +
+
+ +
+
+ diff --git a/Linkding/linkding.png b/Linkding/linkding.png new file mode 100644 index 0000000000..8f214d5b7c Binary files /dev/null and b/Linkding/linkding.png differ diff --git a/Linkding/livestats.blade.php b/Linkding/livestats.blade.php new file mode 100644 index 0000000000..0d2cb41e0e --- /dev/null +++ b/Linkding/livestats.blade.php @@ -0,0 +1,10 @@ + \ No newline at end of file