Browse Source
feat: Update app version to v5.3.0 and upgrade Go version to 1.24
feat: Update app version to v5.3.0 and upgrade Go version to 1.24
feat: add MyListContacts endpointpull/271/head
20 changed files with 191 additions and 50 deletions
-
4.github/workflows/release-linux.yml
-
2.github/workflows/release-mac.yml
-
2.github/workflows/release-windows.yml
-
2docker/golang.Dockerfile
-
47docs/openapi.yaml
-
1readme.md
-
2src/config/settings.go
-
12src/domains/user/account.go
-
1src/domains/user/user.go
-
9src/go.mod
-
32src/go.sum
-
5src/internal/rest/message.go
-
13src/internal/rest/user.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
@ -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