2 import { onMount } from 'svelte';
3 import { update_html_title } from '../lib/api_utils.js';
4 import { formatOSMType } from '../lib/helpers.js';
5 import { appState } from '../state/AppState.svelte.js';
7 import Header from '../components/Header.svelte';
8 import OsmLink from '../components/OsmLink.svelte';
10 let aPolygons = $state([]);
13 appState.fetchFromApi('polygons', { format: 'json' }, function (data) {
16 update_html_title('Broken polygons');
22 <div class="container">
24 <div class="col-sm-12">
25 <h1>Broken polygons</h1>
28 Total number of broken polygons: {aPolygons.length}.
31 <table class="table table-striped table-hover">
39 <th>Error message</th>
45 {#each aPolygons as polygon}
47 <td><OsmLink osmType=(polygon.osm_type} osmId={polygon.osm_id} /></td>
48 <td>{polygon.class}</td>
49 <td>{polygon.type}</td>
50 <td>{polygon.name}</td>
51 <td>{polygon.country_code || ''}</td>
52 <td>{polygon.errormessage}</td>
53 <td>{polygon.updated}</td>
55 <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>