mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
feat(dashboard): Document supported API versions and features
Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
parent
1987e4d39b
commit
f53814b2f9
6 changed files with 95 additions and 0 deletions
|
|
@ -13,6 +13,9 @@
|
|||
The Nextcloud Dashboard is your starting point of the day, giving you an overview of your upcoming appointments, urgent emails, chat messages, incoming tickets, latest tweets and much more! People can add the widgets they like and change the background to their liking.]]>
|
||||
</description>
|
||||
<version>7.10.0</version>
|
||||
<api-version>1</api-version>
|
||||
<api-version>2</api-version>
|
||||
<api-version>3</api-version>
|
||||
<licence>agpl</licence>
|
||||
<author>Julius Härtl</author>
|
||||
<namespace>Dashboard</namespace>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ $baseDir = $vendorDir;
|
|||
|
||||
return array(
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'OCA\\Dashboard\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
|
||||
'OCA\\Dashboard\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
|
||||
'OCA\\Dashboard\\Controller\\DashboardApiController' => $baseDir . '/../lib/Controller/DashboardApiController.php',
|
||||
'OCA\\Dashboard\\Controller\\DashboardController' => $baseDir . '/../lib/Controller/DashboardController.php',
|
||||
'OCA\\Dashboard\\ResponseDefinitions' => $baseDir . '/../lib/ResponseDefinitions.php',
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ class ComposerStaticInitDashboard
|
|||
|
||||
public static $classMap = array (
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
'OCA\\Dashboard\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
|
||||
'OCA\\Dashboard\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
|
||||
'OCA\\Dashboard\\Controller\\DashboardApiController' => __DIR__ . '/..' . '/../lib/Controller/DashboardApiController.php',
|
||||
'OCA\\Dashboard\\Controller\\DashboardController' => __DIR__ . '/..' . '/../lib/Controller/DashboardController.php',
|
||||
'OCA\\Dashboard\\ResponseDefinitions' => __DIR__ . '/..' . '/../lib/ResponseDefinitions.php',
|
||||
|
|
|
|||
31
apps/dashboard/lib/AppInfo/Application.php
Normal file
31
apps/dashboard/lib/AppInfo/Application.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Dashboard\AppInfo;
|
||||
|
||||
use OCA\Dashboard\Capabilities;
|
||||
use OCP\AppFramework\App;
|
||||
use OCP\AppFramework\Bootstrap\IBootContext;
|
||||
use OCP\AppFramework\Bootstrap\IBootstrap;
|
||||
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||
|
||||
class Application extends App implements IBootstrap {
|
||||
public const APP_ID = 'dashboard';
|
||||
|
||||
public function __construct(array $urlParams = []) {
|
||||
parent::__construct(self::APP_ID, $urlParams);
|
||||
}
|
||||
|
||||
public function register(IRegistrationContext $context): void {
|
||||
$context->registerCapability(Capabilities::class);
|
||||
}
|
||||
|
||||
public function boot(IBootContext $context): void {
|
||||
}
|
||||
}
|
||||
38
apps/dashboard/lib/Capabilities.php
Normal file
38
apps/dashboard/lib/Capabilities.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\Dashboard;
|
||||
|
||||
use OCP\Capabilities\ICapability;
|
||||
use OCP\Capabilities\IFeature;
|
||||
|
||||
class Capabilities implements ICapability, IFeature {
|
||||
/**
|
||||
* @return array{dashboard: array{enabled: bool}}
|
||||
*/
|
||||
public function getCapabilities(): array {
|
||||
return [
|
||||
'dashboard' => [
|
||||
'enabled' => true,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getFeatures(): array {
|
||||
return [
|
||||
'dashboard' => [
|
||||
'widgets-v1',
|
||||
'widget-items-v1',
|
||||
'widget-items-v2',
|
||||
'layout-v3',
|
||||
'statuses-v3',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -20,6 +20,25 @@
|
|||
}
|
||||
},
|
||||
"schemas": {
|
||||
"Capabilities": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"dashboard"
|
||||
],
|
||||
"properties": {
|
||||
"dashboard": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"enabled"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"OCSMeta": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
|
|
|||
Loading…
Reference in a new issue