-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
235 lines (217 loc) · 7.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FZ8R0PWKBR"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-FZ8R0PWKBR');
</script>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Webex Archives</title>
<link rel="stylesheet" href="./style.css"></link>
<script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.min.js" defer></script>
<script src="https://unpkg.com/tippy.js@6/dist/tippy-bundle.umd.js" defer></script>
<script src="./webex.js" defer></script>
<script src="./logger.js" defer></script>
<script src="./downloader.js" defer></script>
<script src="./main.js" defer></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
</head>
<body
x-cloak
x-data="model"
>
<main>
<h1>Webex Archives</h1>
<h3>Download local archives of your Webex rooms</h3>
<section x-show="!compatible">
<h2>Your browser is not compatible</h2>
<div>
Webex Archives needs to save files (attachments, people avatars, messages etc) to your local drive. Your browser currently does not support the <a href="https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API">File System Access APIs</a>.
</div>
<div>
Please open this web page with a <a href="https://caniuse.com/?search=showDirectoryPicker">compatible laptop browser</a> - typically Chrome, Edge or Opera.
</div>
</section>
<section x-show="compatible">
<div class="row">
<div class="box">
<h2>Webex User</h2>
<div x-show="!user">
<textarea
rows="4"
placeholder="Paste token here"
x-model="token"
@paste="checkToken()"
></textarea>
</div>
<div x-show="!user">
<a href="https://developer.webex.com/docs/getting-started" target="_blank">Find your token here</a>
</div>
<div x-show="user" class="selected-value">
<img class="avatar" :src="user?.avatar"/>
<div x-text="user?.displayName"></div>
</div>
<div class="spacer"></div>
<div>
<button
@click="checkToken()"
:disabled="busy"
x-show="!user"
>Set</button>
<button
x-show="user"
@click="user = null; currentRoom = null;"
>Change</button>
</div>
</div>
<div class="box">
<h2>Webex Room</h2>
<div x-show="!currentRoom">
<textarea
rows="4"
placeholder="Select the room in your Webex app and choose *Help > Copy Space Details* and paste here."
x-model="roomId"
@paste.prevent="pasteRoom($event.clipboardData.getData('text'))"
data-tippy-content="In the Webex client, find the space you want and use Help > Copy Space Details, then paste here."
></textarea>
</div>
<div x-show="user && !currentRoom">
Or: <a href="" @click.prevent="showRoomList = true;findRooms();">Show room list</a>
</div>
<div x-show="currentRoom" class="selected-value">
<div x-text="'💬 ' + currentRoom?.title"></div>
</div>
<div class="spacer"></div>
<div>
<button
:disabled="busy || !user || roomId.trim().length !== 76"
@click="checkRoom()"
x-show="!currentRoom"
>Set</button>
<button
x-show="currentRoom"
@click="currentRoom = null"
>Change</button>
</div>
</div>
<div class="box">
<h2>Local folder</h2>
<div x-show="!folder">Select where you want to store the space history on your local disk.</div>
<div x-show="folder" class="selected-value">
<div x-text="'🗂️ ' + folder?.name"></div>
</div>
<div class="spacer"></div>
<div>
<button @click="selectFolder()" x-text="folder ? 'Change' : 'Select'"></button>
</div>
</div>
</div>
<div class="row" x-show="readyToDownload">
<div class="box">
<h2>Message settings</h2>
<div>
<label>Max messages</label>
<input type="number" x-model="settings.maxMessages" />
</div>
<div>
<label>Before date</label>
<input type="date" x-model="settings.beforeDate" />
</div>
</div>
<div class="box">
<h2>File settings</h2>
<div>
<label for="downloadfiles">Download files</label>
<input id="downloadfiles" type="checkbox" x-model="settings.downloadFiles" />
</div>
<div>
<label for="filesize">Max file size</label>
<select x-model.number="settings.maxFileSize" :disabled="!settings.downloadFiles" id="filesize">
<template x-for="size in filesizes">
<option :value="size.bytes" x-text="size.name" :selected="settings.maxFileSize == size.bytes"></option>
</template>
</select>
</div>
<div>
<label for="filetype">File type</label>
<select x-model="settings.fileType" :disabled="!settings.downloadFiles">
<option value="all">All</option>
<option value="image">Images</option>
</select>
</div>
</div>
<div class="box">
<h2>People settings</h2>
<div>
<label for="downloadpeople">Download people</label>
<input id="downloadpeople" type="checkbox" x-model="settings.downloadPeople" />
</div>
</div>
</div>
<div class="row">
<button
class="primary"
@click="startDownload()"
:disabled="!readyToDownload"
>Start Download</button>
</div>
</section>
<div class="fade" x-show="showRoomList">
<div class="dialog">
<div x-show="rooms?.length">Most recent rooms</div>
<div x-show="!rooms?.length">Loading rooms...</div>
<select
@change="setRoom($event.target.value)"
size="10"
x-show="rooms?.length > 0"
>
<template x-for="room in roomsFiltered">
<option :value="room.id" x-text="room.title"></option>
</template>
</select>
<input placeholder="Filter list" x-show="rooms?.length" x-model="roomFilter"/>
<div>
<a href="" @click.prevent="showRoomList = false">Close</a>
</div>
</div>
</div>
<footer>
Want local Python scripts instead?
See <a href="https://github.com/DJF3/Webex-Message-space-archiver">Message space archiver</a>"
<p />
© Tore Bjølseth (Cisco) 2023
</footer>
<div class="fade" x-show="showDownloading">
<div class="dialog download">
<h2>Downloading...</h2>
<div class="logger">
<i x-text="logger?.last?.text"></i>
</div>
<a href="" @click.prevent="showLogList = !showLogList">Toggle full log</a>
<div class="log-list" x-show="showLogList">
<template x-for="entry in logger?.entries">
<div
class="log-entry"
:class="entry.type"
>
<span x-text="entry.time"></span>
<span
x-text="entry.text"
></span>
</div>
</template>
</div>
<div>
<a href="" @click.prevent="showDownloading = false" x-show="!downloading">Close</a>
</div>
</div>
</div>
</main>
</body>
</html>