Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2020-05-19 12:51:13 +0300
committerMuhammet Kara <muhammet.kara@collabora.com>2020-05-22 00:16:10 +0300
commitbe8178c967e8ee0a4d2b5d08d068e59532deb121 (patch)
tree4088ef4c2afa395433868f5922104409caac1dee /src
parent4a1f23a5b798e5bfb5b41870ea07d17d856051e9 (diff)
Admin Settings: Add option to enable built-in CODE server
Signed-off-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'src')
-rw-r--r--src/components/AdminSettings.vue21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/components/AdminSettings.vue b/src/components/AdminSettings.vue
index 872a2d31..9aa3f207 100644
--- a/src/components/AdminSettings.vue
+++ b/src/components/AdminSettings.vue
@@ -69,6 +69,18 @@
</div>
</div>
<div>
+ <input id="builtinserver" v-model="serverMode" type="radio"
+ name="serverMode" value="builtin" class="radio"
+ :disabled="updating || !CODEInstalled" @click="setBuiltinServer">
+ <label for="builtinserver">{{ t('richdocuments', 'Use the built-in testing server') }}</label><br>
+ <p v-if="CODEInstalled" class="option-inline">
+ <em>{{ t('richdocuments', 'This installation has a built-in Collabora Online with limited capabilities for testing') }}</em>
+ </p>
+ <p v-else class="option-inline">
+ <em>{{ t('richdocuments', 'This installation does not have a built-in Collabora Online test server') }}</em>
+ </p>
+ </div>
+ <div>
<input id="demoserver" v-model="serverMode" type="radio"
name="serverMode" value="demo" class="radio"
:disabled="updating || hasHostErrors" @input="fetchDemoServers">
@@ -252,6 +264,7 @@ export default {
serverError: Object.values(OC.getCapabilities()['richdocuments'].collabora).length > 0 ? SERVER_STATE_OK : SERVER_STATE_CONNECTION_ERROR,
hostErrors: [window.location.host === 'localhost' || window.location.host === '127.0.0.1', window.location.protocol !== 'https:', false],
demoServers: null,
+ CODEInstalled: 'richdocumentscode' in OC.appswebroots,
approvedDemoModal: false,
updating: false,
groups: [],
@@ -416,12 +429,15 @@ export default {
},
checkIfDemoServerIsActive() {
this.settings.demoUrl = this.demoServers ? this.demoServers.find((server) => server.demo_url === this.settings.wopi_url) : null
+ this.settings.CODEUrl = this.CODEInstalled ? window.location.protocol + '//' + window.location.host + OC.generateUrl('/apps/richdocumentscode/proxy.php?req=') : null
if (this.settings.wopi_url && this.settings.wopi_url !== '') {
this.serverMode = 'custom'
}
if (this.settings.demoUrl) {
this.serverMode = 'demo'
this.approvedDemoModal = true
+ } else if (this.settings.CODEUrl && this.settings.CODEUrl === this.settings.wopi_url) {
+ this.serverMode = 'builtin'
}
},
demoServerLabel(server) {
@@ -431,6 +447,11 @@ export default {
this.settings.wopi_url = server.demo_url
this.settings.disable_certificate_verification = false
await this.updateServer()
+ },
+ async setBuiltinServer() {
+ this.settings.wopi_url = this.settings.CODEUrl
+ this.settings.disable_certificate_verification = false
+ await this.updateServer()
}
}
}