2 import { onMount } from 'svelte';
3 import { fetch_from_api, update_html_title } from '../lib/api_utils.js';
4 import { formatOSMType, osmLink } from '../lib/helpers.js';
6 import Header from '../components/Header.svelte';
11 fetch_from_api('polygons', { format: 'json' }, function (data) {
14 update_html_title('Broken polygons');
20 <div class="container">
22 <div class="col-sm-12">
23 <h1>Broken polygons</h1>
26 Total number of broken polygons: {aPolygons.length}.
29 <table class="table table-striped table-hover">
37 <th>Error message</th>
42 {#each aPolygons as polygon}
44 <td>{polygon.osm_type}</td>
45 <!-- eslint-disable-next-line svelte/no-at-html-tags -->
46 <td>{@html osmLink(polygon)}</td>
47 <td>{polygon.class}</td>
48 <td>{polygon.type}</td>
49 <td>{polygon.name}</td>
50 <td>{polygon.country_code || ''}</td>
51 <td>{polygon.errormessage}</td>
52 <td>{polygon.updated}</td>
54 <a href="http://localhost:8111/import?url=https://www.openstreetmap.org/api/0.6/{formatOSMType(polygon.osm_type)}/{polygon.osm_id}/full" target="josm">josm</a>