Skip to content

Commit d6cb96c

Browse files
committed
Fix message size
1 parent 8f8789b commit d6cb96c

9 files changed

Lines changed: 68 additions & 76 deletions

File tree

api/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import (
2020
// @host api.httpsms.com
2121
// @schemes https
2222
// @BasePath /v1
23+
//
24+
// @securitydefinitions.apikey ApiKeyAuth
25+
// @in header
26+
// @name X-API-Key
2327
func main() {
2428
if len(os.Args) == 1 {
2529
di.LoadEnv()

api/pkg/handlers/heartbeat_handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func (h *HeartbeatHandler) RegisterRoutes(router fiber.Router) {
4444
// Index returns the heartbeats of a phone number
4545
// @Summary Get heartbeats of an owner phone number
4646
// @Description Get the last time a phone number requested for outstanding messages. It will be sorted by timestamp in descending order.
47+
// @Security ApiKeyAuth
4748
// @Tags Heartbeats
4849
// @Accept json
4950
// @Produce json

api/pkg/handlers/message_handler.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ func (h *MessageHandler) RegisterRoutes(router fiber.Router) {
5252
// PostSend a new entities.Message
5353
// @Summary Send a new SMS message
5454
// @Description Add a new SMS message to be sent by the android phone
55+
// @Security ApiKeyAuth
5556
// @Tags Messages
5657
// @Accept json
5758
// @Produce json
@@ -61,6 +62,7 @@ func (h *MessageHandler) RegisterRoutes(router fiber.Router) {
6162
// @Failure 422 {object} responses.UnprocessableEntity
6263
// @Failure 500 {object} responses.InternalServerError
6364
// @Router /messages/send [post]
65+
// @Security ApiKeyAuth
6466
func (h *MessageHandler) PostSend(c *fiber.Ctx) error {
6567
ctx, span := h.tracer.StartFromFiberCtx(c)
6668
defer span.End()
@@ -93,6 +95,7 @@ func (h *MessageHandler) PostSend(c *fiber.Ctx) error {
9395
// GetOutstanding returns entities.Message which are still to be sent by the mobile phone
9496
// @Summary Get outstanding messages
9597
// @Description Get list of messages which are outstanding to be sent by the phone
98+
// @Security ApiKeyAuth
9699
// @Tags Messages
97100
// @Accept json
98101
// @Produce json
@@ -136,6 +139,7 @@ func (h *MessageHandler) GetOutstanding(c *fiber.Ctx) error {
136139
// Index returns messages sent between 2 phone numbers
137140
// @Summary Get messages which are sent between 2 phone numbers
138141
// @Description Get list of messages which are sent between 2 phone numbers. It will be sorted by timestamp in descending order.
142+
// @Security ApiKeyAuth
139143
// @Tags Messages
140144
// @Accept json
141145
// @Produce json
@@ -181,6 +185,7 @@ func (h *MessageHandler) Index(c *fiber.Ctx) error {
181185
// PostEvent registers an event on a message
182186
// @Summary Store an event for a message on the mobile phone
183187
// @Description Use this endpoint to send events for a message when it is failed, sent or delivered by the mobile phone.
188+
// @Security ApiKeyAuth
184189
// @Tags Messages
185190
// @Accept json
186191
// @Produce json
@@ -192,6 +197,7 @@ func (h *MessageHandler) Index(c *fiber.Ctx) error {
192197
// @Failure 422 {object} responses.UnprocessableEntity
193198
// @Failure 500 {object} responses.InternalServerError
194199
// @Router /messages/{messageID}/events [post]
200+
// @Security ApiKeyAuth
195201
func (h *MessageHandler) PostEvent(c *fiber.Ctx) error {
196202
ctx, span := h.tracer.StartFromFiberCtx(c)
197203
defer span.End()
@@ -236,6 +242,7 @@ func (h *MessageHandler) PostEvent(c *fiber.Ctx) error {
236242
// PostReceive receives a new entities.Message
237243
// @Summary Receive a new SMS message from a mobile phone
238244
// @Description Add a new message received from a mobile phone
245+
// @Security ApiKeyAuth
239246
// @Tags Messages
240247
// @Accept json
241248
// @Produce json

api/pkg/handlers/message_thread_handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func (h *MessageThreadHandler) RegisterRoutes(router fiber.Router) {
4444
// Index returns message threads for a phone number
4545
// @Summary Get message threads for a phone number
4646
// @Description Get list of contacts which a phone number has communicated with (threads). It will be sorted by timestamp in descending order.
47+
// @Security ApiKeyAuth
4748
// @Tags Message Threads
4849
// @Accept json
4950
// @Produce json

web/components/MessageThreadHeader.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@
2222
<p class="text--secondary mb-n1">
2323
{{ $store.getters.getOwner | phoneCountry }}
2424
</p>
25-
<v-tooltip v-if="$store.getters.getHeartbeat" right open-on-click>
25+
<v-tooltip
26+
v-if="$store.getters.getHeartbeat"
27+
right
28+
:open-on-focus="false"
29+
:open-on-hover="true"
30+
open-on-click
31+
>
2632
<template #activator="{ on, attrs }">
2733
<v-btn
2834
x-small
2935
v-bind="attrs"
3036
color="success"
3137
class="ml-2 mt-1 mb-n1"
3238
icon
33-
@click.prevent
3439
v-on="on"
3540
>
3641
<v-icon x-small>mdi-circle</v-icon>
@@ -50,7 +55,7 @@
5055
</template>
5156
<v-list class="px-2" nav :dense="$vuetify.breakpoint.mdAndDown">
5257
<v-list-item-group>
53-
<v-list-item :to="{ name: 'index' }">
58+
<v-list-item :to="{ name: 'index' }" exact>
5459
<v-list-item-icon class="pl-2">
5560
<v-icon dense>mdi-account-cog</v-icon>
5661
</v-list-item-icon>

web/nuxt.config.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,6 @@ export default {
7676
customVariables: ['~/assets/variables.scss'],
7777
theme: {
7878
dark: true,
79-
themes: {
80-
dark: {
81-
primary: colors.blue.darken2,
82-
accent: colors.grey.darken3,
83-
secondary: colors.amber.darken3,
84-
info: colors.teal.lighten1,
85-
warning: colors.amber.base,
86-
error: colors.deepOrange.accent4,
87-
success: colors.green.accent3,
88-
},
89-
},
9079
},
9180
},
9281

web/pages/index.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<span v-if="$vuetify.breakpoint.lgAndUp">&nbsp;For Free</span>
1212
</v-btn>
1313
</v-app-bar>
14-
<v-container>
14+
<v-container class="pb-16">
1515
<v-row :class="{ 'py-16': $vuetify.breakpoint.lgAndUp }">
1616
<v-col
1717
cols="12"
@@ -35,11 +35,12 @@
3535
class="mt-4 mb-4"
3636
:to="{ name: 'login' }"
3737
>
38-
<v-icon v-if="$vuetify.breakpoint.lgAndUp" large>mdi-send</v-icon>
38+
<v-icon v-if="$vuetify.breakpoint.lgAndUp">mdi-send</v-icon>
3939
Get Started
4040
</v-btn>
4141
<v-btn
4242
large
43+
color="default"
4344
target="_blank"
4445
class="mt-4 mb-4 ml-4"
4546
:href="$store.getters.getAppData.githubUrl"
@@ -76,7 +77,7 @@
7677
</v-col>
7778
</v-row>
7879
</v-container>
79-
<v-footer fixed>
80+
<v-footer absolute>
8081
<v-container class="text-center">
8182
<v-row justify="center" no-gutters>
8283
<v-col cols="12">
@@ -109,8 +110,8 @@
109110

110111
<script lang="ts">
111112
import Vue from 'vue'
112-
import { Component } from 'vue-property-decorator'
113113
114-
@Component
115-
export default class Index extends Vue {}
114+
export default Vue.extend({
115+
middleware: ['guest'],
116+
})
116117
</script>

web/pages/threads/_id.vue

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -83,42 +83,46 @@
8383
</v-col>
8484
</v-row>
8585
</div>
86-
<v-form
87-
ref="form"
88-
class="fixed-bottom d-flex"
89-
lazy-validation
90-
@submit.prevent="sendMessage"
91-
>
92-
<v-textarea
93-
ref="messageInput"
94-
v-model="formMessage"
95-
:disabled="submitting"
96-
:rows="2"
97-
filled
98-
class="no-scrollbar"
99-
:rules="formMessageRules"
100-
placeholder="Type your message here"
101-
rounded
102-
@keydown.enter="sendMessage"
103-
></v-textarea>
104-
<v-btn
105-
:disabled="submitting"
106-
type="submit"
107-
color="primary"
108-
class="pa-5 white--text ml-2 mt-1"
109-
fab
110-
>
111-
<v-progress-circular
112-
v-if="submitting"
113-
indeterminate
114-
style="position: absolute"
115-
:size="20"
116-
:width="3"
117-
color="pink"
118-
></v-progress-circular>
119-
<v-icon>mdi-send</v-icon>
120-
</v-btn>
121-
</v-form>
86+
<v-footer absolute padless color="#121212">
87+
<v-container class="pb-0">
88+
<v-form
89+
ref="form"
90+
class="d-flex"
91+
lazy-validation
92+
@submit.prevent="sendMessage"
93+
>
94+
<v-textarea
95+
ref="messageInput"
96+
v-model="formMessage"
97+
:disabled="submitting"
98+
:rows="2"
99+
filled
100+
class="no-scrollbar"
101+
:rules="formMessageRules"
102+
placeholder="Type your message here"
103+
rounded
104+
@keydown.enter="sendMessage"
105+
></v-textarea>
106+
<v-btn
107+
:disabled="submitting"
108+
type="submit"
109+
color="primary"
110+
class="pa-5 white--text ml-2 mt-1"
111+
fab
112+
>
113+
<v-progress-circular
114+
v-if="submitting"
115+
indeterminate
116+
style="position: absolute"
117+
:size="20"
118+
:width="3"
119+
color="pink"
120+
></v-progress-circular>
121+
<v-icon>mdi-send</v-icon>
122+
</v-btn>
123+
</v-form>
124+
</v-container>
125+
</v-footer>
122126
</v-container>
123127
</div>
124128
</v-container>
@@ -204,13 +208,6 @@ export default Vue.extend({
204208
</script>
205209

206210
<style lang="scss">
207-
.fixed-bottom {
208-
width: 96%;
209-
max-width: 1761px;
210-
position: fixed;
211-
bottom: 0;
212-
}
213-
214211
.messages-body {
215212
padding-top: 50px;
216213
width: 96%;

web/plugins/vuetify.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)