Copilot loads

This commit is contained in:
Ben Arc 2021-10-12 23:26:01 +01:00
parent 1bd08d3a44
commit a0be1a5017
3 changed files with 15 additions and 17 deletions

View file

@ -35,7 +35,7 @@
<string>, "animation": <string>, <string>, "animation": <string>,
"show_message":<string>, "amount": <integer>, "show_message":<string>, "amount": <integer>,
"lnurl_title": <string>}' -H "Content-type: application/json" "lnurl_title": <string>}' -H "Content-type: application/json"
-H "X-Api-Key: {{g.user.wallets[0].adminkey }}" -H "X-Api-Key: {{user.wallets[0].adminkey }}"
</code> </code>
</q-card-section> </q-card-section>
</q-card> </q-card>
@ -63,7 +63,7 @@
"animation": &lt;string&gt;, "show_message":&lt;string&gt;, "animation": &lt;string&gt;, "show_message":&lt;string&gt;,
"amount": &lt;integer&gt;, "lnurl_title": &lt;string&gt;}' -H "amount": &lt;integer&gt;, "lnurl_title": &lt;string&gt;}' -H
"Content-type: application/json" -H "X-Api-Key: "Content-type: application/json" -H "X-Api-Key:
{{g.user.wallets[0].adminkey }}" {{user.wallets[0].adminkey }}"
</code> </code>
</q-card-section> </q-card-section>
</q-card> </q-card>
@ -88,7 +88,7 @@
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5> <h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5>
<code <code
>curl -X GET {{ request.url_root }}api/v1/copilot/&lt;copilot_id&gt; >curl -X GET {{ request.url_root }}api/v1/copilot/&lt;copilot_id&gt;
-H "X-Api-Key: {{ g.user.wallets[0].inkey }}" -H "X-Api-Key: {{ user.wallets[0].inkey }}"
</code> </code>
</q-card-section> </q-card-section>
</q-card> </q-card>
@ -111,7 +111,7 @@
<h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5> <h5 class="text-caption q-mt-sm q-mb-none">Curl example</h5>
<code <code
>curl -X GET {{ request.url_root }}api/v1/copilots -H "X-Api-Key: {{ >curl -X GET {{ request.url_root }}api/v1/copilots -H "X-Api-Key: {{
g.user.wallets[0].inkey }}" user.wallets[0].inkey }}"
</code> </code>
</q-card-section> </q-card-section>
</q-card> </q-card>
@ -137,7 +137,7 @@
<code <code
>curl -X DELETE {{ request.url_root >curl -X DELETE {{ request.url_root
}}api/v1/copilot/&lt;copilot_id&gt; -H "X-Api-Key: {{ }}api/v1/copilot/&lt;copilot_id&gt; -H "X-Api-Key: {{
g.user.wallets[0].adminkey }}" user.wallets[0].adminkey }}"
</code> </code>
</q-card-section> </q-card-section>
</q-card> </q-card>
@ -163,7 +163,7 @@
<code <code
>curl -X GET {{ request.url_root }}/api/v1/copilot/ws/&lt;string, >curl -X GET {{ request.url_root }}/api/v1/copilot/ws/&lt;string,
copilot_id&gt;/&lt;string, comment&gt;/&lt;string, gif name&gt; -H copilot_id&gt;/&lt;string, comment&gt;/&lt;string, gif name&gt; -H
"X-Api-Key: {{ g.user.wallets[0].adminkey }}" "X-Api-Key: {{ user.wallets[0].adminkey }}"
</code> </code>
</q-card-section> </q-card-section>
</q-card> </q-card>

View file

@ -1,5 +1,6 @@
{% extends "base.html" %} {% from "macros.jinja" import window_vars with context {% extends "base.html" %} {% from "macros.jinja" import window_vars with context
%} {% block page %} %} {% block page %}
<div class="row q-col-gutter-md"> <div class="row q-col-gutter-md">
<div class="col-12 col-md-7 q-gutter-y-md"> <div class="col-12 col-md-7 q-gutter-y-md">
<q-card> <q-card>
@ -384,8 +385,6 @@
</q-dialog> </q-dialog>
</div> </div>
{% endblock %} {% block scripts %} {{ window_vars(user) }} {% endblock %} {% block scripts %} {{ window_vars(user) }}
<script src="{{ url_for('static', filename='vendor/vue-qrcode@1.0.2/vue-qrcode.min.js') }}"></script>
<style></style>
<script> <script>
Vue.component(VueQrcode.name, VueQrcode) Vue.component(VueQrcode.name, VueQrcode)
@ -533,7 +532,7 @@
this.g.user.wallets[0].inkey this.g.user.wallets[0].inkey
) )
.then(function (response) { .then(function (response) {
if(response.data){ if (response.data) {
self.CopilotLinks = response.data.map(mapCopilot) self.CopilotLinks = response.data.map(mapCopilot)
} }
}) })
@ -634,14 +633,14 @@
LNbits.utils.notifyApiError(error) LNbits.utils.notifyApiError(error)
}) })
}, },
clearFormDialogCopilot(){ clearFormDialogCopilot() {
this.formDialogCopilot.data = { this.formDialogCopilot.data = {
lnurl_toggle: false, lnurl_toggle: false,
show_message: false, show_message: false,
show_ack: false, show_ack: false,
show_price: 'None', show_price: 'None',
title: '' title: ''
} }
}, },
exportcopilotCSV: function () { exportcopilotCSV: function () {
var self = this var self = this

View file

@ -19,7 +19,6 @@ from starlette.responses import HTMLResponse, JSONResponse # type: ignore
from lnbits.core.models import User from lnbits.core.models import User
import base64 import base64
templates = Jinja2Templates(directory="templates") templates = Jinja2Templates(directory="templates")