From b69d191970258913ccb5ac15bc3c49b525d45256 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Thu, 30 May 2024 11:55:20 +0200 Subject: [PATCH] move personal and admin settings to AI sections Signed-off-by: Julien Veyssier --- README.md | 4 +-- appinfo/info.xml | 2 -- lib/Settings/Admin.php | 2 +- lib/Settings/AdminSection.php | 50 -------------------------------- lib/Settings/Personal.php | 2 +- lib/Settings/PersonalSection.php | 50 -------------------------------- 6 files changed, 4 insertions(+), 106 deletions(-) delete mode 100644 lib/Settings/AdminSection.php delete mode 100644 lib/Settings/PersonalSection.php diff --git a/README.md b/README.md index 4aa5e00f..335e8422 100644 --- a/README.md +++ b/README.md @@ -80,12 +80,12 @@ Learn more about the Nextcloud Ethical AI Rating [in our blog](https://nextcloud ### Admin settings -There is a "Connected accounts" **admin** settings section where you can: +There is a "Artificial intelligence" **admin** settings section where you can: * Choose whether you use OpenAI, a LocalAI instance or another remote service * Set a global API key (or basic auth credentials) for the Nextcloud instance * Configure default models and quota settings ### Personal settings -There is a "Connected accounts" **personal** settings section to let users set their personal API key or basic auth credentials. +There is a "Artificial intelligence" **personal** settings section to let users set their personal API key or basic auth credentials. Users can also see their quota information there. diff --git a/appinfo/info.xml b/appinfo/info.xml index 2155f417..539b7a07 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -101,8 +101,6 @@ Learn more about the Nextcloud Ethical AI Rating [in our blog](https://nextcloud OCA\OpenAi\Settings\Admin - OCA\OpenAi\Settings\AdminSection OCA\OpenAi\Settings\Personal - OCA\OpenAi\Settings\PersonalSection diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 5fb56be3..4167800b 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -25,7 +25,7 @@ public function getForm(): TemplateResponse { } public function getSection(): string { - return 'connected-accounts'; + return 'ai'; } public function getPriority(): int { diff --git a/lib/Settings/AdminSection.php b/lib/Settings/AdminSection.php deleted file mode 100644 index 17b1e921..00000000 --- a/lib/Settings/AdminSection.php +++ /dev/null @@ -1,50 +0,0 @@ -l->t('Connected accounts'); - } - - /** - * @return int whether the form should be rather on the top or bottom of - * the settings navigation. The sections are arranged in ascending order of - * the priority values. It is required to return a value between 0 and 99. - */ - public function getPriority(): int { - return 80; - } - - /** - * @return string The relative path to an icon describing the section - */ - public function getIcon(): string { - return $this->urlGenerator->imagePath('core', 'categories/integration.svg'); - } -} diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php index 07d6920f..ccb2e207 100644 --- a/lib/Settings/Personal.php +++ b/lib/Settings/Personal.php @@ -29,7 +29,7 @@ public function getForm(): TemplateResponse { } public function getSection(): string { - return 'connected-accounts'; + return 'ai'; } public function getPriority(): int { diff --git a/lib/Settings/PersonalSection.php b/lib/Settings/PersonalSection.php deleted file mode 100644 index 289601ff..00000000 --- a/lib/Settings/PersonalSection.php +++ /dev/null @@ -1,50 +0,0 @@ -l->t('Connected accounts'); - } - - /** - * @return int whether the form should be rather on the top or bottom of - * the settings navigation. The sections are arranged in ascending order of - * the priority values. It is required to return a value between 0 and 99. - */ - public function getPriority(): int { - return 80; - } - - /** - * @return string The relative path to an icon describing the section - */ - public function getIcon(): string { - return $this->urlGenerator->imagePath('core', 'categories/integration.svg'); - } -}