Browse Source

feat: update ui dashboard (#17)

* feat: update ui dashboard

* chore: update docs
pull/21/head
Aldino Kemal 4 years ago
committed by GitHub
parent
commit
aeeae60b76
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      readme.md
  2. 2
      src/config/settings.go
  3. 76
      src/views/index.html

17
readme.md

@ -91,16 +91,17 @@ You can check [docs/openapi.yml](./docs/openapi.yaml) for detail API
### App User Interface ### App User Interface
1. Homepage ![Homepage](https://i.ibb.co/xg6r0BV/Screen-Shot-2022-04-23-at-19-55-56.png)
1. Homepage ![Homepage](https://i.ibb.co/nCK9w1W/Screen-Shot-2022-05-22-at-13-39-28.png)
2. Login ![Login](https://i.ibb.co/Yp3YJKM/Screen-Shot-2022-02-13-at-12-55-54.png) 2. Login ![Login](https://i.ibb.co/Yp3YJKM/Screen-Shot-2022-02-13-at-12-55-54.png)
3. Send Message ![Send Message](https://i.ibb.co/YcSfvmP/Screen-Shot-2022-02-13-at-12-58-58.png)
3. Send Message ![Send Message](https://i.ibb.co/VMRjX3K/Screen-Shot-2022-05-22-at-13-41-55.png)
4. Send Image ![Send Image](https://i.ibb.co/HDVJZSN/Screen-Shot-2022-02-13-at-12-59-06.png) 4. Send Image ![Send Image](https://i.ibb.co/HDVJZSN/Screen-Shot-2022-02-13-at-12-59-06.png)
5. Send File ![Send File](https://i.ibb.co/XxNnsQ8/Screen-Shot-2022-02-13-at-12-59-14.png)
6. User Info ![User Info](https://i.ibb.co/BC0mNT7/Screen-Shot-2022-02-13-at-13-00-57.png)
7. User Avatar ![User Avatar](https://i.ibb.co/TkzPbLZ/Screen-Shot-2022-02-13-at-13-01-39.png)
8. User Privacy ![User My Privacy](https://i.ibb.co/RQcC5m9/Screen-Shot-2022-02-13-at-12-58-47.png)
9. User Group ![List Group](https://i.ibb.co/jfkgKdG/Screen-Shot-2022-05-12-at-21-12-06.png)
10. Auto Reply ![Auto Reply](https://i.ibb.co/D4rTytX/IMG-20220517-162500.jpg)
5. Send File ![Send File](https://i.ibb.co/nCwhysd/Screen-Shot-2022-05-22-at-13-43-16.png)
6. Send Video ![Send File](https://i.ibb.co/yBXsWXX/Screen-Shot-2022-05-22-at-13-43-24.png)
7. User Info ![User Info](https://i.ibb.co/BC0mNT7/Screen-Shot-2022-02-13-at-13-00-57.png)
8. User Avatar ![User Avatar](https://i.ibb.co/TkzPbLZ/Screen-Shot-2022-02-13-at-13-01-39.png)
9. User Privacy ![User My Privacy](https://i.ibb.co/RQcC5m9/Screen-Shot-2022-02-13-at-12-58-47.png)
10. User Group ![List Group](https://i.ibb.co/jfkgKdG/Screen-Shot-2022-05-12-at-21-12-06.png)
11. Auto Reply ![Auto Reply](https://i.ibb.co/D4rTytX/IMG-20220517-162500.jpg)
### Mac OS NOTE ### Mac OS NOTE

2
src/config/settings.go

@ -3,7 +3,7 @@ package config
type Browser string type Browser string
var ( var (
AppVersion string = "3.3.0"
AppVersion string = "3.3.1"
AppPort string = "3000" AppPort string = "3000"
AppDebug bool = false AppDebug bool = false

76
src/views/index.html

@ -94,7 +94,7 @@
<div class="green card" @click="sendMessageModal('user')" style="cursor: pointer"> <div class="green card" @click="sendMessageModal('user')" style="cursor: pointer">
<div class="content"> <div class="content">
<a class="ui blue right ribbon label">Private</a> <a class="ui blue right ribbon label">Private</a>
<div class="header">Send Message </div>
<div class="header">Send Message</div>
<div class="description"> <div class="description">
Send any message to any whatsapp number Send any message to any whatsapp number
</div> </div>
@ -126,7 +126,9 @@
<a class="ui blue right ribbon label">Private</a> <a class="ui blue right ribbon label">Private</a>
<div class="header">Send Video</div> <div class="header">Send Video</div>
<div class="description"> <div class="description">
Send video <div class="ui blue horizontal label">mp4</div> up to
Send video
<div class="ui blue horizontal label">mp4</div>
up to
<div class="ui blue horizontal label">{{ .MaxVideoSize }}</div> <div class="ui blue horizontal label">{{ .MaxVideoSize }}</div>
</div> </div>
</div> </div>
@ -169,7 +171,9 @@
<a class="ui teal right ribbon label">Group</a> <a class="ui teal right ribbon label">Group</a>
<div class="header">Send Video</div> <div class="header">Send Video</div>
<div class="description"> <div class="description">
Send video <div class="ui teal horizontal label">mp4</div> up to
Send video
<div class="ui teal horizontal label">mp4</div>
up to
<div class="ui teal horizontal label">{{ .MaxVideoSize }}</div> <div class="ui teal horizontal label">{{ .MaxVideoSize }}</div>
</div> </div>
</div> </div>
@ -241,6 +245,25 @@
<input v-model="image_phone" type="text" placeholder="6289..." <input v-model="image_phone" type="text" placeholder="6289..."
aria-label="phone"> aria-label="phone">
</div> </div>
<div class="field">
<label>Caption</label>
<input v-model="image_caption" type="text" placeholder="Hello this is image caption"
aria-label="caption">
</div>
<div class="field">
<label>View Once</label>
<div class="ui toggle checkbox">
<input type="checkbox" aria-label="view once" v-model="image_view_once">
<label>Check for enable one time view</label>
</div>
</div>
<div class="field">
<label>Compress</label>
<div class="ui toggle checkbox">
<input type="checkbox" aria-label="view once" v-model="image_compress">
<label>Check for compressing image to smaller size</label>
</div>
</div>
<div class="field" style="padding-bottom: 30px"> <div class="field" style="padding-bottom: 30px">
<label>Image</label> <label>Image</label>
<input type="file" class="inputfile" id="image_file" style="display: none" <input type="file" class="inputfile" id="image_file" style="display: none"
@ -250,11 +273,6 @@
Upload image Upload image
</label> </label>
</div> </div>
<div class="field">
<label>Caption</label>
<input v-model="image_caption" type="text" placeholder="Hello this is image caption"
aria-label="caption">
</div>
</form> </form>
</div> </div>
<div class="actions"> <div class="actions">
@ -278,6 +296,11 @@
<input v-model="file_phone" type="text" placeholder="6289..." <input v-model="file_phone" type="text" placeholder="6289..."
aria-label="phone"> aria-label="phone">
</div> </div>
<div class="field">
<label>Caption</label>
<input v-model="file_caption" type="text" placeholder="Type some caption (optional)..."
aria-label="caption">
</div>
<div class="field" style="padding-bottom: 30px"> <div class="field" style="padding-bottom: 30px">
<label>File</label> <label>File</label>
<input type="file" class="inputfile" id="file_file" style="display: none"/> <input type="file" class="inputfile" id="file_file" style="display: none"/>
@ -309,6 +332,25 @@
<input v-model="video_phone" type="text" placeholder="6289..." <input v-model="video_phone" type="text" placeholder="6289..."
aria-label="phone"> aria-label="phone">
</div> </div>
<div class="field">
<label>Caption</label>
<input v-model="video_caption" type="text" placeholder="Type some caption (optional)..."
aria-label="caption">
</div>
<div class="field">
<label>View Once</label>
<div class="ui toggle checkbox">
<input type="checkbox" aria-label="view once" v-model="video_view_once">
<label>Check for enable one time view</label>
</div>
</div>
<div class="field">
<label>Compress</label>
<div class="ui toggle checkbox">
<input type="checkbox" aria-label="view once" v-model="video_compress">
<label>Check for compressing image to smaller size</label>
</div>
</div>
<div class="field" style="padding-bottom: 30px"> <div class="field" style="padding-bottom: 30px">
<label>Video</label> <label>Video</label>
<input type="file" class="inputfile" id="video_file" style="display: none" accept="video/*"/> <input type="file" class="inputfile" id="video_file" style="display: none" accept="video/*"/>
@ -605,6 +647,8 @@
data() { data() {
return { return {
image_phone: '', image_phone: '',
image_view_once: false,
image_compress: false,
image_caption: '', image_caption: '',
image_type: 'user', image_type: 'user',
} }
@ -627,6 +671,8 @@
try { try {
let payload = new FormData(); let payload = new FormData();
payload.append("phone", this.image_phone) payload.append("phone", this.image_phone)
payload.append("view_once", this.image_view_once)
payload.append("compress", this.image_compress)
payload.append("caption", this.image_caption) payload.append("caption", this.image_caption)
payload.append("image", $("#image_file")[0].files[0]) payload.append("image", $("#image_file")[0].files[0])
payload.append("type", this.image_type) payload.append("type", this.image_type)
@ -649,6 +695,8 @@
}) })
}, },
sendImageReset() { sendImageReset() {
this.image_view_once = false;
this.image_compress = false;
this.image_phone = ''; this.image_phone = '';
this.image_caption = ''; this.image_caption = '';
this.image_type = 'user'; this.image_type = 'user';
@ -660,6 +708,7 @@
const sendFile = { const sendFile = {
data() { data() {
return { return {
file_caption: '',
file_type: 'user', file_type: 'user',
file_phone: '', file_phone: '',
} }
@ -681,6 +730,7 @@
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
try { try {
let payload = new FormData(); let payload = new FormData();
payload.append("caption", this.file_caption)
payload.append("phone", this.file_phone) payload.append("phone", this.file_phone)
payload.append("file", $("#file_file")[0].files[0]) payload.append("file", $("#file_file")[0].files[0])
payload.append("type", this.file_type) payload.append("type", this.file_type)
@ -703,6 +753,7 @@
}) })
}, },
sendFileReset() { sendFileReset() {
this.file_caption = '';
this.file_phone = ''; this.file_phone = '';
this.file_type = 'user'; this.file_type = 'user';
$("#file_file").val(''); $("#file_file").val('');
@ -713,6 +764,9 @@
const sendVideo = { const sendVideo = {
data() { data() {
return { return {
video_caption: '',
video_view_once: false,
video_compress: false,
video_type: 'user', video_type: 'user',
video_phone: '', video_phone: '',
} }
@ -735,6 +789,9 @@
try { try {
let payload = new FormData(); let payload = new FormData();
payload.append("phone", this.video_phone) payload.append("phone", this.video_phone)
payload.append("caption", this.video_caption)
payload.append("view_once", this.video_view_once)
payload.append("compress", this.video_compress)
payload.append("video", $("#video_file")[0].files[0]) payload.append("video", $("#video_file")[0].files[0])
payload.append("type", this.video_type) payload.append("type", this.video_type)
let response = await axios.post(`${this.app_host}/send/video`, payload, { let response = await axios.post(`${this.app_host}/send/video`, payload, {
@ -756,6 +813,9 @@
}) })
}, },
sendVideoReset() { sendVideoReset() {
this.video_caption = '';
this.video_view_once = false;
this.video_compress = false;
this.video_phone = ''; this.video_phone = '';
this.video_type = 'user'; this.video_type = 'user';
$("#video_file").val(''); $("#video_file").val('');

Loading…
Cancel
Save