Skip to content

Commit 4172755

Browse files
committed
implement feedback
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
1 parent 6bcc676 commit 4172755

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

lib/Controller/LogController.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99

1010
use OCA\ContextChat\Logger;
1111
use OCP\AppFramework\Controller;
12-
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
12+
use OCP\AppFramework\Http;
1313

14+
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
15+
use OCP\AppFramework\Http\Response;
16+
use OCP\AppFramework\Http\TextPlainResponse;
1417
use OCP\AppFramework\Http\ZipResponse;
1518
use OCP\IRequest;
1619

@@ -28,7 +31,7 @@ public function __construct(
2831
* @return ZipResponse
2932
*/
3033
#[NoCSRFRequired]
31-
public function getNextcloudLogs(): ZipResponse {
34+
public function getNextcloudLogs(): Response {
3235
$logFilepath = $this->logger->getLogFilepath();
3336
$response = new ZipResponse($this->request, 'nextcloud-logs');
3437
$filePath = $logFilepath;
@@ -39,6 +42,9 @@ public function getNextcloudLogs(): ZipResponse {
3942
$response->addResource($remoteFile, basename($filePath), $size, $time);
4043
$filePath = $logFilepath . '.' . $counter++;
4144
}
45+
if ($counter == 1) {
46+
return new TextPlainResponse('No log file found', Http::STATUS_NOT_FOUND);
47+
}
4248
return $response;
4349
}
4450
}

src/components/ViewAdmin.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ SPDX-License-Identifier: AGPL-3.0-or-later
4343
</td>
4444
</tr>
4545
</table>
46+
<p>&nbsp;</p>
47+
<p>{{ t('context_chat', 'Eligible files for indexing: {count}', {count: stats.eligible_files_count}) }}</p>
48+
<p>{{ t('context_chat', 'Queued content update actions: {count}', {count: stats.queued_actions_count}) }}</p>
4649
<h2>{{ t('context_chat', 'Context Chat Logs') }}</h2>
4750
<NcButton :href="downloadURLNextcloudLogs">
4851
{{ t('context_chat', 'Download Nextcloud logs') }}
4952
</NcButton>
5053
<NcButton :href="downloadURLDockerLogs">
5154
{{ t('context_chat', 'Download Backend logs') }}
5255
</NcButton>
53-
<p>&nbsp;</p>
54-
<p>{{ t('context_chat', 'Eligible files for indexing: {count}', {count: stats.eligible_files_count}) }}</p>
55-
<p>{{ t('context_chat', 'Queued content update actions: {count}', {count: stats.queued_actions_count}) }}</p>
5656
<p>
5757
<a href="https://docs.nextcloud.com/server/latest/admin_manual/ai/app_context_chat.html">{{
5858
t('context_chat', 'Official documentation')

0 commit comments

Comments
 (0)