diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-11-19 21:54:26 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-11-19 21:54:26 +0100 |
commit | ab1c26f69c9bc8c65ac2cc4590956fb732cb2b8b (patch) | |
tree | f271cf5b70d9bd8f243b9f95dc717efa1e0c82f3 /src/App.vue | |
parent | 86e90ffef8f7ae85e3115c9a0fba887b636b8138 (diff) |
Implement social app setup
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/App.vue')
-rw-r--r-- | src/App.vue | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/src/App.vue b/src/App.vue index b3351435..15457f61 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@ <template> - <div class="app-social"> + <div class="app-social" v-if="!serverData.setup"> <div v-if="!serverData.public" id="app-navigation"> <app-navigation :menu="menu" /> </div> @@ -7,12 +7,36 @@ <router-view :key="$route.fullPath" /> </div> </div> + <div v-else class="setup"> + <template v-if="serverData.isAdmin"> + <h2>{{ t('social', 'Social app setup') }}</h2> + <p>{{ t('social', 'ActivityPub requires a fixed URL to make entries unique. Please configure a URL base. Note that this cannot be changed later without resetting the social app data.') }}</p> + <form @submit.prevent="setCloudAddress"> + <p> + <label class="hidden">{{ t('social', 'ActivityPub URL base') }}</label> + <input type="url" :placeholder="serverData.cliUrl" v-model="cloudAddress" required /> + <input type="submit" :value="t('social', 'Finish setup')" class="primary" /> + </p> + </form> + </template> + <template v-else> + <p>{{ t('social', 'The social app requires to be setup by the server administrator.') }}</p> + </template> + </div> </template> <style scoped> .app-social { width: 100%; } + .setup { + margin: auto; + width: 700px; + } + + .setup input[type=url] { + width: 300px; + } </style> <script> @@ -22,6 +46,7 @@ import { Multiselect, Avatar } from 'nextcloud-vue' +import axios from 'nextcloud-axios' import TimelineEntry from './components/TimelineEntry' import ProfileInfo from './components/ProfileInfo' @@ -38,7 +63,8 @@ export default { data: function() { return { infoHidden: false, - state: [] + state: [], + cloudAddress: '', } }, computed: { @@ -119,7 +145,13 @@ export default { methods: { hideInfo() { this.infoHidden = true + }, + setCloudAddress() { + axios.post(OC.generateUrl('apps/social/api/v1/config/cloudAddress'), {cloudAddress: this.cloudAddress}).then((response) => { + this.$store.commit('setServerDataEntry', 'setup', false); + this.$store.commit('setServerDataEntry', 'cloudAddress', this.cloudAddress); + }); } } } -</script> +</script>
\ No newline at end of file |