@nyaruka/temba-components 0.105.0 → 0.105.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/temba-components.js +2 -2
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/outboxmonitor/OutboxMonitor.js +1 -3
- package/out-tsc/src/outboxmonitor/OutboxMonitor.js.map +1 -1
- package/package.json +1 -1
- package/src/outboxmonitor/OutboxMonitor.ts +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### [v0.105.1](https://github.com/nyaruka/temba-components/compare/v0.105.0...v0.105.1)
|
|
8
|
+
|
|
9
|
+
- Remove debug [`2c3cd7f`](https://github.com/nyaruka/temba-components/commit/2c3cd7f61a7ee3418dbf52d1e4cfa1b57bc30a37)
|
|
10
|
+
|
|
7
11
|
#### [v0.105.0](https://github.com/nyaruka/temba-components/compare/v0.104.0...v0.105.0)
|
|
8
12
|
|
|
13
|
+
> 6 September 2024
|
|
14
|
+
|
|
9
15
|
- Add OutboxMonitor [`#450`](https://github.com/nyaruka/temba-components/pull/450)
|
|
10
16
|
- Add user_token icon [`c4510b0`](https://github.com/nyaruka/temba-components/commit/c4510b03d9a00cc3f009788f0262e3535d4d25a9)
|
|
11
17
|
|
package/dist/temba-components.js
CHANGED
|
@@ -7942,7 +7942,7 @@ const{I:Xh}=rt,tc=()=>document.createComment(""),ec=(t,e,i)=>{const o=t._$AA.par
|
|
|
7942
7942
|
.estimate {
|
|
7943
7943
|
font-size: 0.9em;
|
|
7944
7944
|
}
|
|
7945
|
-
`}fetchFolders(){Wt(this.endpoint).then((t=>{t.filter((t=>"outbox"===t.id||"sent"===t.id||"failed"===t.id)).forEach((t=>{this.folders[t.id]?this.folders[t.id].current=t.count:this.folders[t.id]={start:t.count,current:t.count}})),this.firstFetch?this.lastFetch=new Date:this.firstFetch=new Date,this.fetches++,
|
|
7945
|
+
`}fetchFolders(){Wt(this.endpoint).then((t=>{t.filter((t=>"outbox"===t.id||"sent"===t.id||"failed"===t.id)).forEach((t=>{this.folders[t.id]?this.folders[t.id].current=t.count:this.folders[t.id]={start:t.count,current:t.count}})),this.firstFetch?this.lastFetch=new Date:this.firstFetch=new Date,this.fetches++,this.scheduleRefresh(Math.min(5e3*this.fetches,6e4));const e=this.folders.outbox;this.backlogSize=e.current,e.current>1&&this.estimateCompletion()}))}estimateCompletion(){if(this.lastFetch){const t=(this.lastFetch.getTime()-this.firstFetch.getTime())/1e3,e=this.folders.sent,i=this.folders.failed,o=e.current+i.current-(e.start+i.start);this.msgsPerSecond=o/t;const n=this.folders.outbox.current/this.msgsPerSecond;this.estimatedCompletionDate=new Date((new Date).getTime()+1e3*n)}}scheduleRefresh(t){setTimeout((()=>{this.fetchFolders()}),t)}firstUpdated(t){t.has("endpoint")&&this.endpoint&&this.fetchFolders()}hasBacklog(){return this.backlogSize>5e5}render(){const t=Math.round(this.msgsPerSecond);return this.hasBacklog()&&this.estimatedCompletionDate&&!this.isMobile()?Z`<div class="monitor">
|
|
7946
7946
|
<temba-alert
|
|
7947
7947
|
><div class="header">Outbox Notice</div>
|
|
7948
7948
|
<div class="estimate">
|
|
@@ -7950,7 +7950,7 @@ const{I:Xh}=rt,tc=()=>document.createComment(""),ec=(t,e,i)=>{const o=t._$AA.par
|
|
|
7950
7950
|
or broadcasts. Your channels are currently sending at
|
|
7951
7951
|
${t.toLocaleString()}
|
|
7952
7952
|
message${1==t?"":"s"} per second. At that rate, your
|
|
7953
|
-
outbox
|
|
7953
|
+
outbox will clear
|
|
7954
7954
|
<temba-date
|
|
7955
7955
|
value="${this.estimatedCompletionDate.toISOString()}"
|
|
7956
7956
|
display="duration"
|