Changeset 62b899d in Klonkt
- Timestamp:
- 06/16/2026 07:02:15 PM (3 months ago)
- Branches:
- main
- Children:
- fb02cc0
- Parents:
- 682d504
- Location:
- src
- Files:
-
- 4 edited
-
routes/admin-circle.js (modified) (2 diffs)
-
services/CircleFederation.js (modified) (1 diff)
-
services/CircleService.js (modified) (1 diff)
-
views/pages/admin-circle.ejs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/admin-circle.js
r682d504 r62b899d 16 16 import db from '../config/database.js'; 17 17 import { getTenancy } from '../services/SettingsService.js'; 18 import { syncOne } from '../services/CircleService.js';18 import { syncOne, sync } from '../services/CircleService.js'; 19 19 20 20 const router = express.Router(); … … 95 95 }); 96 96 97 // Alles in één keer verversen (handig "voor de zekerheid"). 98 router.post('/sync-all', requireGod, async (req, res) => { 99 try { 100 const r = await sync(); 101 const n = (r && r.results) ? r.results.filter((x) => x && x.ok).length : 0; 102 res.redirect('/admin/circle?success=' + encodeURIComponent(`Cirkel gesynchroniseerd (${n} site(s) bijgewerkt)`)); 103 } catch (e) { 104 res.redirect('/admin/circle?error=' + encodeURIComponent(String((e && e.message) || e).slice(0, 200))); 105 } 106 }); 107 97 108 router.post('/allow', requireGod, (req, res) => { 98 109 const site = primarySite(); -
src/services/CircleFederation.js
r682d504 r62b899d 78 78 79 79 function stripHtml(s) { 80 return String(s || '').replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim(); 80 return String(s || '') 81 .replace(/<[^>]+>/g, ' ') 82 .replace(/\[\[[^\]]*\]\]/g, ' ') // [[playlist:..]]/[[track:..]]/[[album:..]]-shortcodes weg 83 .replace(/\s+/g, ' ') 84 .trim(); 81 85 } 82 86 -
src/services/CircleService.js
r682d504 r62b899d 14 14 15 15 function stripHtml(s) { 16 return String(s || '').replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim(); 16 return String(s || '') 17 .replace(/<[^>]+>/g, ' ') 18 .replace(/\[\[[^\]]*\]\]/g, ' ') // [[playlist:..]]/[[track:..]]/[[album:..]]-shortcodes weg 19 .replace(/\s+/g, ' ') 20 .trim(); 17 21 } 18 22 function iso(d) { -
src/views/pages/admin-circle.ejs
r682d504 r62b899d 52 52 <p class="set-help">Nog geen bronnen. Voeg er hierboven een toe.</p> 53 53 <% } else { %> 54 <form method="post" action="/admin/circle/sync-all" style="margin:0 0 .9rem"> 55 <button type="submit" class="btn">↻ Alles nu synchroniseren</button> 56 </form> 54 57 <ul class="circ-list"> 55 58 <% links.forEach(function(l){ %>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)