Skip to content

Commit b0d5159

Browse files
committed
fix: style on heartbeats page
1 parent 61b0463 commit b0d5159

2 files changed

Lines changed: 25 additions & 12 deletions

File tree

web/app/pages/heartbeats/[id].vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,15 @@ onMounted(async () => {
162162
</VBtn>
163163
<VToolbarTitle>
164164
Heartbeats
165-
<VIcon
166-
size="x-small"
167-
class="mx-2"
168-
color="primary"
169-
:icon="mdiCircle"
170-
/>
165+
<VIcon size="12" class="mx-2" color="primary" :icon="mdiCircle" />
171166
<span v-if="phonesStore.owner">{{
172167
formatPhoneNumber(phonesStore.owner)
173168
}}</span>
174169
</VToolbarTitle>
175170
</VAppBar>
176-
<VContainer class="mt-16">
171+
<VContainer>
177172
<VRow>
178-
<VCol cols="12">
173+
<VCol cols="12" class="mt-n8">
179174
<p>
180175
Every 15 minutes, the httpSMS app on your Android phone sends a
181176
heartbeat event to the httpsms API to show that it is alive. The
@@ -214,6 +209,7 @@ onMounted(async () => {
214209
/>
215210
<VDataTable
216211
v-else
212+
hover
217213
:headers="dataTableHeaders"
218214
:items="dataTableItems"
219215
:items-per-page="100"

web/app/pages/threads/[id]/index.vue

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const route = useRoute()
3232
const router = useRouter()
3333
const config = useRuntimeConfig()
3434
const { lgAndUp, mdAndDown } = useDisplay()
35+
const { formatPhoneNumber } = useFilters()
3536
const notificationsStore = useNotificationsStore()
3637
const authStore = useAuthStore()
3738
const phonesStore = usePhonesStore()
@@ -45,6 +46,14 @@ const hideMessages = ref(true)
4546
const messages = ref<Message[]>([])
4647
const selectedMenuItem = ref(-1)
4748
const messageBody = ref<HTMLElement | null>(null)
49+
const form = ref<{ validate: () => Promise<{ valid: boolean }> } | null>(null)
50+
51+
const formMessageRules = [
52+
(v: string) =>
53+
v === '' ||
54+
(v && v.length <= 320) ||
55+
'Message must be less than 320 characters',
56+
]
4857
4958
let webhookChannel: Channel | null = null
5059
@@ -152,6 +161,7 @@ async function resendMessage(message: Message) {
152161
from: message.owner,
153162
to: message.contact,
154163
content: message.content,
164+
sim: 'DEFAULT',
155165
})
156166
setTimeout(() => {
157167
selectedMenuItem.value = -1
@@ -187,11 +197,17 @@ async function sendMessage(event: KeyboardEvent | Event) {
187197
if (event instanceof KeyboardEvent && event.shiftKey) return
188198
if (!formMessage.value.trim()) return
189199
200+
if (form.value) {
201+
const { valid } = await form.value.validate()
202+
if (!valid) return
203+
}
204+
190205
submitting.value = true
191206
await messagesStore.sendMessage({
192207
from: phonesStore.owner,
193208
to: threadsStore.currentThread!.contact,
194209
content: formMessage.value,
210+
sim: 'DEFAULT',
195211
})
196212
loadMessages(false)
197213
formMessage.value = ''
@@ -230,7 +246,7 @@ onBeforeUnmount(() => {
230246
</VBtn>
231247
<VToolbarTitle>
232248
<span v-if="threadsStore.currentThread">
233-
{{ useFilters().phoneNumber(threadsStore.currentThread.contact) }}
249+
{{ formatPhoneNumber(threadsStore.currentThread.contact) }}
234250
</span>
235251
</VToolbarTitle>
236252
<VSpacer />
@@ -364,7 +380,7 @@ onBeforeUnmount(() => {
364380
target="_blank"
365381
rel="noopener noreferrer"
366382
:href="attachment"
367-
class="text-decoration-none text-body-medium mb-2 d-flex w-100"
383+
class="text-decoration-none hover:text-decoration-underline text-body-medium mb-2 d-flex w-100"
368384
>
369385
<VIcon
370386
size="x-small"
@@ -454,12 +470,13 @@ onBeforeUnmount(() => {
454470
</div>
455471
<VFooter app color="#121212">
456472
<VContainer class="pb-0">
457-
<form class="d-flex" @submit.prevent="sendMessage">
473+
<VForm ref="form" class="d-flex" @submit.prevent="sendMessage">
458474
<VTextField
459475
v-model="formMessage"
460476
:disabled="submitting || !contactIsPhoneNumber"
461477
variant="solo"
462478
class="no-scrollbar ml-2"
479+
:rules="formMessageRules"
463480
:placeholder="
464481
contactIsPhoneNumber
465482
? 'Type your message here'
@@ -485,7 +502,7 @@ onBeforeUnmount(() => {
485502
/>
486503
<VIcon :icon="mdiSend" />
487504
</VBtn>
488-
</form>
505+
</VForm>
489506
</VContainer>
490507
</VFooter>
491508
</VContainer>

0 commit comments

Comments
 (0)