begin to work on vue

This commit is contained in:
Michel Roux 2023-06-24 17:18:27 +02:00
parent 245eee7ba6
commit 8351f5109b
4 changed files with 55 additions and 35 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM nextcloud:25
ENV NEXTCLOUD_UPDATE 1
ENV NEXTCLOUD_ADMIN_USER repod
ENV NEXTCLOUD_ADMIN_PASSWORD repod
ENV SQLITE_DATABASE repod
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install -y nodejs && \
/entrypoint.sh true
USER www-data
COPY --chown=www-data:www-data . apps/repod
RUN curl -sSLo /tmp/gpoddersync.tar.gz https://github.com/thrillfall/nextcloud-gpodder/releases/download/3.8.1/gpoddersync.tar.gz && \
tar xvzf /tmp/gpoddersync.tar.gz -C apps && \
rm /tmp/gpoddersync.tar.gz && \
cd apps/repod && make build && cd - \
php occ app:enable gpoddersync repod
USER root

View File

@ -11,13 +11,7 @@ declare(strict_types=1);
* it's instantiated in there * it's instantiated in there
*/ */
return [ return [
'resources' => [
'note' => ['url' => '/notes'],
'note_api' => ['url' => '/api/0.1/notes']
],
'routes' => [ 'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'], ['name' => 'page#index', 'url' => '/', 'verb' => 'GET']
['name' => 'note_api#preflighted_cors', 'url' => '/api/0.1/{path}',
'verb' => 'OPTIONS', 'requirements' => ['path' => '.+']]
] ]
]; ];

View File

@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace OCA\RePod\Controller;
use OCA\RePod\AppInfo\Application;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IRequest;
use OCP\Util;
class PageController extends Controller {
public function __construct(IRequest $request) {
parent::__construct(Application::APP_ID, $request);
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index(): TemplateResponse {
Util::addScript(Application::APP_ID, 'repod-main');
return new TemplateResponse(Application::APP_ID, 'main');
}
}

View File

@ -1,12 +1,8 @@
<template> <template>
<div id="content" class="app-repod"> <NcContent app-name="repod">
<NcAppNavigation> <NcAppNavigation>
<NcAppNavigationNew v-if="!loading" <NcAppNavigationNew :text="t('repod', 'New note')"
:text="t('repod', 'New note')" @click="discover" />
:disabled="false"
button-id="new-repod-button"
button-class="icon-add"
@click="newNote" />
<ul> <ul>
<NcAppNavigationItem v-for="note in notes" <NcAppNavigationItem v-for="note in notes"
:key="note.id" :key="note.id"
@ -31,31 +27,12 @@
</ul> </ul>
</NcAppNavigation> </NcAppNavigation>
<NcAppContent> <NcAppContent>
<div v-if="currentNote">
<input ref="title"
v-model="currentNote.title"
type="text"
:disabled="updating">
<textarea ref="content" v-model="currentNote.content" :disabled="updating" />
<input type="button"
class="primary"
:value="t('repod', 'Save')"
:disabled="updating || !savePossible"
@click="saveNote">
</div>
<div v-else id="emptycontent">
<div class="icon-file" />
<h2>
{{
t('repod', 'Create a note to get started') }}
</h2>
</div>
</NcAppContent> </NcAppContent>
</div> </NcContent>
</template> </template>
<script> <script>
import { NcActionButton, NcAppContent, NcAppNavigation, NcAppNavigationItem, NcAppNavigationNew } from '@nextcloud/vue' import { NcActionButton, NcAppContent, NcContent, NcAppNavigation, NcAppNavigationItem, NcAppNavigationNew } from '@nextcloud/vue'
import '@nextcloud/dialogs/dist/index.css' import '@nextcloud/dialogs/dist/index.css'
import { generateUrl } from '@nextcloud/router' import { generateUrl } from '@nextcloud/router'
@ -70,6 +47,7 @@ export default {
NcAppNavigation, NcAppNavigation,
NcAppNavigationItem, NcAppNavigationItem,
NcAppNavigationNew, NcAppNavigationNew,
NcContent
}, },
data() { data() {
return { return {