No known key found for this signature in database
GPG Key ID: 66C92B1C5B475512
29 changed files with 523 additions and 222 deletions
-
4.github/workflows/release-linux.yml
-
2.github/workflows/release-mac.yml
-
2.github/workflows/release-windows.yml
-
2docker-compose.yml
-
8docker/golang.Dockerfile
-
47docs/openapi.yaml
-
5readme.md
-
22src/cmd/root.go
-
2src/config/settings.go
-
12src/domains/user/account.go
-
1src/domains/user/user.go
-
8src/go.mod
-
8src/go.sum
-
5src/internal/rest/message.go
-
13src/internal/rest/user.go
-
100src/internal/websocket/websocket.go
-
26src/pkg/utils/general.go
-
3src/pkg/utils/general_test.go
-
179src/pkg/whatsapp/init.go
-
12src/pkg/whatsapp/utils.go
-
2src/pkg/whatsapp/webhook.go
-
7src/services/send.go
-
18src/services/user.go
-
2src/views/components/AccountAvatar.js
-
2src/views/components/AccountChangeAvatar.js
-
79src/views/components/AccountContact.js
-
2src/views/components/AccountPrivacy.js
-
2src/views/components/AccountUserInfo.js
-
4src/views/index.html
@ -1,21 +1,21 @@ |
|||
############################ |
|||
# STEP 1 build executable binary |
|||
############################ |
|||
FROM golang:1.23-alpine3.20 AS builder |
|||
FROM golang:1.24-alpine3.20 AS builder |
|||
RUN apk update && apk add --no-cache gcc musl-dev gcompat |
|||
WORKDIR /whatsapp |
|||
COPY ./src . |
|||
|
|||
# Fetch dependencies. |
|||
RUN go mod download |
|||
# Build the binary. |
|||
RUN go build -o /app/whatsapp |
|||
# Build the binary with optimizations |
|||
RUN go build -a -ldflags="-w -s" -o /app/whatsapp |
|||
|
|||
############################# |
|||
## STEP 2 build a smaller image |
|||
############################# |
|||
FROM alpine:3.20 |
|||
RUN apk update && apk add --no-cache ffmpeg |
|||
RUN apk add --no-cache ffmpeg |
|||
WORKDIR /app |
|||
# Copy compiled from builder. |
|||
COPY --from=builder /app/whatsapp /app/whatsapp |
|||
|
|||
@ -0,0 +1,79 @@ |
|||
export default { |
|||
name: 'AccountContact', |
|||
data() { |
|||
return { |
|||
contacts: [] |
|||
} |
|||
}, |
|||
methods: { |
|||
async openModal() { |
|||
try { |
|||
this.dtClear() |
|||
await this.submitApi(); |
|||
$('#modalContactList').modal('show'); |
|||
this.dtRebuild() |
|||
showSuccessInfo("Contacts fetched") |
|||
} catch (err) { |
|||
showErrorInfo(err) |
|||
} |
|||
}, |
|||
dtClear() { |
|||
$('#account_contacts_table').DataTable().destroy(); |
|||
}, |
|||
dtRebuild() { |
|||
$('#account_contacts_table').DataTable({ |
|||
"pageLength": 10, |
|||
"reloadData": true, |
|||
}).draw(); |
|||
}, |
|||
async submitApi() { |
|||
try { |
|||
let response = await window.http.get(`/user/my/contacts`) |
|||
this.contacts = response.data.results.data; |
|||
} catch (error) { |
|||
if (error.response) { |
|||
throw new Error(error.response.data.message); |
|||
} |
|||
throw new Error(error.message); |
|||
} |
|||
}, |
|||
getPhoneNumber(jid) { |
|||
return jid.split('@')[0]; |
|||
} |
|||
}, |
|||
template: `
|
|||
<div class="olive card" @click="openModal" style="cursor: pointer"> |
|||
<div class="content"> |
|||
<a class="ui olive right ribbon label">Contacts</a> |
|||
<div class="header">My Contacts</div> |
|||
<div class="description"> |
|||
Display all your contacts |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- Modal Contact List --> |
|||
<div class="ui large modal" id="modalContactList"> |
|||
<i class="close icon"></i> |
|||
<div class="header"> |
|||
My Contacts |
|||
</div> |
|||
<div class="content"> |
|||
<table class="ui celled table" id="account_contacts_table"> |
|||
<thead> |
|||
<tr> |
|||
<th>Phone Number</th> |
|||
<th>Name</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody v-if="contacts != null"> |
|||
<tr v-for="contact in contacts"> |
|||
<td>{{ getPhoneNumber(contact.jid) }}</td> |
|||
<td>{{ contact.name }}</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
`
|
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue