33d7c9c46a
README, NODES.md, install scripts, palette help text, and example flows — node .js logic unchanged.
65 lines
2.7 KiB
HTML
65 lines
2.7 KiB
HTML
<script type="text/javascript">
|
|
RED.nodes.registerType('collabora-wopi', {
|
|
category: 'nextcloud collabora',
|
|
color: '#7950a2',
|
|
defaults: {
|
|
name: { value: '' },
|
|
config: { type: 'nc-collab-config', required: true },
|
|
operation: { value: 'capabilities' }
|
|
},
|
|
inputs: 1,
|
|
outputs: 1,
|
|
icon: 'font-awesome/fa-search',
|
|
label: function () {
|
|
return this.name || `wopi ${this.operation}`;
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<script type="text/html" data-template-name="collabora-wopi">
|
|
<div class="form-row">
|
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
<input type="text" id="node-input-name">
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-config"><i class="fa fa-cog"></i> Config</label>
|
|
<input type="text" id="node-input-config">
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-operation"><i class="fa fa-wrench"></i> Operation</label>
|
|
<select id="node-input-operation">
|
|
<option value="capabilities">capabilities</option>
|
|
<option value="discovery">discovery</option>
|
|
<option value="buildEditor">buildEditor</option>
|
|
<option value="checkFileInfo">checkFileInfo (debug)</option>
|
|
<option value="getFile">getFile (debug)</option>
|
|
</select>
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/html" data-help-name="collabora-wopi">
|
|
<p>Not file conversion — health checks and WOPI helpers against CODE.</p>
|
|
|
|
<table style="width:100%; font-size:12px;">
|
|
<tr><th>Operation</th><th>You get</th></tr>
|
|
<tr><td><code>capabilities</code></td><td>JSON: what CODE supports (convert-to, etc.)</td></tr>
|
|
<tr><td><code>discovery</code></td><td>XML: mime → editor URL</td></tr>
|
|
<tr><td><code>buildEditor</code></td><td><code>msg.editorUrl</code> from <code>msg.wopiSrc</code> + <code>msg.token</code></td></tr>
|
|
<tr><td><code>checkFileInfo</code></td><td>JSON about the file (WOPI host, usually Nextcloud)</td></tr>
|
|
<tr><td><code>getFile</code></td><td>file bytes via WOPI GET</td></tr>
|
|
</table>
|
|
|
|
<p><code>buildEditor</code> builds roughly:<br>
|
|
<code>{collaboraPublicUrl}/browser/dist/cool.html?WOPISrc=...&access_token=...</code><br>
|
|
Public URL = Nextcloud/proxy, not internal CODE IP.</p>
|
|
|
|
<h4>When to use</h4>
|
|
<ul>
|
|
<li>First test that CODE is up → <code>capabilities</code></li>
|
|
<li>WOPI token from <code>nc-office document:direct</code> → build iframe URL</li>
|
|
<li>Debugging. Save files via WebDAV, not WOPI PutFile.</li>
|
|
</ul>
|
|
|
|
<pre>inject → collabora-wopi (capabilities) → debug</pre>
|
|
</script>
|