114 Commits
Author SHA1 Message Date
waozi 387dbd8028 Use official Pixelfed logo icon
- Downloaded official Pixelfed logo from brand-assets repository
- Updated icon reference from i-simple-icons-pixelfed to i-icon-pixelfed
2026-08-11 03:43:14 -05:00
waozi 9dba180289 Add Pixelfed content link support 2026-08-11 03:42:21 -05:00
sa8ab 15181a4240 Add Pixelfed icon 2026-08-11 03:21:37 +03:30
sa8ab c0d2fc1283 Add email reminder for updating twitch token 2026-08-10 03:53:15 +03:30
sa8ab 9e4ffa71c8 Update twtich service log 2026-08-08 23:56:52 +03:30
sa8ab a76412be52 Update tip source icon 2026-08-07 03:12:49 +03:30
sa8ab 8b02deb5ce Update displaying tip source on My xmrchats 2026-08-07 03:07:00 +03:30
sa8ab 083f46390f Add tip source on My xmrchats 2026-08-07 03:06:18 +03:30
sa8ab c8db0f7b98 Update recent tip item 2026-08-07 02:21:56 +03:30
sa8ab 47f11de99d Add tip source icon on recent tips 2026-08-07 02:18:58 +03:30
sa8ab 3c16343444 Add links query filter on getting pages list 2026-08-06 04:26:58 +03:30
sa8ab aaf52c53a5 Add source in creating tip 2026-08-05 23:17:17 +03:30
sa8ab 216003eaf3 Add source in dto 2026-08-05 23:16:29 +03:30
sa8ab 4fcd7b0afd Add tip source 2026-08-05 23:12:39 +03:30
sa8ab b81e4b8721 Add only making tip private 2026-08-05 00:48:56 +03:30
sa8ab 6eefd85281 Update element icon 2026-08-03 19:11:57 +03:30
sa8ab 4f1b2ae3dd Merge branch 'master' into dev 2026-08-03 19:01:09 +03:30
sa8ab 32dbc07219 Merge pull request #150 from XMRChat/homepage-totals
Homepage totals
2026-08-02 03:46:45 +03:30
sa8ab c25024700d Add test page paths on total 2026-08-02 03:36:51 +03:30
sa8ab e1fb5098cd Update total tips format and space 2026-08-02 03:36:09 +03:30
sa8ab 8837db44cb Add total tips on home 2026-08-02 03:36:09 +03:30
sa8ab 840cb69364 Merge branch 'master' into dev 2026-08-02 03:29:47 +03:30
sa8ab 6fc740fe7a Merge pull request #149 from XMRChat/tip-goal
Update tip goal % decimal
2026-07-31 20:06:37 +03:30
sa8ab a4b6a2a7c6 Update tip goal % decimal 2026-07-31 19:59:20 +03:30
sa8ab e47d2e470f Update tip goal % decimal 2026-07-31 19:55:47 +03:30
sa8ab 87cfd0fce8 Merge pull request #148 from XMRChat/tip-goal
Updated Deactivated word
2026-07-30 02:18:24 +03:30
sa8ab adcfc10c0b Updated Deactivated word 2026-07-30 02:11:28 +03:30
sa8ab 34b4af3ec1 Updated Deactivated word 2026-07-30 02:10:59 +03:30
sa8ab dbaa743362 Merge pull request #147 from XMRChat/temp-dev
Temp dev
2026-07-30 01:39:42 +03:30
sa8ab 24c399b269 Update displaying tip goal 2026-07-29 17:41:06 +03:30
sa8ab e1dfb25719 Add displaying tip goal based on tip toggle 2026-07-29 17:41:06 +03:30
sa8ab 461045a66f Update interval of tip goal 2026-07-29 17:41:06 +03:30
sa8ab e77a452b3a Update time on tip goal 2026-07-29 17:41:06 +03:30
sa8ab 8f663cc55f Add updating tip goal value 2026-07-29 17:41:06 +03:30
sa8ab cff386b998 Add pending on tip goal 2026-07-29 17:41:06 +03:30
sa8ab 3736d861b5 Remove min from star time 2026-07-29 17:41:06 +03:30
sa8ab 06d4681454 Add overflow of tip goal title 2026-07-29 17:41:06 +03:30
sa8ab 4206e26d06 Display name close to progress and display information if description has some value 2026-07-29 17:41:06 +03:30
sa8ab 8ac3bac1aa Add tip goal 2026-07-29 17:41:06 +03:30
sa8ab 6b147677ed Add tip goal on page 2026-07-29 17:41:06 +03:30
sa8ab 0e1ebc15d7 Add tip goal on page dto 2026-07-29 17:41:06 +03:30
sa8ab e0ec880965 Delete exceeded 2026-07-29 17:41:06 +03:30
sa8ab 2042903653 Update progress bar 2026-07-29 17:41:06 +03:30
sa8ab d891443de3 Update displaying tip goal 2026-07-29 17:41:06 +03:30
sa8ab 363a010c3b Update logs 2026-07-29 17:41:06 +03:30
sa8ab 08d28eecc8 Update tip goal on tip page 2026-07-29 17:41:06 +03:30
sa8ab 8b7cb419d3 Add tip goal component 2026-07-29 17:41:06 +03:30
sa8ab 3864147e0c Update returning page with empty tip goal 2026-07-29 17:41:06 +03:30
sa8ab 298713b06e Add tip goal 2026-07-29 17:41:06 +03:30
sa8ab fe15b88192 Add getting tips in tip goal 2026-07-29 17:41:06 +03:30
sa8ab 3cd43d247a Add optional after date 2026-07-29 17:41:05 +03:30
sa8ab 66685468a6 Add validations for end and start 2026-07-29 17:41:05 +03:30
sa8ab 327b8b652f Update tip goal form 2026-07-29 17:41:05 +03:30
sa8ab 4855df1b29 Add tip goal form 2026-07-29 17:41:05 +03:30
sa8ab 1cc3a0436b Add getting tip goal 2026-07-29 17:41:05 +03:30
sa8ab f79c6a255a Add tip goal page 2026-07-29 17:41:05 +03:30
sa8ab 9a965ed87f Add updating tip goal 2026-07-29 17:41:05 +03:30
sa8ab c1e1221ac1 Add creating tip goal 2026-07-29 17:41:05 +03:30
sa8ab 830440fbdb Add creating tip goal 2026-07-29 17:41:05 +03:30
sa8ab c8c674dd98 Update 2026-07-29 17:41:05 +03:30
sa8ab d9e51551ce Add create dto 2026-07-29 17:41:05 +03:30
sa8ab dd760e30df Add tip goal entity 2026-07-29 17:41:05 +03:30
sa8ab b36927b559 Add tip goals 2026-07-29 17:41:05 +03:30
waozi 7c9b9c9935 Add Kick live stream support 2026-07-29 17:30:52 +03:30
waozi fed296457c Add PeerTube live stream support 2026-07-29 17:26:34 +03:30
sa8ab 9ffeb489de Merge branch 'pr-133' into temp-dev 2026-07-29 17:13:01 +03:30
sa8ab d2df515aee Merge pull request #139 from waozixyz/social
Add GitLab and Matrix content links
2026-07-29 03:40:13 +03:30
sa8ab c4dcd179f8 Merge pull request #145 from XMRChat/tip-goal
Tip goal
2026-07-29 03:28:25 +03:30
sa8ab eba76ff429 Update displaying tip goal 2026-07-29 03:27:30 +03:30
sa8ab 10f47bf9ef Add displaying tip goal based on tip toggle 2026-07-28 20:00:47 +03:30
sa8ab 038d10a0bd Merge pull request #144 from XMRChat/tip-goal
Tip goal
2026-07-28 03:10:30 +03:30
sa8ab ccec9285dd Update interval of tip goal 2026-07-28 03:10:03 +03:30
sa8ab 57cd95d9ba Update time on tip goal 2026-07-28 03:09:22 +03:30
sa8ab ab9030dae2 Merge pull request #143 from XMRChat/tip-goal
Add updating tip goal value
2026-07-26 21:26:48 +03:30
sa8ab 5eb2ba96e3 Add updating tip goal value 2026-07-26 21:25:40 +03:30
sa8ab 5e17ffa4c6 Merge pull request #142 from XMRChat/tip-goal
Tip goal
2026-07-23 19:55:48 +03:30
sa8ab a65e763b66 Add pending on tip goal 2026-07-23 19:52:23 +03:30
sa8ab 54a53b46fd Remove min from star time 2026-07-23 19:50:03 +03:30
sa8ab b2ba00d152 Add overflow of tip goal title 2026-07-23 19:40:13 +03:30
sa8ab 3105309bdf Display name close to progress and display information if description has some value 2026-07-22 16:13:27 +03:30
sa8ab b6176d2ae2 Merge pull request #141 from XMRChat/tip-goal
Tip goal
2026-07-21 21:16:39 +03:30
sa8ab 023f168290 Add tip goal 2026-07-21 21:13:40 +03:30
sa8ab a3ad2e5778 Add tip goal on page 2026-07-21 20:05:50 +03:30
sa8ab 2a21a99303 Add tip goal on page dto 2026-07-21 20:03:58 +03:30
sa8ab 21b72d2732 Delete exceeded 2026-07-21 18:32:46 +03:30
sa8ab ca37005c20 Update progress bar 2026-07-21 02:34:00 +03:30
sa8ab 140c5dc6af Update displaying tip goal 2026-07-21 01:45:52 +03:30
sa8ab 7112075271 Update logs 2026-07-19 03:48:57 +03:30
sa8ab f6f51168a0 Update tip goal on tip page 2026-07-19 03:48:09 +03:30
sa8ab 6eeeec1207 Add tip goal component 2026-07-19 03:34:39 +03:30
sa8ab f78c4468b9 Update returning page with empty tip goal 2026-07-19 02:18:18 +03:30
sa8ab c77621e71f Add tip goal 2026-07-19 02:17:06 +03:30
sa8ab 3d6380f285 Add getting tips in tip goal 2026-07-17 03:04:46 +03:30
sa8ab 26b4085e95 Add optional after date 2026-07-16 23:56:06 +03:30
sa8ab f857f3bba2 Add validations for end and start 2026-07-16 23:55:02 +03:30
sa8ab 93b4603e8a Update tip goal form 2026-07-16 22:27:30 +03:30
sa8ab 12aa08e036 Add tip goal form 2026-07-16 01:48:07 +03:30
sa8ab 0efb46a5f3 Add getting tip goal 2026-07-16 00:44:45 +03:30
sa8ab 2a0ad2056f Add tip goal page 2026-07-16 00:13:49 +03:30
sa8ab 05930c53a0 Add updating tip goal 2026-07-15 22:19:58 +03:30
sa8ab ebc6b24b95 Add creating tip goal 2026-07-15 17:20:36 +03:30
sa8ab 80b7013c93 Add creating tip goal 2026-07-15 17:08:29 +03:30
waozi 13b259c58c Add GitLab and Matrix links and sort live streams 2026-07-11 18:29:04 -03:00
sa8ab 2f2dab4f43 Merge pull request #137 from waozixyz/dev
Add Kick live stream support
2026-07-12 00:49:54 +03:30
sa8ab e7331600bf Add sending email on failed Simplex and Signal 2026-07-11 03:32:35 +03:30
sa8ab 41f101a095 Merge pull request #140 from sa8ab/links-update
Links update
2026-07-11 02:19:04 +03:30
sa8ab 32d0873aeb Merge pull request #138 from sa8ab/links-update
Update github link to full link
2026-07-10 18:28:39 +03:30
sa8ab 66b916d8b1 Update github link to full link 2026-07-10 18:28:06 +03:30
sa8ab a3c72e957d Merge pull request #136 from sa8ab/simplex-update
Use version of Simplex instead of latest
2026-07-09 01:10:34 +03:30
sa8ab f81ad81faf Use version of SImplex instead of latest 2026-07-09 01:09:37 +03:30
sa8ab 92aae92add Update 2026-07-08 02:26:03 +03:30
sa8ab 950ae1be86 Add create dto 2026-07-07 02:39:27 +03:30
sa8ab 512c757681 Add tip goal entity 2026-07-06 21:01:21 +03:30
sa8ab e7b2ab0f20 Add tip goals 2026-07-05 21:44:35 +03:30
56 changed files with 1331 additions and 41 deletions

No files matched your search

+89
View File
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" id="svg102" version="1.1" height="50" width="50">
<metadata id="metadata106">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs id="defs56">
<linearGradient id="g1" y2="0.60117739" x2="0" y1="0.55806792" x1="1">
<stop id="stop2" offset="0" stop-color="#FF5C34" />
<stop id="stop4" offset="1" stop-color="#EB0256" />
</linearGradient>
<linearGradient id="g2" y2="0" x2="0.30560157" y1="1.1191301" x1="0.5">
<stop id="stop7" offset="0" stop-color="#FFB000" />
<stop id="stop9" offset="1" stop-color="#FF7725" />
</linearGradient>
<filter x="-0.266" y="-0.189" width="1.5319999" height="1.472" filterUnits="objectBoundingBox" id="filter-18-3">
<feOffset id="feOffset12" dx="0" dy="1" in="SourceAlpha" result="shadowOffsetOuter1" />
<feGaussianBlur id="feGaussianBlur14" stdDeviation="1.5" in="shadowOffsetOuter1" result="shadowBlurOuter1" />
<feColorMatrix id="feColorMatrix16" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.298686594 0" type="matrix" in="shadowBlurOuter1" />
</filter>
<linearGradient xlink:href="#g4" id="g3" gradientUnits="userSpaceOnUse" gradientTransform="scale(0.85441985,1.1703848)" x1="38.66045" y1="42.313534" x2="29.417906" y2="17.769199" />
<linearGradient x1="38.66045" y1="42.313534" x2="29.417906" y2="17.769199" id="g4" gradientTransform="scale(0.85441985,1.1703848)" gradientUnits="userSpaceOnUse">
<stop id="stop20" stop-color="#21EFE3" offset="0%" />
<stop id="stop22" stop-color="#2598FF" offset="100%" />
</linearGradient>
<linearGradient x1="32.778084" y1="31.292349" x2="-5.737164" y2="34.564075" id="g5" gradientTransform="scale(0.85441985,1.1703848)" gradientUnits="userSpaceOnUse">
<stop id="stop25" stop-color="#A63FDB" offset="0%" />
<stop id="stop27" stop-color="#FF257E" offset="100%" />
</linearGradient>
<linearGradient xlink:href="#g1" id="g6" gradientUnits="userSpaceOnUse" gradientTransform="scale(0.85441985,1.1703848)" x1="26.799479" y1="19.639755" x2="6.4907837" y2="20.515251" />
<linearGradient xlink:href="#g1" id="g7" x1="26.799479" y1="19.639755" x2="6.4907837" y2="20.515251" gradientTransform="matrix(0.73238181,-0.44005875,0.60279359,1.0032156,-5.4387332,4.178016)" gradientUnits="userSpaceOnUse" />
<linearGradient xlink:href="#g2" id="g8" x1="15.185128" y1="33.220253" x2="9.5916662" y2="1.0193164" gradientTransform="matrix(0.87275201,0.73232484,-0.56419841,0.67238452,20.873061,-10.319713)" gradientUnits="userSpaceOnUse" />
<linearGradient xlink:href="#g10" id="g9" gradientUnits="userSpaceOnUse" gradientTransform="scale(0.85441984,1.1703848)" x1="16.690788" y1="19.195547" x2="57.873302" y2="21.720842" />
<linearGradient x1="16.690788" y1="19.195547" x2="57.873302" y2="21.720842" id="g10" gradientTransform="scale(0.85441984,1.1703848)" gradientUnits="userSpaceOnUse">
<stop id="stop34" stop-color="#9EE85D" offset="0%" />
<stop id="stop36" stop-color="#0ED061" offset="100%" />
</linearGradient>
<linearGradient x1="40.01442" y1="3.0503507" x2="21.610674" y2="22.693472" id="g11" gradientTransform="matrix(0.8028135,0.67363955,-0.61334952,0.73096044,20.873061,-10.319713)" gradientUnits="userSpaceOnUse">
<stop id="stop39" stop-color="#17C934" offset="0" />
<stop id="stop41" stop-color="#03FF6E" offset="1" />
</linearGradient>
<linearGradient x1="31.906258" y1="22.861416" x2="56.143276" y2="28.198187" id="g12" gradientTransform="matrix(0.67306192,0.5647652,-0.7315899,0.87187364,20.873061,-10.319713)" gradientUnits="userSpaceOnUse">
<stop id="stop44" stop-color="#00FFF0" offset="0" />
<stop id="stop46" stop-color="#0087FF" offset="1" />
</linearGradient>
<linearGradient x1="18.604218" y1="60.088772" x2="29.551889" y2="34.263325" id="g13" gradientTransform="matrix(0.93316856,0.78302028,-0.52767025,0.62885203,20.873061,-10.319713)" gradientUnits="userSpaceOnUse">
<stop id="stop49" stop-color="#A63FDB" offset="0" />
<stop id="stop51" stop-color="#FF257E" offset="1" />
</linearGradient>
<linearGradient xlink:href="#g1" id="g14" x1="30.973358" y1="27.509178" x2="1.1089396" y2="28.796618" gradientTransform="matrix(0.64006516,0.53707767,-0.76930493,0.9168206,20.873061,-10.319713)" gradientUnits="userSpaceOnUse" />
<linearGradient xlink:href="#g2" id="g15" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.87275201,0.73232484,-0.56419841,0.67238452,20.873061,-10.319713)" x1="15.185128" y1="33.220253" x2="9.5916662" y2="1.0193164" />
</defs>
<path id="path58" d="M 24.844501,25.208859 C 20.77843,19.646166 13.002814,18.371306 7.4771766,22.36138 1.9515387,26.351453 0.76832601,34.0955 4.8343958,39.658194 l 0.3076235,0.420851 C -1.4888222,31.406438 -1.8150576,19.240724 4.7952638,10.325752 l 0.1176971,-0.1564 c 4.095389,-5.4421 11.8771861,-6.487086 17.3811281,-2.33404 5.503943,4.153045 6.6458,11.931447 2.550412,17.373547 z" style="fill:url(#g14)" />
<path id="path60" d="m 24.844501,25.208859 c -6.472999,2.189353 -9.877881,9.222288 -7.605018,15.708503 2.272862,6.486214 9.362782,9.969509 15.835779,7.780157 L 33.50409,48.552478 C 25.454263,51.432746 16.076124,50.047472 8.9909709,44.102332 7.5339337,42.879734 6.2499668,41.528152 5.1420193,40.079045 L 4.8343958,39.658194 C 0.76832601,34.0955 1.9515387,26.351453 7.4771766,22.36138 13.002814,18.371306 20.77843,19.646166 24.844501,25.208859 Z" style="fill:url(#g13)" />
<path id="path62" d="m 24.844501,25.208859 c 0.04163,6.84562 5.636761,12.42884 12.497071,12.470471 6.860311,0.04163 12.387942,-5.47409 12.346311,-12.319709 l -9.53e-4,-0.156747 c 0.07327,5.679151 -1.798009,11.388946 -5.714387,16.056296 -2.883411,3.436311 -6.515801,5.879029 -10.468453,7.293308 l -0.428828,0.145041 C 26.602265,50.886871 19.512345,47.403576 17.239483,40.917362 14.96662,34.431147 18.371502,27.398212 24.844501,25.208859 Z" style="fill:url(#g12)" />
<path id="path64" d="M 24.844501,25.208859 C 31.381909,27.363866 38.367988,23.843413 40.448347,17.345706 42.528706,10.848 38.915553,3.83359 32.378144,1.678584 L 31.842952,1.502162 c 3.149862,0.958982 6.167442,2.558035 8.855077,4.813224 5.838829,4.899353 8.898368,11.870026 8.988901,18.887488 l 9.53e-4,0.156747 c 0.04163,6.845619 -5.486,12.361341 -12.346311,12.319709 -6.86031,-0.04163 -12.45544,-5.624851 -12.497071,-12.470471 z" style="fill:url(#g11)" />
<path id="path66" style="fill:url(#g15)" d="M 24.844501,25.208859 C 28.939889,19.766759 27.798032,11.988357 22.294089,7.835312 16.790147,3.682266 9.0083499,4.727252 4.9129609,10.169352 L 4.7952628,10.325753 C 5.0886452,9.930085 5.3956916,9.54082 5.7164561,9.158548 12.244579,1.378645 22.61183,-1.308273 31.842952,1.502162 l 0.535192,0.176422 c 6.537409,2.155006 10.150562,9.169416 8.070203,15.667122 -2.080359,6.497707 -9.066438,10.01816 -15.603846,7.863153 z" />
<g id="g72" style="opacity:0.54425222;fill:none" transform="matrix(-0.37460713,0.92718385,-0.92718518,-0.37460659,68.842244,2.122857)">
<path id="path68" d="m 28.379451,9.2701483 0.186983,-0.07462 c 6.393149,-2.551328 13.669757,0.4995351 16.252757,6.8142937 2.583,6.314759 -0.505736,13.502142 -6.898886,16.05347 -0.05343,-1.007011 -0.227732,-1.979458 -0.50829,-2.904343 3.429966,-1.856689 5.75552,-5.45605 5.75552,-9.591913 0,-6.036745 -4.954499,-10.9304939 -11.066184,-10.9304939 -1.305803,0 -2.558782,0.223396 -3.7219,0.6336062 z" style="fill:url(#g9)" />
<path id="path70" d="m 28.379451,9.2701483 0.186983,-0.07462 c 6.393149,-2.551328 13.669757,0.4995351 16.252757,6.8142937 2.583,6.314759 -0.505736,13.502142 -6.898886,16.05347 -0.05343,-1.007011 -0.227732,-1.979458 -0.50829,-2.904343 3.429966,-1.856689 5.75552,-5.45605 5.75552,-9.591913 0,-6.036745 -4.954499,-10.9304939 -11.066184,-10.9304939 -1.305803,0 -2.558782,0.223396 -3.7219,0.6336062 z" style="mix-blend-mode:overlay;fill:#000000;fill-opacity:0.49988679" />
</g>
<path id="path74" style="opacity:0.1;fill:url(#g8)" d="M 24.844501,25.208859 C 28.939889,19.766759 27.798032,11.988357 22.294089,7.835312 16.790147,3.682266 9.0083499,4.727252 4.9129609,10.169352 L 4.7952628,10.325753 C 5.0886452,9.930085 5.3956916,9.54082 5.7164561,9.158548 12.244579,1.378645 22.61183,-1.308273 31.842952,1.502162 l 0.535192,0.176422 c 6.537409,2.155006 10.150562,9.169416 8.070203,15.667122 -2.080359,6.497707 -9.066438,10.01816 -15.603846,7.863153 z" />
<path id="path76" style="opacity:0.18013395;fill:url(#g7)" d="M 4.8244748,10.490984 4.946318,10.330719 C 9.112291,4.851089 16.920883,3.718459 22.387296,7.80092 27.853707,11.883381 28.907921,19.634987 24.741947,25.114618 24.177499,24.278959 23.527245,23.535182 22.810409,22.8869 24.7942,19.528843 24.933782,15.24584 22.803609,11.700712 19.69445,6.526212 12.927139,4.883207 7.6883949,8.030957 6.5691013,8.703496 5.6101449,9.540315 4.8244318,10.490984 Z" />
<g id="g82" style="opacity:0.18013395;fill:none" transform="matrix(0.85716853,-0.51503807,0.51503881,0.8571673,-5.2722905,4.334214)">
<path id="path78" d="m 5.5458544,10.697205 0.1869826,-0.07462 c 6.39315,-2.5513278 13.669757,0.499535 16.252757,6.814294 2.583,6.314758 -0.505736,13.502141 -6.898886,16.053469 -0.05343,-1.007011 -0.227732,-1.979458 -0.50829,-2.904342 3.429966,-1.856689 5.755521,-5.45605 5.755521,-9.591914 0,-6.036745 -4.9545,-10.930493 -11.0661847,-10.930493 -1.3058034,0 -2.5587821,0.223396 -3.7218999,0.633606 z" style="fill:url(#g6)" />
<path id="path80" d="m 5.5458544,10.697205 0.1869826,-0.07462 c 6.39315,-2.5513278 13.669757,0.499535 16.252757,6.814294 2.583,6.314758 -0.505736,13.502141 -6.898886,16.053469 -0.05343,-1.007011 -0.227732,-1.979458 -0.50829,-2.904342 3.429966,-1.856689 5.755521,-5.45605 5.755521,-9.591914 0,-6.036745 -4.9545,-10.930493 -11.0661847,-10.930493 -1.3058034,0 -2.5587821,0.223396 -3.7218999,0.633606 z" style="mix-blend-mode:multiply;fill:#000000;fill-opacity:0.77284307" />
</g>
<g id="g88" style="opacity:0.5841518;fill:none" transform="matrix(-0.22495138,-0.97437006,0.97437146,-0.22495105,-15.913458,55.421439)">
<path id="path84" d="m 10.654093,23.764822 0.186983,-0.07462 c 6.393149,-2.551328 13.669757,0.499535 16.252757,6.814293 2.583,6.314759 -0.505736,13.502142 -6.898886,16.05347 -0.05343,-1.007011 -0.227732,-1.979458 -0.50829,-2.904343 3.429966,-1.856689 5.75552,-5.45605 5.75552,-9.591913 0,-6.036745 -4.954499,-10.930493 -11.066184,-10.930493 -1.305803,0 -2.558782,0.223396 -3.7219,0.633606 z" style="fill:url(#g5)" />
<path id="path86" d="m 10.654093,23.764822 0.186983,-0.07462 c 6.393149,-2.551328 13.669757,0.499535 16.252757,6.814293 2.583,6.314759 -0.505736,13.502142 -6.898886,16.05347 -0.05343,-1.007011 -0.227732,-1.979458 -0.50829,-2.904343 3.429966,-1.856689 5.75552,-5.45605 5.75552,-9.591913 0,-6.036745 -4.954499,-10.930493 -11.066184,-10.930493 -1.305803,0 -2.558782,0.223396 -3.7219,0.633606 z" style="mix-blend-mode:overlay;fill:#000000;fill-opacity:0.50308539" />
</g>
<g id="g94" style="opacity:0.56222097;fill:none" transform="matrix(-0.99863096,-0.05233596,0.05233603,-0.99862953,57.15441,72.548735)">
<path id="path90" d="m 25.135241,22.73235 0.186983,-0.07462 c 6.39315,-2.551328 13.669757,0.499535 16.252757,6.814293 2.583001,6.314759 -0.505736,13.502142 -6.898886,16.05347 -0.05343,-1.007011 -0.227731,-1.979458 -0.50829,-2.904343 3.429966,-1.856689 5.755521,-5.45605 5.755521,-9.591913 0,-6.036745 -4.9545,-10.930494 -11.066185,-10.930494 -1.305803,0 -2.558782,0.223396 -3.7219,0.633607 z" style="fill:url(#g3)" />
<path id="path92" d="m 25.135241,22.73235 0.186983,-0.07462 c 6.39315,-2.551328 13.669757,0.499535 16.252757,6.814293 2.583001,6.314759 -0.505736,13.502142 -6.898886,16.05347 -0.05343,-1.007011 -0.227731,-1.979458 -0.50829,-2.904343 3.429966,-1.856689 5.755521,-5.45605 5.755521,-9.591913 0,-6.036745 -4.9545,-10.930494 -11.066185,-10.930494 -1.305803,0 -2.558782,0.223396 -3.7219,0.633607 z" style="mix-blend-mode:overlay;fill:#000000" />
</g>
<path id="path96" d="m 32.186954,1.615568 0.191202,0.06303 c 6.537408,2.155006 10.150561,9.169416 8.070202,15.667122 -2.080359,6.497706 -9.066438,10.01816 -15.603846,7.863153 0.606364,-0.805759 1.097919,-1.662736 1.477505,-2.551578 3.820968,0.782433 7.916076,-0.48 10.574561,-3.648255 C 40.776928,14.384625 40.127202,7.451106 35.445374,3.522591 34.445068,2.683237 33.341634,2.048968 32.186954,1.61557 Z" style="mix-blend-mode:overlay;fill:#000000;fill-opacity:0.49617866" />
<path id="path98" d="m 24.100846,55.523071 h 4.544831 c 4.281413,0 7.752184,-3.36365 7.752184,-7.512922 0,-4.149273 -3.470771,-7.512923 -7.752184,-7.512923 h -6.55954 c -2.470046,0 -4.472413,1.940568 -4.472413,4.334379 v 16.869977 z" style="fill:#000000;filter:url(#filter-18-3)" transform="matrix(1.0000014,0,0,1,-1.2150017,-25)" />
<path id="path100" d="m 22.885879,30.523071 h 4.544837 c 4.281419,0 7.752195,-3.36365 7.752195,-7.512922 0,-4.149273 -3.470776,-7.512923 -7.752195,-7.512923 h -6.559549 c -2.47005,0 -4.47242,1.940568 -4.47242,4.334379 v 16.869977 z" style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

+184
View File
@@ -0,0 +1,184 @@
<script setup lang="ts">
import type { Dayjs } from "dayjs";
import type { TipGoal } from "~/types";
import { TipDisplayMode, type FiatEnum } from "~/types/enums";
const props = defineProps<{
path?: string;
fiat?: FiatEnum;
tipGoal?: TipGoal;
}>();
const { axios } = useApp();
const { dayjs } = useDate();
const { state: generalState } = useGeneralStore();
const { xmrToFiat } = useXmrPrice();
const { money } = useMoney();
const modalRef = ref(false);
const nowDayjsRef = ref<Dayjs | undefined>(undefined);
const nowDayjs = computed(() => nowDayjsRef.value ?? dayjs());
const { data, refresh } = useLazyAsyncData(
`tip-goal-${props.path}`,
async () => {
const { data } = await axios.get<{ tipsAmount: number }>(
`/tip-goals/tips/${props.path}`,
);
return data;
},
{ server: false },
);
const interval = ref<NodeJS.Timeout | undefined>(undefined);
const nowInterval = ref<NodeJS.Timeout | undefined>(undefined);
onMounted(() => {
startTipsInterval();
nowInterval.value = setInterval(() => {
nowDayjsRef.value = dayjs();
}, 4000);
});
const startTipsInterval = () => {
stopTipsInterval();
interval.value = setInterval(() => refresh(), 8000);
};
const stopTipsInterval = () => {
clearInterval(interval.value);
};
onBeforeUnmount(() => {
stopTipsInterval();
clearInterval(nowInterval.value);
});
const getComputedPrice = (xmr?: number) => {
if (!xmr) return 0;
const fiat = xmrToFiat(xmr, props.fiat);
return generalState.tipDisplayValue === TipDisplayMode.XMR
? `${xmr} XMR`
: money(fiat.toFixed(2), props.fiat);
};
const percentage = computed(() => {
const amount = Number(props.tipGoal?.amount) ?? 0;
const tipsAmount = Number(data.value?.tipsAmount) ?? 0;
if (!amount || !tipsAmount) return 0;
return Math.round((tipsAmount / amount) * 100);
});
const startLeft = computed(() => {
const startTime = props.tipGoal?.startTime;
if (!startTime) return undefined;
const startTimeDayjs = dayjs(startTime);
if (startTimeDayjs.isBefore(nowDayjs.value)) return undefined;
return `Starts ${dayjs(startTime).fromNow()}`;
});
const isEnded = computed(() => {
const endTime = props.tipGoal?.endTime;
if (!endTime) return false;
return dayjs(endTime).isBefore(nowDayjs.value);
});
const timeLeft = computed(() => {
const endTime = props.tipGoal?.endTime;
if (!endTime) return "No end time";
// Added to keep the timeLeft reactive
const now = nowDayjs.value;
return `Ends ${dayjs(endTime).fromNow()}`;
});
const isCompleted = computed(() => {
return percentage.value >= 100;
});
</script>
<template>
<div>
<div class="flex flex-col gap-1">
<div class="flex justify-between items-center gap-2">
<div class="flex items-center gap-2 min-w-0 flex-1">
<span class="truncate">{{ tipGoal?.name }}</span>
<UButton
v-if="tipGoal?.description"
icon="i-heroicons-information-circle"
variant="ghost"
size="sm"
color="gray"
@click="modalRef = true"
/>
</div>
<span class="whitespace-nowrap">{{
getComputedPrice(Number(tipGoal?.amount))
}}</span>
</div>
<div
:class="[
'w-full flex justify-center items-center bg-background-2 rounded-full overflow-hidden h-4 relative',
{ 'tip-goal-progress--completed': isCompleted },
]"
>
<div
class="bg-primary h-full rounded-full absolute left-0 top-0 z-0 max-w-full"
:style="`width: ${Math.min(percentage, 100)}%`"
></div>
<div class="text-xs relative z-40">
{{ getComputedPrice(data?.tipsAmount) }} ({{ percentage }}%)
</div>
</div>
<div class="flex justify-between">
<div>
<span v-if="startLeft" class="text-sm text-pale">{{
startLeft
}}</span>
</div>
<div>
<span v-if="isEnded" class="text-sm text-pale">Time is ended</span>
<span v-else class="text-sm text-pale">{{ timeLeft }}</span>
</div>
</div>
</div>
<UModal v-model="modalRef">
<UCard>
<template #header>
<h2 class="text-lg font-medium">{{ tipGoal?.name }}</h2>
</template>
<div class="">
<div>{{ tipGoal?.description }}</div>
</div>
<template #footer>
<UButton variant="soft" @click="modalRef = false">{{
$t("close")
}}</UButton>
</template>
</UCard>
</UModal>
</div>
</template>
<style scoped>
.tip-goal-progress--completed {
animation: tip-goal-shadow-pulse 1.8s infinite;
}
@keyframes tip-goal-shadow-pulse {
0%,
100% {
box-shadow: 0 0 0 0 rgb(var(--color-primary-500) / 0.4);
}
70% {
box-shadow: 0 0 12px 4px rgb(var(--color-primary-500) / 0.25);
}
}
</style>
@@ -0,0 +1,223 @@
<script setup lang="ts">
import useVuelidate from "@vuelidate/core";
import { helpers } from "@vuelidate/validators";
import type { TipGoal } from "~/types";
interface State {
form: {
name?: string;
amount?: string;
startTime?: string;
endTime?: string;
description?: string;
isActive: boolean;
};
tipGoal: TipGoal | undefined;
loading: boolean;
loadingData: boolean;
}
const props = defineProps<{
editable?: boolean;
}>();
const emit = defineEmits<{
update: [];
}>();
const { required, maxLength, numberic } = useValidations();
const { toStreamerTipGoal, toCreateStreamerTipGoal } = useRouteLocation();
const { axios } = useApp();
const toast = useToast();
const { dayjs } = useDate();
const { t } = useI18n();
const DEFAULT_FORMAT = "YYYY-MM-DDTHH:mm";
const state: State = reactive({
form: {
name: undefined,
amount: undefined,
startTime: undefined,
endTime: undefined,
description: undefined,
isActive: true,
},
tipGoal: undefined,
loading: false,
loadingData: false,
});
const toDatetimeLocal = (value?: string) => {
if (!value) return undefined;
const date = dayjs(value);
if (!date.isValid()) return undefined;
return date.format("YYYY-MM-DDTHH:mm");
};
const toIsoString = (value?: string) => {
if (!value) return undefined;
const date = dayjs(value);
if (!date.isValid()) return undefined;
return date.toISOString();
};
useLazyAsyncData(
async () => {
if (!props.editable) return;
state.loadingData = true;
try {
const { data } = await axios.get<{ tipGoal: TipGoal | null }>(
`/tip-goals`,
);
if (!data.tipGoal) {
await navigateTo(toCreateStreamerTipGoal());
return;
}
state.form.name = data.tipGoal.name;
state.form.amount = data.tipGoal.amount;
state.form.startTime = toDatetimeLocal(data.tipGoal.startTime);
state.form.endTime = toDatetimeLocal(data.tipGoal.endTime);
state.form.description = data.tipGoal.description;
state.form.isActive = data.tipGoal.isActive;
state.tipGoal = data.tipGoal;
} finally {
state.loadingData = false;
}
},
{ server: false },
);
const handleSubmit = async () => {
const valid = await v.value.$validate();
if (!valid) return;
state.loading = true;
try {
const payload = {
name: state.form.name,
amount: String(state.form.amount),
startTime: toIsoString(state.form.startTime),
endTime: toIsoString(state.form.endTime),
description: state.form.description || undefined,
isActive: state.form.isActive,
};
if (props.editable) {
await axios.put(`/tip-goals`, payload);
} else {
await axios.post(`/tip-goals`, payload);
}
toast.add({
description: props.editable ? "Tip goal updated" : "Tip goal created",
color: "green",
});
// await navigateTo(toStreamerTipGoal());
emit("update");
} catch (error) {
toast.add({
description: getErrorMessage(error),
color: "red",
});
} finally {
state.loading = false;
}
};
const v = useVuelidate<any>(
computed(() => ({
name: { required, maxLength: maxLength(80) },
amount: { required, numberic },
startTime: { required },
endTime: {
afterDate: helpers.withMessage(
"End should be after start.",
(value: any) =>
value ? dayjs(value).isAfter(state.form.startTime) : true,
),
},
description: { maxLength: maxLength(255) },
})),
computed(() => state.form),
);
const { getValidationAttrs } = useValidations(v);
</script>
<template>
<div>
<GeneralForm @submit="handleSubmit">
<div class="flex gap-4 flex-col w-full max-w-[600px] m-auto">
<UFormGroup label="Name" :error="getValidationAttrs('name').error">
<UInput
v-model="state.form.name"
@blur="getValidationAttrs('name').onBlur"
/>
</UFormGroup>
<UFormGroup
label="Amount ( XMR )"
:error="getValidationAttrs('amount').error"
>
<UInput
v-model="state.form.amount"
@blur="getValidationAttrs('amount').onBlur"
/>
</UFormGroup>
<UFormGroup
label="Start"
:error="getValidationAttrs('startTime').error"
>
<UInput
v-model="state.form.startTime"
type="datetime-local"
@blur="getValidationAttrs('startTime').onBlur"
/>
</UFormGroup>
<UFormGroup label="End" :error="getValidationAttrs('endTime').error">
<template #hint>
<span class="text-xs">{{ $t("optional") }}</span>
</template>
<UInput
v-model="state.form.endTime"
type="datetime-local"
@blur="getValidationAttrs('endTime').onBlur"
/>
</UFormGroup>
<UFormGroup
label="Description"
:error="getValidationAttrs('description').error"
>
<template #hint>
<span class="text-xs">{{ $t("optional") }}</span>
</template>
<UTextarea
v-model="state.form.description"
@blur="getValidationAttrs('description').onBlur"
/>
</UFormGroup>
<UFormGroup>
<UCheckbox v-model="state.form.isActive" label="Is Active">
<template #help>
Deactivated tip goal will not be displayed on your tip page.
</template>
</UCheckbox>
</UFormGroup>
<div class="mt-4">
<UButton type="submit" :loading="state.loading">
{{ $t("save") }}
</UButton>
</div>
</div>
</GeneralForm>
</div>
</template>
<style scoped></style>
+11 -7
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import type { Tip, TipReplySettings } from "~/types";
import { TipSourceEnum } from "~/types/enums";
const props = defineProps<{
item: Tip;
@@ -10,7 +11,7 @@ const props = defineProps<{
name?: string;
}>();
const { getPageTierColor } = useConstants();
const { getPageTierColor, getTipSource } = useConstants();
const tier = computed(() => props.item.pageTipTier);
const tierColor = computed(() => tier.value?.color);
@@ -82,12 +83,15 @@ watch(
>
<div :style="headingStyle">
<div class="flex justify-between items-center">
<p
class="pb-1 text-base font-medium"
:class="{ 'opacity-80': item.private }"
>
{{ item.private ? $t("private.title") : item.name }}
</p>
<div class="flex items-center gap-1 pb-1">
<TipSourceIcon v-if="item.source" :source="item.source" />
<p
class="text-base font-medium"
:class="{ 'opacity-80': item.private }"
>
{{ item.private ? $t("private.title") : item.name }}
</p>
</div>
<UTooltip
v-if="disappearText"
:popper="{ placement: 'top' }"
+10 -4
View File
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { ContentLink, LiveStream } from "~/types";
import type { ContentLink, LiveStream, TipGoal } from "~/types";
const props = withDefaults(
defineProps<{
@@ -12,6 +12,7 @@ const props = withDefaults(
streamerId?: string;
superDmActive?: boolean;
bio?: string;
tipGoal?: TipGoal;
}>(),
{
showTitle: true,
@@ -25,6 +26,7 @@ const { liveStream, livePlatforms } = useLiveStreamPlayer(
const showLogo = computed(() => !liveStream.value);
const verified = computed(() => props.links?.some((l) => l.verification));
const tipGoalActive = computed(() => props.tipGoal?.isActive);
</script>
<template>
@@ -33,7 +35,7 @@ const verified = computed(() => props.links?.some((l) => l.verification));
<div v-else class="banner-container">
<GeneralImage variant="banner" :url="bannerUrl" class="banner" />
</div>
<div class="options gap-4">
<div :class="['options gap-4', { 'flex-col md:flex-row': tipGoalActive }]">
<div class="logo-and-name">
<div class="flex flex-col items-center ms-4">
<GeneralImage
@@ -62,7 +64,7 @@ const verified = computed(() => props.links?.some((l) => l.verification));
<div class="flex items-center gap-1">
<span class="text-lg lg:text-2xl font-bold">{{ name }}</span>
<VerifiedBadge :links="links" />
<div v-if="bio" class="md:hidden">
<div v-if="bio" :class="[{ 'md:hidden': !tipGoalActive }]">
<StreamerBio :bio="bio" />
</div>
</div>
@@ -74,7 +76,11 @@ const verified = computed(() => props.links?.some((l) => l.verification));
/>
</div>
</div>
<div v-if="bio" class="bio hidden md:block">
<div v-if="tipGoalActive" class="tip-goal w-full md:max-w-[380px]">
<TipGoal :path="streamerId" :tipGoal="tipGoal" class="w-full" />
</div>
<div v-else-if="bio" class="bio hidden md:block">
<p class="text-pale text-sm max-w-[400px]">
{{ bio }}
</p>
@@ -21,6 +21,7 @@ const {
toStreamerCohostPage,
toStreamerPageTiers,
toStreamerSuperDms,
toStreamerTipGoal,
} = useRouteLocation();
const items = computed(() => {
@@ -112,6 +113,11 @@ const items = computed(() => {
icon: "i-heroicons-chat-bubble-left-right",
to: toStreamerSuperDms(),
},
{
label: "Tip Goal",
icon: "i-tabler-progress",
to: toStreamerTipGoal(),
},
{
label: "Notifications",
icon: "i-heroicons-bell",
@@ -9,7 +9,12 @@ import type {
TipReply,
TipReplySettings,
} from "~/types";
import { FiatEnum, PageSettingKey, TipDisplayMode } from "~/types/enums";
import {
FiatEnum,
PageSettingKey,
TipDisplayMode,
TipSourceEnum,
} from "~/types/enums";
const props = withDefaults(
defineProps<{
@@ -352,11 +357,14 @@ const handleDelete = async (tipReply: TipReply) => {
</template>
<template #name-data="{ row }">
<div v-if="row.private && !showPrivateNameAndMessage">
<p class="text-pale">{{ t("private.title") }}</p>
</div>
<div v-else class="break-words max-w-[8rem]">
{{ row.name }}
<div class="flex items-center gap-1">
<TipSourceIcon v-if="row.source" :source="row.source" />
<div v-if="row.private && !showPrivateNameAndMessage">
<p class="text-pale">{{ t("private.title") }}</p>
</div>
<div v-else class="break-words max-w-[8rem]">
{{ row.name }}
</div>
</div>
</template>
<template #message-data="{ row }">
@@ -0,0 +1,24 @@
<script setup lang="ts">
import type { TipSourceEnum } from "~/types/enums";
const props = defineProps<{
source?: TipSourceEnum;
}>();
const { getTipSource } = useConstants();
const item = computed(() =>
props.source ? getTipSource(props.source) : undefined,
);
const text = computed(() =>
item.value ? `Tip from ${item.value.name}` : undefined,
);
</script>
<template>
<UTooltip :text="text" :popper="{ placement: 'top' }">
<img v-if="item?.icon" :src="item.icon" class="w-4 h-4" />
</UTooltip>
</template>
<style scoped></style>
+45 -2
View File
@@ -7,6 +7,7 @@ import {
MoneroNetworkTypeEnum,
NotificationChannelEnum,
NotificationPreferenceType,
TipSourceEnum,
} from "~/types/enums";
export const useConstants = () => {
@@ -186,8 +187,24 @@ export const useConstants = () => {
colorClassName: "",
iconClassName: "",
icon: "i-tabler-brand-github",
inputLabel: t("xUsername", { platform: "GitHub" }),
linkCreator: (v?: string) => `https://github.com/${v}`,
inputLabel: "GitHub link (enter full URL)",
linkCreator: (v?: string) => `${v}`,
},
[ContentLinkPlatformEnum.GITLAB]: {
name: "GitLab",
colorClassName: "text-[#FC6D26]",
iconClassName: "",
icon: "i-tabler-brand-gitlab",
inputLabel: "GitLab link (enter full URL)",
linkCreator: (v?: string) => `${v}`,
},
[ContentLinkPlatformEnum.MATRIX]: {
name: "Matrix",
colorClassName: "text-[#0DBD8B]",
iconClassName: "",
icon: "i-simple-icons-element",
inputLabel: "Matrix ID (for example @user:matrix.org)",
linkCreator: (v?: string) => `https://matrix.to/#/${v}`,
},
[ContentLinkPlatformEnum.MONERO_JOBS]: {
name: "Monero Jobs",
@@ -205,6 +222,14 @@ export const useConstants = () => {
inputLabel: t("xUsername", { platform: "Facebook" }),
linkCreator: (v?: string) => `https://facebook.com/${v}`,
},
[ContentLinkPlatformEnum.PIXELFED]: {
name: "Pixelfed",
colorClassName: "text-[#6364FF]",
iconClassName: "",
icon: "i-icon-pixelfed",
inputLabel: "Pixelfed link (enter full URL)",
linkCreator: (v?: string) => `${v}`,
},
};
const getContentLink = (v: ContentLinkPlatformEnum) => {
return CONTENT_LINKS[v];
@@ -389,6 +414,22 @@ export const useConstants = () => {
return NETWORK_CONFIGS[v];
};
const TIP_SOURCES = {
[TipSourceEnum.XMRCHAT]: {
name: "XMRChat",
icon: "",
},
[TipSourceEnum.XMRPOD]: {
name: "XMRPod",
icon: "/images/xmrpod.png",
},
};
const getTipSource = (v?: TipSourceEnum) => {
if (!v) return undefined;
return TIP_SOURCES[v];
};
return {
getContentLink,
CONTENT_LINKS,
@@ -406,5 +447,7 @@ export const useConstants = () => {
getPageTierColor,
NETWORK_CONFIGS,
getNetworkConfig,
TIP_SOURCES,
getTipSource,
};
};
+4
View File
@@ -52,5 +52,9 @@ export const useRouteLocation = () => {
localeRoute(`/${streamerId}/super-dm`),
toSuperDm: (streamerId: Numberic, superDmId: Numberic) =>
localeRoute(`/${streamerId}/super-dm/${superDmId}`),
toStreamerTipGoal: () => localeRoute("/streamer/tip-goal"),
toCreateStreamerTipGoal: () => localeRoute("/streamer/tip-goal/create"),
toEditStreamerTipGoal: () => localeRoute(`/streamer/tip-goal/edit`),
};
};
+12
View File
@@ -132,6 +132,17 @@ export const useValidations = (generalV?: Ref<Validation>) => {
notStartingWithAtBase
);
const matrixIdBase = (v: any) => {
if (!v) return true;
if (typeof v !== "string") return false;
return /^@[^\s:]+:[^\s:]+$/.test(v.trim());
};
const matrixId = helpers.withMessage(
"Enter a Matrix ID like @user:matrix.org.",
matrixIdBase
);
const getValidationAttrs = (path: string, v?: MaybeRef<Validation>) => {
v = unref(v || generalV);
const instance = getProperty(v, path);
@@ -172,6 +183,7 @@ export const useValidations = (generalV?: Ref<Validation>) => {
moneroPrimaryAddress,
rumbleApiUrl,
notStartingWithAt,
matrixId,
getValidationAttrs,
validate,
};
+1 -1
View File
@@ -322,7 +322,7 @@ export default {
kunoFundraiser: "Kuno fundraiser",
rumbleLiveStreamApi: "Rumble live stream API",
rumbleLiveStreamApiHelp:
"Rumble live stream API from {guide}. XMRChat uses this URL for getting current live streams of your channel.",
"Rumble live stream API from {guide}. XMRChat uses this URL to feature your livestream on our homepage.",
thisGuide: "this guide",
// OBS
+1 -1
View File
@@ -101,7 +101,7 @@ export default defineNuxtConfig({
},
dayjs: {
plugins: ["localizedFormat"],
plugins: ["localizedFormat", "minMax"],
locales: ["en", "fr", "es", "de", "ru", "fi", "ko", "ar"],
},
+1
View File
@@ -85,6 +85,7 @@ useStreamerIdSeoMeta(computed(() => data.value?.page));
:superDmActive="data.superDmState.active"
:streamerId="streamerId"
:bio="data.page.bio"
:tipGoal="data.page.tipGoal"
/>
<TipContent
ref="contentRef"
+13 -1
View File
@@ -18,7 +18,8 @@ interface State {
}
const { getMyLinks: getMyLinksReq, updateLinks } = useServices();
const { url, notUrl, rumbleApiUrl, notStartingWithAt } = useValidations();
const { url, notUrl, rumbleApiUrl, notStartingWithAt, matrixId } =
useValidations();
const toast = useToast();
const { getContentLink } = useConstants();
const { t } = useI18n();
@@ -67,8 +68,11 @@ const state = reactive<State>({
patreon: {},
subscribestar: {},
github: {},
gitlab: {},
matrix: {},
"monero-jobs": {},
facebook: {},
pixelfed: {},
},
name: undefined,
searchTerms: undefined,
@@ -114,7 +118,11 @@ const rules = computed(() => {
DISCORD,
PATREON,
SUBSCRIBESTAR,
GITHUB,
GITLAB,
MATRIX,
MONERO_JOBS,
PIXELFED,
...rest
} = ContentLinkPlatformEnum;
@@ -141,7 +149,11 @@ const rules = computed(() => {
[DISCORD]: { value: { url } },
[PATREON]: { value: { url } },
[SUBSCRIBESTAR]: { value: { url } },
[GITHUB]: { value: { url } },
[GITLAB]: { value: { url } },
[MATRIX]: { value: { matrixId } },
[MONERO_JOBS]: { value: { url } },
[PIXELFED]: { value: { url } },
...notUrls,
},
rumbleLiveStreamUrl: { url, rumbleApiUrl },
@@ -0,0 +1,7 @@
<script setup lang="ts"></script>
<template>
<div>Page: streamer/tip-goal/create</div>
</template>
<style scoped></style>
+13
View File
@@ -0,0 +1,13 @@
<script setup lang="ts"></script>
<template>
<div>
<PageTitle
:title="$t('editTipGoal')"
:description="$t('editTipGoalDetails')"
/>
<TipGoalModifyForm editable />
</div>
</template>
<style scoped></style>
+44
View File
@@ -0,0 +1,44 @@
<script setup lang="ts">
import type { TipGoal } from "~/types";
const { axios } = useApp();
const { data, pending, error, refresh } = useLazyAsyncData(
async () => {
const { data } = await axios.get<{ tipGoal: TipGoal[] }>(`/tip-goals`);
return data.tipGoal;
},
{
server: false,
},
);
</script>
<template>
<div>
<PageTitle title="Tip Goal" description="Manage your tip goal" />
<div v-if="pending" class="flex flex-col gap-4 w-full max-w-[600px] m-auto">
<USkeleton class="h-4 w-16" />
<USkeleton class="h-10 w-full" />
<USkeleton class="h-4 w-24" />
<USkeleton class="h-10 w-full" />
<USkeleton class="h-4 w-12" />
<USkeleton class="h-10 w-full" />
<USkeleton class="h-4 w-10" />
<USkeleton class="h-10 w-full" />
<USkeleton class="h-4 w-20" />
<USkeleton class="h-20 w-full" />
<USkeleton class="h-10 w-24 mt-4" />
</div>
<div v-else-if="error">{{ error }}</div>
<div v-else-if="data">
<TipGoalModifyForm editable @update="refresh" />
</div>
<div v-else>
<TipGoalModifyForm @update="refresh" />
</div>
</div>
</template>
<style scoped></style>
Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

+8
View File
@@ -44,8 +44,11 @@ export enum ContentLinkPlatformEnum {
PATREON = "patreon",
SUBSCRIBESTAR = "subscribestar",
GITHUB = "github",
GITLAB = "gitlab",
MATRIX = "matrix",
MONERO_JOBS = "monero-jobs",
FACEBOOK = "facebook",
PIXELFED = "pixelfed",
}
export enum TipDisplayMode {
@@ -132,3 +135,8 @@ export enum MoneroNetworkTypeEnum {
STAGENET = "stagenet",
STRESSNET = "stressnet",
}
export enum TipSourceEnum {
XMRCHAT = "xmrchat",
XMRPOD = "xmrpod",
}
+13
View File
@@ -13,6 +13,7 @@ import type {
LiveStreamPlatformEnum,
CohostInvitationStatusEnum,
SuperDmMessageSenderTypeEnum,
TipSourceEnum,
} from "./enums";
export type Numberic = string | number;
@@ -115,6 +116,7 @@ export interface StreamerPage {
ability?: any;
bio?: string;
searchTerms?: string;
tipGoal?: TipGoal;
}
interface TipPayment {
@@ -138,6 +140,7 @@ export interface Tip {
createdAt?: string;
pageTipTier?: PageTipTier;
tipReplies?: TipReply[];
source?: TipSourceEnum;
}
export interface TipTier {
@@ -377,3 +380,13 @@ export interface TipReplySettings {
backgroundColor?: string;
textColor?: string;
}
export interface TipGoal {
id: number;
name: string;
amount: string;
startTime: string;
endTime?: string;
description?: string;
isActive: boolean;
}
+4 -1
View File
@@ -13,7 +13,6 @@ export const CONTENT_LINKS_LIST = [
ContentLinkPlatformEnum.INSTAGRAM,
ContentLinkPlatformEnum.WEBSITE,
ContentLinkPlatformEnum.YOUTUBE,
ContentLinkPlatformEnum.RUMBLE,
ContentLinkPlatformEnum.TWITCH,
ContentLinkPlatformEnum.TIKTOK,
ContentLinkPlatformEnum.ODYSEE,
@@ -27,8 +26,12 @@ export const CONTENT_LINKS_LIST = [
ContentLinkPlatformEnum.PATREON,
ContentLinkPlatformEnum.SUBSCRIBESTAR,
ContentLinkPlatformEnum.GITHUB,
ContentLinkPlatformEnum.GITLAB,
ContentLinkPlatformEnum.MATRIX,
ContentLinkPlatformEnum.MONERO_JOBS,
ContentLinkPlatformEnum.FACEBOOK,
ContentLinkPlatformEnum.PIXELFED,
ContentLinkPlatformEnum.RUMBLE,
];
export const SWAP_STATUSES = {
+3
View File
@@ -49,6 +49,9 @@ ADMIN_MONERO_PRIVATE_VIEW_KEY=
# Page report emails separated by space
PAGE_REPORT_RECEPIENTS=[email protected] [email protected]
# Failed report emails separated by space
FAILED_REPORT_RECEPIENTS=[email protected] [email protected]
# LWS_WEBHOOK_URL=http://localhost:3000/lws/webhooks
# LWS calls this url for sending the transaction info.
@@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class AddTipGoal1783357939402 implements MigrationInterface {
name = 'AddTipGoal1783357939402'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "tip_goals" ("id" SERIAL NOT NULL, "name" character varying NOT NULL, "amount" bigint NOT NULL, "start_time" TIMESTAMP WITH TIME ZONE NOT NULL, "end_time" TIMESTAMP WITH TIME ZONE, "description" character varying, "is_active" boolean NOT NULL DEFAULT true, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "page_id" integer, CONSTRAINT "REL_e8ae4db6c6d4040b55f56b8a7c" UNIQUE ("page_id"), CONSTRAINT "PK_630b0d15cb06f113aa295fa32b0" PRIMARY KEY ("id"))`);
await queryRunner.query(`ALTER TABLE "tip_goals" ADD CONSTRAINT "FK_e8ae4db6c6d4040b55f56b8a7ce" FOREIGN KEY ("page_id") REFERENCES "pages"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "tip_goals" DROP CONSTRAINT "FK_e8ae4db6c6d4040b55f56b8a7ce"`);
await queryRunner.query(`DROP TABLE "tip_goals"`);
}
}
@@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class AddTipSource1785958846556 implements MigrationInterface {
name = 'AddTipSource1785958846556'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "tips" ADD "source" character varying`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "tips" DROP COLUMN "source"`);
}
}
+2
View File
@@ -59,6 +59,7 @@ import { OfferingsModule } from './offerings/offerings.module';
import { EntitlementsModule } from './entitlements/entitlements.module';
import { TipsBroadcastModule } from './tips-broadcast/tips-broadcast.module';
import { TipRepliesModule } from './tip-replies/tip-replies.module';
import { TipGoalsModule } from './tip-goals/tip-goals.module';
@Module({
imports: [
@@ -191,6 +192,7 @@ import { TipRepliesModule } from './tip-replies/tip-replies.module';
EntitlementsModule,
TipsBroadcastModule,
TipRepliesModule,
TipGoalsModule,
],
controllers: [AppController],
providers: [AppService, IsMoneroPrimaryAdrress],
+4 -1
View File
@@ -14,6 +14,7 @@ import { PageTipTier } from 'src/page-tip-tiers/page-tip-tier.entity';
import { Page } from 'src/pages/page.entity';
import { Action, PageSettingKey, RolesEnum } from 'src/shared/constants/enum';
import { SuperDm } from 'src/super-dms/super-dm.entity';
import { TipGoal } from 'src/tip-goals/tip-goal.entity';
import { TipReply } from 'src/tip-replies/tip-reply.entity';
import { Tip } from 'src/tips/tip.entity';
import { User } from 'src/users/user.entity';
@@ -28,6 +29,7 @@ type Subjects =
| typeof PageSetting
| typeof PageTipTier
| typeof TipReply
| typeof TipGoal
>
| 'notification'
| 'cohost'
@@ -68,6 +70,7 @@ export class CaslAbilityFactory {
// TIP REPLY ACTIONS
can(Action.Manage, TipReply, { 'tip.pageId': pageResult?.id } as any);
can(Action.Manage, TipGoal, { pageId: pageResult?.id });
}
// OBS ACTIONS
@@ -96,7 +99,7 @@ export class CaslAbilityFactory {
// TIPS ACTIONS
can(Action.MakeTipPrivate, Page, { userId: user.id });
can(Action.MakeTipPublic, Page, { userId: user.id });
// can(Action.MakeTipPublic, Page, { userId: user.id });
// Only make private if cohost
can(Action.MakeTipPrivate, Page, { id: user.cohostPageId });
@@ -3,6 +3,7 @@ import { Command, CommandRunner } from 'nest-commander';
import { TwitchTokenService } from 'src/integrations/twitch/twitch-token.service';
import { LinkVerificationsService } from 'src/link-verifications/link-verifications.service';
import { LiveStreamsService } from 'src/live-streams/live-streams.service';
import { NotificationTestsService } from 'src/notifications/notification-tests.service';
@Command({
name: 'config',
@@ -16,6 +17,7 @@ export class ConfigCommand extends CommandRunner {
private twitchTokenService: TwitchTokenService,
private liveStreamsService: LiveStreamsService,
private linkVerificationsService: LinkVerificationsService,
private notificationTestsService: NotificationTestsService,
) {
super();
}
@@ -53,6 +55,11 @@ export class ConfigCommand extends CommandRunner {
return;
}
if (config === 'test-simplex') {
await this.testSimplex();
return;
}
this.logger.error(`Parameter is invalid: ${config}`);
}
@@ -86,4 +93,9 @@ export class ConfigCommand extends CommandRunner {
this.logger.log('validating link verifications');
await this.linkVerificationsService.validateAll();
}
async testSimplex() {
this.logger.log('Testing Simplex');
await this.notificationTestsService.testSimplex();
}
}
+2
View File
@@ -23,6 +23,7 @@ import { User } from 'src/users/user.entity';
import { SnakeNamingStrategy } from 'typeorm-naming-strategies';
import { LinkVerification } from 'src/link-verifications/link-verification.entity';
import { TipReply } from 'src/tip-replies/tip-reply.entity';
import { TipGoal } from 'src/tip-goals/tip-goal.entity';
@Module({
imports: [
@@ -56,6 +57,7 @@ import { TipReply } from 'src/tip-replies/tip-reply.entity';
SuperDmMessage,
LinkVerification,
TipReply,
TipGoal,
],
namingStrategy: new SnakeNamingStrategy(),
migrationsRun: process.env.NODE_ENV === 'production',
@@ -1,4 +1,5 @@
import { HttpService } from '@nestjs/axios';
import { InjectQueue } from '@nestjs/bullmq';
import { CACHE_MANAGER } from '@nestjs/cache-manager';
import {
Inject,
@@ -9,6 +10,7 @@ import {
} from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { Cron, CronExpression } from '@nestjs/schedule';
import { Queue } from 'bullmq';
import { Cache } from 'cache-manager';
import { getErrorMessage } from 'src/shared/utils/errors';
@@ -20,6 +22,7 @@ export class TwitchTokenService implements OnModuleInit {
private readonly httpService: HttpService,
private readonly configService: ConfigService,
@Inject(CACHE_MANAGER) private cacheManager: Cache,
@InjectQueue('notifications-email') private emailQueue: Queue,
) {}
async onModuleInit() {
@@ -123,4 +126,38 @@ export class TwitchTokenService implements OnModuleInit {
this.logger.error('Failed to refresh twitch client credentials token');
}
}
@Cron(CronExpression.EVERY_DAY_AT_NOON)
async upsertTokenRefreshReminder() {
const token = this.configService.get('TWITCH_OAUTH_PASS')?.split(':')[1];
if (!token) return;
const { data } = await this.httpService.axiosRef.get(
'https://id.twitch.tv/oauth2/validate',
{
headers: {
Authorization: `OAuth ${token}`,
},
},
);
const expiresIn = data.expires_in;
// Return if it is valid for more than 1 weeks
if (expiresIn > 14 * 24 * 60 * 60) return;
const emails =
this.configService.get('PAGE_REPORT_RECEPIENTS')?.split(' ') || [];
if (!emails.length) return;
this.emailQueue.add('send-email', {
to: emails,
options: {
subject: 'Twitch token update reminder',
text: 'Twitch token update reminder',
html: `Twitch token update reminder. Less that one week is remaining from expiration date, please update the token and get a new User access token token.
You can use this website "https://twitchapps.com/tokengen" to generate a new User access token token.`,
},
});
}
}
@@ -2,9 +2,10 @@ import { Module } from '@nestjs/common';
import { TwitchService } from './twitch.service';
import { HttpModule } from '@nestjs/axios';
import { TwitchTokenService } from './twitch-token.service';
import { QueuesModule } from 'src/queues/queues.module';
@Module({
imports: [HttpModule.register({})],
imports: [HttpModule.register({}), QueuesModule],
providers: [TwitchService, TwitchTokenService],
exports: [TwitchService, TwitchTokenService],
})
@@ -8,7 +8,7 @@ import {
import { ConfigService } from '@nestjs/config';
import { Client, client as tmiClient } from 'tmi.js';
import { TwitchTokenService } from './twitch-token.service';
import { getAxiosMessage } from 'src/shared/utils/errors';
import { getAxiosMessage, getErrorMessage } from 'src/shared/utils/errors';
@Injectable()
export class TwitchService implements OnModuleInit {
@@ -94,11 +94,11 @@ export class TwitchService implements OnModuleInit {
} catch (error) {
console.log(
'Twitch api error on getting channel name',
error.response?.data,
getErrorMessage(error),
);
if (
error?.response?.data?.status === 403 ||
error?.response?.data?.status === 401
(error as any)?.response?.data?.status === 403 ||
(error as any)?.response?.data?.status === 401
)
return true;
return false;
@@ -48,12 +48,13 @@ export class LiveStreamsService implements OnModuleInit {
}
async findAll() {
return this.repo
const streams = await this.repo
.createQueryBuilder('liveStream')
.leftJoinAndSelect('liveStream.page', 'page')
.leftJoinAndSelect('page.logo', 'logo')
.distinctOn(['page.id'])
.orderBy('page.id', 'ASC')
.addOrderBy('liveStream.startedAt', 'DESC', 'NULLS LAST')
.addOrderBy(
`CASE
WHEN liveStream.platform = '${LiveStreamPlatformEnum.TWITCH}' THEN 1
@@ -66,6 +67,10 @@ export class LiveStreamsService implements OnModuleInit {
'ASC',
)
.getMany();
return streams.sort((a, b) => {
return (b.startedAt?.getTime() || 0) - (a.startedAt?.getTime() || 0);
});
}
async updateLiveStreams(dto: CreateLiveStreamDto[]) {
@@ -0,0 +1,28 @@
import { InjectQueue } from '@nestjs/bullmq';
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { Job, Queue } from 'bullmq';
@Injectable()
export class NotificationFailureService {
constructor(
@InjectQueue('notifications-email') private emailQueue: Queue,
private configService: ConfigService,
) {}
async sendFailureNotification(job: Job, error: Error, provider: string) {
const emails =
this.configService.get('FAILED_REPORT_RECEPIENTS') ||
this.configService.get('PAGE_REPORT_RECEPIENTS');
const emailList = emails.split(' ') || [];
if (!emailList.length) return;
await this.emailQueue.add('send-email', {
to: emailList,
options: {
subject: `${provider} failed to send`,
html: `${provider} failed to send. ${JSON.stringify(job.data)}, Error: ${error.message}`,
},
});
}
}
@@ -20,4 +20,11 @@ export class NotificationTestsService {
message: 'Test message for signal',
});
}
async testSimplex() {
await this.simplexQueue.add('send-message', {
contactId: 1,
message: 'Test message for simplex',
});
}
}
@@ -2,9 +2,11 @@ import { Module } from '@nestjs/common';
import { SignalService } from './signal.service';
import { SignalModule as SignalIntegrationModule } from 'src/integrations/signal/signal.module';
import { SignalProcessor } from './signal.processor';
import { NotificationFailureService } from '../notification-failure.service';
import { QueuesModule } from 'src/queues/queues.module';
@Module({
imports: [SignalIntegrationModule],
providers: [SignalService, SignalProcessor],
imports: [SignalIntegrationModule, QueuesModule],
providers: [SignalService, SignalProcessor, NotificationFailureService],
})
export class SignalModule {}
@@ -1,10 +1,14 @@
import { Processor, WorkerHost } from '@nestjs/bullmq';
import { OnWorkerEvent, Processor, WorkerHost } from '@nestjs/bullmq';
import { SignalService } from './signal.service';
import { Job } from 'bullmq';
import { NotificationFailureService } from '../notification-failure.service';
@Processor('notifications-signal')
export class SignalProcessor extends WorkerHost {
constructor(private readonly signalService: SignalService) {
constructor(
private readonly signalService: SignalService,
private readonly notificationFailureService: NotificationFailureService,
) {
super();
}
@@ -15,4 +19,13 @@ export class SignalProcessor extends WorkerHost {
await this.signalService.sendMessage(data.account, data.message);
}
}
@OnWorkerEvent('failed')
async handleError(job: Job, error: Error) {
await this.notificationFailureService.sendFailureNotification(
job,
error,
'Signal',
);
}
}
@@ -2,9 +2,11 @@ import { Module } from '@nestjs/common';
import { SimplexService } from './simplex.service';
import { SimplexModule as SimplexIntegrationModule } from 'src/integrations/simplex/simplex.module';
import { SimplexProcessor } from './simplex.processor';
import { NotificationFailureService } from '../notification-failure.service';
import { QueuesModule } from 'src/queues/queues.module';
@Module({
imports: [SimplexIntegrationModule],
providers: [SimplexService, SimplexProcessor],
imports: [SimplexIntegrationModule, QueuesModule],
providers: [SimplexService, SimplexProcessor, NotificationFailureService],
})
export class SimplexModule {}
@@ -1,10 +1,14 @@
import { Processor, WorkerHost } from '@nestjs/bullmq';
import { OnWorkerEvent, Processor, WorkerHost } from '@nestjs/bullmq';
import { SimplexService } from './simplex.service';
import { Job } from 'bullmq';
import { NotificationFailureService } from '../notification-failure.service';
@Processor('notifications-simplex')
export class SimplexProcessor extends WorkerHost {
constructor(private readonly simplexService: SimplexService) {
constructor(
private readonly simplexService: SimplexService,
private readonly notificationFailureService: NotificationFailureService,
) {
super();
}
@@ -15,4 +19,13 @@ export class SimplexProcessor extends WorkerHost {
await this.simplexService.sendMessage(data.contactId, data.message);
}
}
@OnWorkerEvent('failed')
async handleError(job: Job, error: Error) {
await this.notificationFailureService.sendFailureNotification(
job,
error,
'Simplex',
);
}
}
+5
View File
@@ -5,6 +5,7 @@ import { MoneroUtils } from 'monero-ts';
import { LinkDto } from 'src/links/dto/link.dto';
import { LiveStreamDto } from 'src/live-streams/dtos/live-stream.dto';
import { PageTipTierDto } from 'src/page-tip-tiers/dtos/page-tip-tier.dto';
import { TipGoalDto } from 'src/tip-goals/dtos/tip-goal.dto';
export class PageDto {
@Expose()
@@ -67,6 +68,10 @@ export class PageDto {
@Expose()
bio: string;
@Expose()
@Type(() => TipGoalDto)
tipGoal: TipGoalDto;
@Expose()
ability?: any;
}
+4
View File
@@ -22,6 +22,7 @@ import { PageStatusEnum } from '../shared/constants';
import { PageRecipient } from 'src/page-recipients/page-recipient.entity';
import { LiveStream } from '../live-streams/live-stream.entity';
import { PageTipTier } from 'src/page-tip-tiers/page-tip-tier.entity';
import { TipGoal } from 'src/tip-goals/tip-goal.entity';
@Entity({ name: 'pages' })
@Unique(['path'])
@@ -134,6 +135,9 @@ export class Page {
@OneToMany(() => User, (u: User) => u.cohostPage)
cohosts: User[];
@OneToOne(() => TipGoal, (t: TipGoal) => t.page)
tipGoal: TipGoal;
totalTips: number | null;
tipsCount: number | null;
}
+4 -1
View File
@@ -48,8 +48,11 @@ export class PagesController {
const slug = query.search;
const offset = query.offset;
const limit = query.limit;
const hasLinks = query.hasLinks
? [].concat(query.hasLinks).filter(Boolean)
: undefined;
return this.pagesService.searchPages(slug, offset, limit);
return this.pagesService.searchPages(slug, offset, limit, hasLinks);
}
@Get('/sitemap')
+21 -1
View File
@@ -48,7 +48,12 @@ export class PagesService {
private auditsService: AuditsService,
) {}
async searchPages(slug: string = '', offset: number = 0, limit: number = 8) {
async searchPages(
slug: string = '',
offset: number = 0,
limit: number = 8,
hasLinks?: string[],
) {
const tipsSubQuery = (qb: SelectQueryBuilder<any>) =>
qb
.select('tip.page_id', 'page_id')
@@ -120,6 +125,20 @@ export class PagesService {
);
}
if (hasLinks?.length) {
idsQuery = idsQuery.innerJoin(
(qb) =>
qb
.select('link.page_id', 'page_id')
.from('links', 'link')
.where('link.platform IN (:...hasLinks)', { hasLinks })
.andWhere("link.value IS NOT NULL AND TRIM(link.value) != ''")
.distinctOn(['link.page_id']),
'has_link',
'has_link.page_id = page.id',
);
}
// Get total count before applying offset/limit
const total = await idsQuery.getCount();
@@ -313,6 +332,7 @@ export class PagesService {
liveStreams: true,
pageTipTiers: { sound: true },
user: true,
tipGoal: true,
},
order: {
pageTipTiers: { minAmount: { direction: 'ASC', nulls: 'LAST' } },
+8
View File
@@ -81,8 +81,11 @@ export enum LinkPlatformEnum {
PATREON = 'patreon',
SUBSCRIBESTAR = 'subscribestar',
GITHUB = 'github',
GITLAB = 'gitlab',
MATRIX = 'matrix',
MONERO_JOBS = 'monero-jobs',
FACEBOOK = 'facebook',
PIXELFED = 'pixelfed',
}
export enum TrocadorStatusEnum {
@@ -190,3 +193,8 @@ export enum SuperDmMessageSenderType {
export enum PageVerificationTypeEnum {
X = 'x',
}
export enum TipSourceEnum {
XMRCHAT = 'xmrchat',
XMRPOD = 'xmrpod',
}
@@ -0,0 +1,42 @@
import { Transform } from 'class-transformer';
import {
IsBoolean,
IsDateString,
IsNumberString,
IsOptional,
IsString,
MaxLength,
} from 'class-validator';
import { MoneroUtils } from 'monero-ts';
export class CreateTipGoalDto {
@IsString()
@MaxLength(80)
name: string;
@IsNumberString()
@Transform(
({ value }) => {
if (value === null || value === '') return null;
return MoneroUtils.xmrToAtomicUnits(value).toString();
},
{ toClassOnly: true },
)
amount?: string;
@IsDateString()
startTime: string;
@IsDateString()
@IsOptional()
endTime?: string;
@IsString()
@IsOptional()
@MaxLength(255)
description?: string;
@IsBoolean()
@IsOptional()
isActive?: boolean;
}
@@ -0,0 +1,13 @@
import { Expose, Transform, Type } from 'class-transformer';
import { TipGoalDto } from './tip-goal.dto';
import { MoneroUtils } from 'monero-ts';
export class TipGoalAmountRO {
@Expose()
@Transform(({ value }) => value && MoneroUtils.atomicUnitsToXmr(value))
tipsAmount: string;
@Expose()
@Type(() => TipGoalDto)
tipGoal: TipGoalDto;
}
+29
View File
@@ -0,0 +1,29 @@
import { Expose, Transform, Type } from 'class-transformer';
import { MoneroUtils } from 'monero-ts';
export class TipGoalDto {
@Expose()
name: string;
@Expose()
@Transform(({ value }) => value && MoneroUtils.atomicUnitsToXmr(value))
amount: string;
@Expose()
startTime: Date;
@Expose()
endTime?: Date;
@Expose()
description?: string;
@Expose()
isActive: boolean;
}
export class TipGoalRO {
@Expose()
@Type(() => TipGoalDto)
tipGoal: TipGoalDto;
}
@@ -0,0 +1,3 @@
import { CreateTipGoalDto } from './create-tip-goal.dto';
export class UpdateTipGoalDto extends CreateTipGoalDto {}
+48
View File
@@ -0,0 +1,48 @@
import { Page } from 'src/pages/page.entity';
import {
Column,
CreateDateColumn,
Entity,
JoinColumn,
OneToOne,
PrimaryGeneratedColumn,
RelationId,
UpdateDateColumn,
} from 'typeorm';
@Entity({ name: 'tip_goals' })
export class TipGoal {
@PrimaryGeneratedColumn()
id: number;
@Column()
name: string;
@Column({ type: 'bigint' })
amount?: string;
@Column({ type: 'timestamptz' })
startTime: Date;
@Column({ type: 'timestamptz', nullable: true })
endTime?: Date;
@Column({ nullable: true })
description?: string;
@Column({ type: 'boolean', default: true })
isActive: boolean;
@OneToOne(() => Page, { onDelete: 'CASCADE' })
@JoinColumn()
page: Page;
@RelationId((tg: TipGoal) => tg.page)
pageId: number;
@CreateDateColumn({ type: 'timestamptz' })
createdAt: Date;
@UpdateDateColumn({ type: 'timestamptz' })
updatedAt: Date;
}
@@ -0,0 +1,52 @@
import { Body, Controller, Get, Param, Post, Put } from '@nestjs/common';
import { TipGoalsService } from './tip-goals.service';
import { CreateTipGoalDto } from './dtos/create-tip-goal.dto';
import { User } from 'src/users/user.entity';
import { CurrentUser } from 'src/shared/decorators/current-user.decorator';
import { Serialize } from 'src/shared/interceptors/serialize.interceptor';
import { TipGoalRO } from './dtos/tip-goal.dto';
import { UpdateTipGoalDto } from './dtos/update-tip-goal.dto';
import { IsPublic } from 'src/shared/decorators/is-public.decorator';
import { TipGoalAmountRO } from './dtos/tip-goal-amount.dto';
@Controller('tip-goals')
export class TipGoalsController {
constructor(private readonly tipGoalsService: TipGoalsService) {}
@Get('/')
@Serialize(TipGoalRO)
async find(@CurrentUser() user: User) {
const result = await this.tipGoalsService.findMyTipGoal(user);
return {
tipGoal: result,
};
}
@Get('/tips/:pagePath')
@Serialize(TipGoalAmountRO)
@IsPublic()
async findTipGoalAmount(@Param('pagePath') pagePath: string) {
const { tipsAmount, tipGoal } =
await this.tipGoalsService.findTipGoalAmount(pagePath);
return {
tipsAmount,
tipGoal,
};
}
@Post('/')
async create(@Body() dto: CreateTipGoalDto, @CurrentUser() user: User) {
await this.tipGoalsService.create(dto, user);
return {
message: 'Tip goal created successfully',
};
}
@Put('/')
async update(@Body() dto: UpdateTipGoalDto, @CurrentUser() user: User) {
await this.tipGoalsService.update(dto, user);
return {
message: 'Tip goal updated successfully',
};
}
}
+15
View File
@@ -0,0 +1,15 @@
import { Module } from '@nestjs/common';
import { TipGoalsService } from './tip-goals.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { TipGoal } from './tip-goal.entity';
import { PagesModule } from 'src/pages/pages.module';
import { TipGoalsController } from './tip-goals.controller';
import { TipsModule } from 'src/tips/tips.module';
@Module({
imports: [PagesModule, TipsModule, TypeOrmModule.forFeature([TipGoal])],
providers: [TipGoalsService],
exports: [TipGoalsService],
controllers: [TipGoalsController],
})
export class TipGoalsModule {}
+148
View File
@@ -0,0 +1,148 @@
import {
BadRequestException,
ForbiddenException,
Injectable,
NotFoundException,
} from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { TipGoal } from './tip-goal.entity';
import { Repository } from 'typeorm';
import { CreateTipGoalDto } from './dtos/create-tip-goal.dto';
import { CaslAbilityFactory } from 'src/casl/casl-ability.factory';
import { User } from 'src/users/user.entity';
import { Action } from 'src/shared/constants';
import { PagesService } from 'src/pages/pages.service';
import { UpdateTipGoalDto } from './dtos/update-tip-goal.dto';
import { TipsService } from 'src/tips/tips.service';
@Injectable()
export class TipGoalsService {
constructor(
private readonly pagesService: PagesService,
private readonly casl: CaslAbilityFactory,
private readonly tipsService: TipsService,
@InjectRepository(TipGoal)
private repo: Repository<TipGoal>,
) {}
async findOne(id: number) {
if (!id) throw new BadRequestException('Id is required');
const tipGoal = await this.repo.findOne({
where: { id },
});
if (!tipGoal) throw new NotFoundException('Tip goal not found');
return tipGoal;
}
async findMyTipGoal(user: User) {
const page = await this.pagesService.findMyPage(user);
if (!page) throw new NotFoundException('Page not found');
const tipGoal = await this.findOneByPageIdOptional(page.id);
return tipGoal;
}
async findOneByPageId(pageId: number) {
if (!pageId) throw new BadRequestException('Page id is required');
const tipGoal = await this.findOneByPageIdOptional(pageId);
if (!tipGoal) throw new NotFoundException('Tip goal not found');
return tipGoal;
}
async findOneByPageIdOptional(pageId: number) {
if (!pageId) throw new BadRequestException('Page id is required');
const tipGoal = await this.repo.findOne({
where: { page: { id: pageId } },
});
return tipGoal;
}
async create(dto: CreateTipGoalDto, user: User) {
const page = await this.pagesService.findMyPage(user);
if (!page) throw new NotFoundException('Page not found');
const ability = await this.casl.createForUser(user);
if (!ability.can(Action.Create, TipGoal))
throw new ForbiddenException(
'You are not authorized to create a tip goal',
);
const { isValid, message } = await this.validateDates({
startTime: new Date(dto.startTime),
endTime: dto.endTime && new Date(dto.endTime),
});
if (!isValid) throw new BadRequestException(message);
const created = this.repo.create({
...dto,
page,
});
const tipGoal = await this.repo.save(created);
return tipGoal;
}
async update(dto: UpdateTipGoalDto, user: User) {
const page = await this.pagesService.findMyPage(user);
if (!page) throw new NotFoundException('Page not found');
const ability = await this.casl.createForUser(user);
if (!ability.can(Action.Update, TipGoal))
throw new ForbiddenException(
'You are not authorized to update a tip goal',
);
const tipGoal = await this.findOneByPageId(page.id);
if (!tipGoal) throw new NotFoundException('Tip goal not found');
const { isValid, message } = await this.validateDates({
startTime: new Date(dto.startTime),
endTime: dto.endTime && new Date(dto.endTime),
});
if (!isValid) throw new BadRequestException(message);
Object.assign(tipGoal, dto);
const result = await this.repo.save(tipGoal);
return result;
}
async findTipGoalAmount(pagePath: string) {
const page = await this.pagesService.findByPath(pagePath);
if (!page) throw new NotFoundException('Page not found');
const tipGoal = await this.findOneByPageIdOptional(page.id);
if (!tipGoal) return { tipsAmount: 0, tipGoal: null };
const tipsAmount = await this.tipsService.getTipsInDateRange(
pagePath,
tipGoal.startTime.toISOString(),
tipGoal.endTime?.toISOString(),
);
return {
tipsAmount,
tipGoal,
};
}
// For create base time is now, for edit base time is min of now and start time
async validateDates({
startTime,
endTime,
}: {
startTime: Date;
endTime?: Date;
}) {
if (endTime && endTime < startTime)
return {
isValid: false,
message: 'End time should be a date after start time.',
};
return {
isValid: true,
};
}
}
+6
View File
@@ -1,11 +1,13 @@
import {
IsBoolean,
IsEnum,
IsNumber,
IsOptional,
IsString,
MaxLength,
MinLength,
} from 'class-validator';
import { TipSourceEnum } from 'src/shared/constants';
export class CreateTipDto {
@IsString()
@@ -30,4 +32,8 @@ export class CreateTipDto {
@IsOptional()
@IsNumber()
coinId?: number;
@IsOptional()
@IsEnum(TipSourceEnum)
source?: TipSourceEnum;
}
+4
View File
@@ -2,6 +2,7 @@ import { Expose, Type } from 'class-transformer';
import { SwapDto } from 'src/swaps/dtos/swap.dto';
import { BaseTipDto } from './base-tip.dto';
import { PageRecipientShareDto } from 'src/page-recipients/dtos/recipient.dto';
import { TipSourceEnum } from 'src/shared/constants';
export class TipDto extends BaseTipDto {}
@@ -27,6 +28,9 @@ export class TipDtoRO {
@Type(() => PageRecipientShareDto)
recipients: PageRecipientShareDto[];
@Expose()
source?: TipSourceEnum;
@Expose()
url?: string;
}
+4
View File
@@ -14,6 +14,7 @@ import {
OneToMany,
} from 'typeorm';
import { TipReply } from 'src/tip-replies/tip-reply.entity';
import { TipSourceEnum } from 'src/shared/constants';
@Entity({ name: 'tips' })
export class Tip {
@@ -41,6 +42,9 @@ export class Tip {
@Column({ type: 'boolean', default: false })
webhookDeleted: boolean;
@Column({ nullable: true })
source?: TipSourceEnum;
@ManyToOne(() => Page, { onDelete: 'CASCADE' })
@JoinColumn({ foreignKeyConstraintName: 'tips_page_id_fkey' })
page: Page;
+23 -1
View File
@@ -35,6 +35,7 @@ import { PageTipTier } from 'src/page-tip-tiers/page-tip-tier.entity';
import { getDefaultMessageLength, getTipTier } from 'src/shared/utils';
import { PaymentFlowService } from 'src/payment-flow/payment-flow.service';
import { TipsBroadcastGateway } from 'src/tips-broadcast/tips-broadcast.gateway';
import { getErrorMessage } from 'src/shared/utils/errors';
@Injectable()
export class TipsService {
@@ -86,6 +87,26 @@ export class TipsService {
return { tips, page };
}
async getTipsInDateRange(pagePath: string, start: string, end?: string) {
const page = await this.pagesService.findByPath(pagePath);
if (!page) throw new NotFoundException('Page not found');
const query = this.repo
.createQueryBuilder('tip')
.leftJoin('tip.payment', 'payment')
.select('SUM(COALESCE(payment.paid_amount::NUMERIC, 0))', 'totalAmount')
.where('tip.page_id = :pageId', { pageId: page.id })
.andWhere('payment.paid_at IS NOT NULL')
.andWhere('tip.created_at >= :start', { start });
if (end) {
query.andWhere('tip.created_at <= :end', { end });
}
const result = await query.getRawOne();
return result.totalAmount ?? '0';
}
async updateTip(id: number, payload: UpdateTipDto, user: User) {
const tip = await this.findOneById(id);
if (!tip) throw new NotFoundException('Tip not found');
@@ -206,6 +227,7 @@ export class TipsService {
expiresAt:
baseSwap?.details?.expiresAt || new Date(Date.now() + 60 * 60 * 1000),
page: { id: page.id },
source: payload.source,
});
const tip = await this.repo.save(createdTip);
@@ -397,7 +419,7 @@ export class TipsService {
await this.lwsService.deleteWebhook(eventIds);
} catch (error) {
this.logger.warn(
`Failed to delete webhook for tips: ${error?.message || error}`,
`Failed to delete webhook for tips: ${getErrorMessage(error)}`,
);
}