sehr viel
This commit is contained in:
parent
f7c509650f
commit
a366afe8f7
|
|
@ -0,0 +1,2 @@
|
|||
<?php
|
||||
\OCP\Util::addScript('da_agency', 'tm');
|
||||
|
|
@ -13,11 +13,11 @@
|
|||
<nextcloud min-version="16"/>
|
||||
</dependencies>
|
||||
<navigations>
|
||||
<!--<navigation>
|
||||
<name>Agenturmigration</name>
|
||||
<route>agency.page.index</route>
|
||||
<navigation>
|
||||
<name>Uhr</name>
|
||||
<route>da_agency.page.index</route>
|
||||
<icon>app.svg</icon>
|
||||
</navigation>-->
|
||||
</navigation>
|
||||
</navigations>
|
||||
<types>
|
||||
<filesystem/>
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ class Application extends App {
|
|||
|
||||
# Event before a File is deletet
|
||||
$dispatcher->addServiceListener(BeforeNodeDeletedEvent::class, DeleteNCFileDjango::class);
|
||||
|
||||
#Util::addScript($this->appName, 'da_agency-timemanagement');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,8 +68,6 @@ class DeleteNCFileDjango extends Controller {
|
|||
];
|
||||
$context = stream_context_create($opts);
|
||||
|
||||
|
||||
|
||||
$file = file_get_contents($this->nclink.'/api/deletefile/'.$event->getNode()->getId().'/87zuhjk87GHJ546tzgvhas76aaskbdhr45edfVHAKia87s6gbAVGFGSR3451627gBHAKJBN', false, $context);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,11 @@ class PageController extends Controller {
|
|||
*/
|
||||
|
||||
public function index() {
|
||||
Util::addScript($this->appName, 'agency-main');
|
||||
Util::addStyle($this->appName, 'icons');
|
||||
Util::addScript($this->appName, 'da_agency-main');
|
||||
//Util::addScript($this->appName, 'da_agency-timemanagement');
|
||||
//Util::addStyle($this->appName, 'icons');
|
||||
|
||||
$response = new TemplateResponse($this->appName, 'main');
|
||||
$response = new TemplateResponse('da_agency', 'main');
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
12
src/App.vue
12
src/App.vue
|
|
@ -1,23 +1,15 @@
|
|||
<template>
|
||||
<Content app-name="app">
|
||||
<vue-confirm-dialog />
|
||||
<AppNavigation />
|
||||
<AppContent>
|
||||
<router-view />
|
||||
</AppContent>
|
||||
<Content app-name="App">
|
||||
<h2>Single-column main content</h2>
|
||||
</Content>
|
||||
</template>
|
||||
<script>
|
||||
import Content from '@nextcloud/vue/dist/Components/Content'
|
||||
import AppNavigation from './components/Navigation'
|
||||
import AppContent from '@nextcloud/vue/dist/Components/AppContent'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
Content,
|
||||
AppNavigation,
|
||||
AppContent,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
13
src/main.js
13
src/main.js
|
|
@ -4,24 +4,11 @@ import VueRouter from 'vue-router'
|
|||
import Routes from './router/routes'
|
||||
import VueFormulate from '@braid/vue-formulate'
|
||||
import { de } from '@braid/vue-formulate-i18n'
|
||||
import { BootstrapVue, BootstrapVueIcons } from 'bootstrap-vue'
|
||||
import 'bootstrap/dist/css/bootstrap.css'
|
||||
import 'bootstrap-vue/dist/bootstrap-vue.css'
|
||||
import 'bootstrap-vue/dist/bootstrap-vue-icons.min.css'
|
||||
import VueConfirmDialog from 'vue-confirm-dialog'
|
||||
// import { translate, translatePlural } from '@nextcloud/l10n'
|
||||
// import store from './store'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
Vue.use(VueFormulate, {
|
||||
plugins: [de],
|
||||
locale: 'de',
|
||||
})
|
||||
// Vue.prototype.t = translate
|
||||
// Vue.prototype.n = translatePlural
|
||||
Vue.use(VueConfirmDialog)
|
||||
Vue.use(BootstrapVue)
|
||||
Vue.use(BootstrapVueIcons)
|
||||
Vue.prototype.$hostname = 'http://localhost:8080'
|
||||
|
||||
const router = new VueRouter({
|
||||
|
|
|
|||
|
|
@ -1,22 +1,9 @@
|
|||
import AgencyData from '../views/AgencyData'
|
||||
import Migrate from '../views/Migrate'
|
||||
import GroupManagement from '../views/GroupManagement'
|
||||
import App from '../App'
|
||||
|
||||
export default [
|
||||
{
|
||||
path: '/agencydata',
|
||||
name: 'agencydata',
|
||||
component: AgencyData,
|
||||
},
|
||||
{
|
||||
path: '/groupmanagement',
|
||||
name: 'groupmanagemenet',
|
||||
component: GroupManagement,
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
name: 'migrate',
|
||||
component: Migrate,
|
||||
name: 'app',
|
||||
component: App,
|
||||
},
|
||||
]
|
||||
// TODO: Hier migrate usw. auf den richtigen Pfad setzen und agencydata auch wieder auf agencydata usw.
|
||||
|
|
|
|||
40
src/store.js
40
src/store.js
|
|
@ -1,40 +0,0 @@
|
|||
/*import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
const axios = require('axios').default
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
agencyId: null,
|
||||
agency: null,
|
||||
},
|
||||
mutations: {
|
||||
getAgencyId(state) {
|
||||
return state.agencyId
|
||||
},
|
||||
setAgencyId(state, id) {
|
||||
state.agencyId = id
|
||||
},
|
||||
getAgency(state) {
|
||||
return state.agency
|
||||
},
|
||||
setAgency(state, agency) {
|
||||
state.agency = agency
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async loadAgencyData({ commit }) {
|
||||
// axios.get(generateUrl('/apps/agency/getagencyidbyuser')).then(response => {
|
||||
// console.log('Here we load...')
|
||||
// this.agencyId = response.data.agency
|
||||
// }) + this.$store.state.agencyId
|
||||
const agencydata = await axios.get(generateUrl('/apps/agency/agencys/4')).then(function() {
|
||||
commit('setAgency', agencydata.data)
|
||||
return true
|
||||
})
|
||||
return false
|
||||
},
|
||||
},
|
||||
})*/
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
(function($) {
|
||||
"use strict";
|
||||
console.log("HI!");
|
||||
}(jQuery));
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
<template>
|
||||
<Content app-name="AgencyData">
|
||||
<b-container v-if="isLoading"
|
||||
fluid>
|
||||
<h3>Agenturdaten</h3>
|
||||
<FormulateForm
|
||||
v-model="agency"
|
||||
@submit="submitHandler">
|
||||
<b-row>
|
||||
<b-col>
|
||||
<FormulateInput name="name"
|
||||
label="Agenturname"
|
||||
type="text" />
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row>
|
||||
<b-col>
|
||||
<FormulateInput name="inhaber"
|
||||
label="Agenturinhaber"
|
||||
type="text" />
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row>
|
||||
<b-col>
|
||||
<FormulateInput name="street"
|
||||
label="Straße"
|
||||
type="text" />
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row>
|
||||
<b-col>
|
||||
<FormulateInput name="city"
|
||||
label="Stadt"
|
||||
type="text" />
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row>
|
||||
<b-col>
|
||||
<FormulateInput name="plz"
|
||||
label="PLZ"
|
||||
type="text"
|
||||
:validation="[
|
||||
['required'],
|
||||
['max', 99999],
|
||||
['min', 10000]
|
||||
]" />
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row>
|
||||
<b-col>
|
||||
<FormulateInput name="agencymail"
|
||||
label="Agentur-Email-Adressedd"
|
||||
type="text" />
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row>
|
||||
<b-col>
|
||||
<FormulateInput name="phone"
|
||||
label="Telefonnummer"
|
||||
type="text" />
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row class="mt-2">
|
||||
<b-col>
|
||||
<b-button
|
||||
variant="secondary"
|
||||
type="submit">
|
||||
Aktualisieren
|
||||
</b-button>
|
||||
</b-col>
|
||||
</b-row>
|
||||
</FormulateForm>
|
||||
</b-container>
|
||||
<b-container v-if="!isLoading" class="d-flex justify-content-center">
|
||||
<b-spinner type="grow" />
|
||||
</b-container>
|
||||
</Content>
|
||||
</template>
|
||||
<script>
|
||||
import Content from '@nextcloud/vue/dist/Components/Content'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import '@braid/vue-formulate/themes/snow/snow.scss'
|
||||
// const axios = require('axios').default
|
||||
import axios from '@nextcloud/axios'
|
||||
|
||||
export default ({
|
||||
name: 'AgencyData',
|
||||
components: {
|
||||
Content,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
agency: null,
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadingAgencyData()
|
||||
},
|
||||
methods: {
|
||||
async loadingAgencyData() {
|
||||
const agencydata = await axios.get(generateUrl('/apps/agency/getagencydata'))
|
||||
this.agency = agencydata.data
|
||||
this.isLoading = true
|
||||
},
|
||||
async submitHandler(data) {
|
||||
const response = await axios.put(generateUrl('/apps/agency/updateagencydata'), data)
|
||||
console.log(response)
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
<template>
|
||||
<Content app-name="GroupManagement">
|
||||
<b-container
|
||||
v-if="isLoading"
|
||||
fluid>
|
||||
<h3>Gruppenverwaltung</h3>
|
||||
<div class="accordion" role="tablist">
|
||||
<Group v-for="(group, index) in groups"
|
||||
:key="index"
|
||||
no-body
|
||||
:index="index"
|
||||
:group="group"
|
||||
@updateGroupData="loadingGroupData()" />
|
||||
</div>
|
||||
<hr>
|
||||
<FormulateForm
|
||||
name="groupform"
|
||||
@submit="submitHandler">
|
||||
<b-row>
|
||||
<b-col>
|
||||
<FormulateInput name="groupname"
|
||||
placeholder="Gruppenname"
|
||||
type="text"
|
||||
validation="required|max:30" />
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row>
|
||||
<b-col>
|
||||
<b-button
|
||||
variant="secondary"
|
||||
type="submit">
|
||||
Neue Gruppe anlegen
|
||||
</b-button>
|
||||
</b-col>
|
||||
</b-row>
|
||||
</FormulateForm>
|
||||
</b-container>
|
||||
<b-container v-if="!isLoading" class="d-flex justify-content-center">
|
||||
<b-spinner type="grow" />
|
||||
</b-container>
|
||||
</Content>
|
||||
</template>
|
||||
<script>
|
||||
import Content from '@nextcloud/vue/dist/Components/Content'
|
||||
import Group from '../components/Group.vue'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import axios from '@nextcloud/axios'
|
||||
|
||||
export default ({
|
||||
name: 'GroupManagement',
|
||||
components: {
|
||||
Content,
|
||||
Group,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
groups: [],
|
||||
isLoading: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadingGroupData()
|
||||
},
|
||||
methods: {
|
||||
async loadingGroupData() {
|
||||
const groupResponse = await axios.get(generateUrl('/apps/agency/getagencygroups'))
|
||||
this.groups = groupResponse.data
|
||||
this.isLoading = true
|
||||
},
|
||||
async submitHandler(data) {
|
||||
const response = await axios.put(generateUrl('/apps/agency/addagencygroup'), data)
|
||||
if (response.data) {
|
||||
this.$formulate.reset('groupform')
|
||||
this.loadingGroupData()
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
<template>
|
||||
<Content app-name="Migrate">
|
||||
<b-container class="bv-example-row">
|
||||
<h3>Agenturmigration</h3>
|
||||
<FormulateForm
|
||||
@submit="submitHandler">
|
||||
<b-row>
|
||||
<b-col>
|
||||
<FormulateInput name="mainurl"
|
||||
label="Migrationsurl"
|
||||
value="http://host.docker.internal:8000/api/migrateagencyusers/"
|
||||
type="text" />
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row>
|
||||
<b-col>
|
||||
<FormulateInput name="agencyid"
|
||||
label="Agentur-ID"
|
||||
validation="required|number"
|
||||
type="text" />
|
||||
</b-col>
|
||||
</b-row>
|
||||
<b-row class="mt-2">
|
||||
<b-col>
|
||||
<b-button
|
||||
variant="secondary"
|
||||
type="submit">
|
||||
Migration starten
|
||||
</b-button>
|
||||
</b-col>
|
||||
</b-row>
|
||||
</FormulateForm>
|
||||
<p>{{ feedbackstring }}</p>
|
||||
</b-container>
|
||||
</Content>
|
||||
</template>
|
||||
<script>
|
||||
import Content from '@nextcloud/vue/dist/Components/Content'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import axios from '@nextcloud/axios'
|
||||
// import '@braid/vue-formulate/themes/snow/snow.scss'
|
||||
// import { generateUrl } from '@nextcloud/router'
|
||||
// const axios = require('axios').default
|
||||
|
||||
export default ({
|
||||
name: 'Migrate',
|
||||
components: {
|
||||
Content,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
feedbackstring: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async submitHandler(data) {
|
||||
this.feedbackstring = 'Migriere Agentur..'
|
||||
const response = await axios.put(generateUrl('/apps/agency/startmigration'), data)
|
||||
console.log(response)
|
||||
this.feedbackstring = response.data
|
||||
},
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
|
@ -1 +1,2 @@
|
|||
<div id="vue-content"></div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue