@smartnet360/svelte-components 0.0.119 → 0.0.120
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/dist/apps/antenna-tools/band-config.d.ts +53 -0
- package/dist/apps/antenna-tools/band-config.js +112 -0
- package/dist/apps/antenna-tools/components/AntennaControls.svelte +558 -0
- package/dist/apps/antenna-tools/components/AntennaControls.svelte.d.ts +16 -0
- package/dist/apps/antenna-tools/components/AntennaSettingsModal.svelte +304 -0
- package/dist/apps/antenna-tools/components/AntennaSettingsModal.svelte.d.ts +8 -0
- package/dist/apps/antenna-tools/components/AntennaTools.svelte +597 -0
- package/dist/apps/antenna-tools/components/AntennaTools.svelte.d.ts +42 -0
- package/dist/apps/antenna-tools/components/DatabaseViewer.svelte +278 -0
- package/dist/apps/antenna-tools/components/DatabaseViewer.svelte.d.ts +3 -0
- package/dist/apps/antenna-tools/components/DbNotification.svelte +67 -0
- package/dist/apps/antenna-tools/components/DbNotification.svelte.d.ts +18 -0
- package/dist/apps/antenna-tools/components/JsonImporter.svelte +115 -0
- package/dist/apps/antenna-tools/components/JsonImporter.svelte.d.ts +6 -0
- package/dist/apps/antenna-tools/components/MSIConverter.svelte +282 -0
- package/dist/apps/antenna-tools/components/MSIConverter.svelte.d.ts +6 -0
- package/dist/apps/antenna-tools/components/chart-engines/PolarAreaChart.svelte +123 -0
- package/dist/apps/antenna-tools/components/chart-engines/PolarAreaChart.svelte.d.ts +16 -0
- package/dist/apps/antenna-tools/components/chart-engines/PolarLineChart.svelte +123 -0
- package/dist/apps/antenna-tools/components/chart-engines/PolarLineChart.svelte.d.ts +16 -0
- package/dist/apps/antenna-tools/components/chart-engines/index.d.ts +9 -0
- package/dist/apps/antenna-tools/components/chart-engines/index.js +9 -0
- package/dist/apps/antenna-tools/components/index.d.ts +8 -0
- package/dist/apps/antenna-tools/components/index.js +10 -0
- package/dist/apps/antenna-tools/db.d.ts +28 -0
- package/dist/apps/antenna-tools/db.js +45 -0
- package/dist/apps/antenna-tools/index.d.ts +26 -0
- package/dist/apps/antenna-tools/index.js +40 -0
- package/dist/apps/antenna-tools/stores/antennas.d.ts +13 -0
- package/dist/apps/antenna-tools/stores/antennas.js +25 -0
- package/dist/apps/antenna-tools/stores/db-status.d.ts +32 -0
- package/dist/apps/antenna-tools/stores/db-status.js +38 -0
- package/dist/apps/antenna-tools/stores/index.d.ts +5 -0
- package/dist/apps/antenna-tools/stores/index.js +5 -0
- package/dist/apps/antenna-tools/types.d.ts +137 -0
- package/dist/apps/antenna-tools/types.js +16 -0
- package/dist/apps/antenna-tools/utils/antenna-helpers.d.ts +83 -0
- package/dist/apps/antenna-tools/utils/antenna-helpers.js +198 -0
- package/dist/apps/antenna-tools/utils/chart-engines/index.d.ts +5 -0
- package/dist/apps/antenna-tools/utils/chart-engines/index.js +5 -0
- package/dist/apps/antenna-tools/utils/chart-engines/polar-area-utils.d.ts +94 -0
- package/dist/apps/antenna-tools/utils/chart-engines/polar-area-utils.js +151 -0
- package/dist/apps/antenna-tools/utils/chart-engines/polar-line-utils.d.ts +93 -0
- package/dist/apps/antenna-tools/utils/chart-engines/polar-line-utils.js +139 -0
- package/dist/apps/antenna-tools/utils/db-utils.d.ts +50 -0
- package/dist/apps/antenna-tools/utils/db-utils.js +266 -0
- package/dist/apps/antenna-tools/utils/index.d.ts +7 -0
- package/dist/apps/antenna-tools/utils/index.js +7 -0
- package/dist/apps/antenna-tools/utils/msi-parser.d.ts +21 -0
- package/dist/apps/antenna-tools/utils/msi-parser.js +215 -0
- package/dist/apps/antenna-tools/utils/recent-antennas.d.ts +24 -0
- package/dist/apps/antenna-tools/utils/recent-antennas.js +64 -0
- package/package.json +1 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
<svelte:options runes={true} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import JsonImporter from './JsonImporter.svelte';
|
|
5
|
+
import MSIConverter from './MSIConverter.svelte';
|
|
6
|
+
import DbNotification from './DbNotification.svelte';
|
|
7
|
+
import DatabaseViewer from './DatabaseViewer.svelte';
|
|
8
|
+
import { exportAntennas, clearAllAntennas } from '../utils/db-utils';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
show: boolean;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onDataRefresh?: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { show, onClose, onDataRefresh }: Props = $props();
|
|
17
|
+
|
|
18
|
+
let activeTab = $state<'view' | 'import' | 'msi' | 'export' | 'manage'>('view');
|
|
19
|
+
let showClearConfirm = $state(false);
|
|
20
|
+
|
|
21
|
+
// Handle data refresh after import operations
|
|
22
|
+
function handleDataRefresh() {
|
|
23
|
+
onDataRefresh?.();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Export data as JSON
|
|
27
|
+
async function handleExport() {
|
|
28
|
+
try {
|
|
29
|
+
await exportAntennas();
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error('Export failed:', error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Clear all data with confirmation
|
|
36
|
+
async function handleClearData() {
|
|
37
|
+
if (!showClearConfirm) {
|
|
38
|
+
showClearConfirm = true;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
await clearAllAntennas();
|
|
44
|
+
showClearConfirm = false;
|
|
45
|
+
handleDataRefresh();
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error('Clear data failed:', error);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function cancelClear() {
|
|
52
|
+
showClearConfirm = false;
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<!-- Modal -->
|
|
57
|
+
{#if show}
|
|
58
|
+
<!-- Modal backdrop -->
|
|
59
|
+
<div class="modal-backdrop fade show"></div>
|
|
60
|
+
|
|
61
|
+
<!-- Modal dialog -->
|
|
62
|
+
<div class="modal fade show d-block" tabindex="-1" role="dialog">
|
|
63
|
+
<div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable" role="document">
|
|
64
|
+
<div class="modal-content">
|
|
65
|
+
<!-- Modal Header -->
|
|
66
|
+
<div class="modal-header border-bottom">
|
|
67
|
+
<h4 class="modal-title">
|
|
68
|
+
<i class="bi bi-database me-2"></i>
|
|
69
|
+
Antenna Database
|
|
70
|
+
</h4>
|
|
71
|
+
<button
|
|
72
|
+
type="button"
|
|
73
|
+
class="btn-close"
|
|
74
|
+
onclick={onClose}
|
|
75
|
+
aria-label="Close"
|
|
76
|
+
></button>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<!-- Modal Body -->
|
|
80
|
+
<div class="modal-body p-0">
|
|
81
|
+
<!-- Tab Navigation -->
|
|
82
|
+
<div class="border-bottom">
|
|
83
|
+
<div class="nav nav-tabs">
|
|
84
|
+
<button
|
|
85
|
+
class="nav-link {activeTab === 'view' ? 'active' : ''}"
|
|
86
|
+
type="button"
|
|
87
|
+
onclick={() => activeTab = 'view'}
|
|
88
|
+
>
|
|
89
|
+
<i class="bi bi-table me-2"></i>View Data
|
|
90
|
+
</button>
|
|
91
|
+
<button
|
|
92
|
+
class="nav-link {activeTab === 'import' ? 'active' : ''}"
|
|
93
|
+
type="button"
|
|
94
|
+
onclick={() => activeTab = 'import'}
|
|
95
|
+
>
|
|
96
|
+
<i class="bi bi-upload me-2"></i>Import JSON
|
|
97
|
+
</button>
|
|
98
|
+
<button
|
|
99
|
+
class="nav-link {activeTab === 'msi' ? 'active' : ''}"
|
|
100
|
+
type="button"
|
|
101
|
+
onclick={() => activeTab = 'msi'}
|
|
102
|
+
>
|
|
103
|
+
<i class="bi bi-file-earmark-text me-2"></i>Import MSI
|
|
104
|
+
</button>
|
|
105
|
+
<button
|
|
106
|
+
class="nav-link {activeTab === 'export' ? 'active' : ''}"
|
|
107
|
+
type="button"
|
|
108
|
+
onclick={() => activeTab = 'export'}
|
|
109
|
+
>
|
|
110
|
+
<i class="bi bi-download me-2"></i>Export Data
|
|
111
|
+
</button>
|
|
112
|
+
<button
|
|
113
|
+
class="nav-link {activeTab === 'manage' ? 'active' : ''}"
|
|
114
|
+
type="button"
|
|
115
|
+
onclick={() => activeTab = 'manage'}
|
|
116
|
+
>
|
|
117
|
+
<i class="bi bi-trash me-2"></i>Manage Data
|
|
118
|
+
</button>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<!-- Tab Content -->
|
|
123
|
+
<div class="tab-content p-4">
|
|
124
|
+
|
|
125
|
+
<!-- View Data Tab -->
|
|
126
|
+
{#if activeTab === 'view'}
|
|
127
|
+
<div class="tab-pane fade show active">
|
|
128
|
+
<DatabaseViewer />
|
|
129
|
+
</div>
|
|
130
|
+
{/if}
|
|
131
|
+
|
|
132
|
+
<!-- Import JSON Tab -->
|
|
133
|
+
{#if activeTab === 'import'}
|
|
134
|
+
<div class="tab-pane fade show active">
|
|
135
|
+
<div class="row">
|
|
136
|
+
<div class="col-12">
|
|
137
|
+
<h5 class="mb-3">Import Antenna Data from JSON</h5>
|
|
138
|
+
<JsonImporter onDataRefresh={handleDataRefresh} />
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
{/if}
|
|
143
|
+
|
|
144
|
+
<!-- Import MSI Tab -->
|
|
145
|
+
{#if activeTab === 'msi'}
|
|
146
|
+
<div class="tab-pane fade show active">
|
|
147
|
+
<div class="row">
|
|
148
|
+
<div class="col-12">
|
|
149
|
+
<h5 class="mb-3">Import MSI Pattern Files</h5>
|
|
150
|
+
<MSIConverter onDataRefresh={handleDataRefresh} />
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
{/if}
|
|
155
|
+
|
|
156
|
+
<!-- Export Data Tab -->
|
|
157
|
+
{#if activeTab === 'export'}
|
|
158
|
+
<div class="tab-pane fade show active">
|
|
159
|
+
<div class="row">
|
|
160
|
+
<div class="col-12">
|
|
161
|
+
<h5 class="mb-3">Export Antenna Data</h5>
|
|
162
|
+
|
|
163
|
+
<div class="card border-success">
|
|
164
|
+
<div class="card-body text-center">
|
|
165
|
+
<i class="bi bi-download text-success" style="font-size: 3rem;"></i>
|
|
166
|
+
<h6 class="mt-3 mb-3">Download Data Backup</h6>
|
|
167
|
+
<p class="text-muted mb-4">
|
|
168
|
+
Export all antenna patterns and metadata as a JSON file.
|
|
169
|
+
</p>
|
|
170
|
+
<button
|
|
171
|
+
type="button"
|
|
172
|
+
class="btn btn-success btn-lg"
|
|
173
|
+
onclick={handleExport}
|
|
174
|
+
>
|
|
175
|
+
<i class="bi bi-download me-2"></i>
|
|
176
|
+
Export JSON File
|
|
177
|
+
</button>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
{/if}
|
|
184
|
+
|
|
185
|
+
<!-- Manage Data Tab -->
|
|
186
|
+
{#if activeTab === 'manage'}
|
|
187
|
+
<div class="tab-pane fade show active">
|
|
188
|
+
<div class="row">
|
|
189
|
+
<div class="col-12">
|
|
190
|
+
<h5 class="mb-3">Manage Database</h5>
|
|
191
|
+
|
|
192
|
+
<!-- Database Status -->
|
|
193
|
+
<div class="card border-info mb-4">
|
|
194
|
+
<div class="card-body">
|
|
195
|
+
<h6 class="card-title">
|
|
196
|
+
<i class="bi bi-info-circle me-2"></i>Database Status
|
|
197
|
+
</h6>
|
|
198
|
+
<DbNotification />
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<!-- Clear Data Section -->
|
|
203
|
+
<div class="card border-danger">
|
|
204
|
+
<div class="card-body">
|
|
205
|
+
<p class="text-muted mb-3">
|
|
206
|
+
Permanently delete all antenna data from the database.
|
|
207
|
+
</p>
|
|
208
|
+
|
|
209
|
+
{#if !showClearConfirm}
|
|
210
|
+
<button
|
|
211
|
+
type="button"
|
|
212
|
+
class="btn btn-outline-danger"
|
|
213
|
+
onclick={handleClearData}
|
|
214
|
+
>
|
|
215
|
+
<i class="bi bi-trash me-2"></i>
|
|
216
|
+
Clear All Data
|
|
217
|
+
</button>
|
|
218
|
+
{:else}
|
|
219
|
+
<div class="alert alert-danger" role="alert">
|
|
220
|
+
<strong>Are you sure?</strong> This will permanently delete all antenna data.
|
|
221
|
+
</div>
|
|
222
|
+
<div class="d-flex gap-2">
|
|
223
|
+
<button
|
|
224
|
+
type="button"
|
|
225
|
+
class="btn btn-danger"
|
|
226
|
+
onclick={handleClearData}
|
|
227
|
+
>
|
|
228
|
+
<i class="bi bi-trash me-2"></i>
|
|
229
|
+
Yes, Delete All Data
|
|
230
|
+
</button>
|
|
231
|
+
<button
|
|
232
|
+
type="button"
|
|
233
|
+
class="btn btn-secondary"
|
|
234
|
+
onclick={cancelClear}
|
|
235
|
+
>
|
|
236
|
+
Cancel
|
|
237
|
+
</button>
|
|
238
|
+
</div>
|
|
239
|
+
{/if}
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
{/if}
|
|
246
|
+
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<!-- Modal Footer -->
|
|
251
|
+
<div class="modal-footer border-top">
|
|
252
|
+
<button
|
|
253
|
+
type="button"
|
|
254
|
+
class="btn btn-secondary"
|
|
255
|
+
onclick={onClose}
|
|
256
|
+
>
|
|
257
|
+
Close
|
|
258
|
+
</button>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
{/if}
|
|
264
|
+
|
|
265
|
+
<style>
|
|
266
|
+
.modal {
|
|
267
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.modal-xl {
|
|
271
|
+
max-width: 1140px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.nav-tabs {
|
|
275
|
+
border-bottom: 1px solid #dee2e6;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.nav-tabs .nav-link {
|
|
279
|
+
border: none;
|
|
280
|
+
border-bottom: 3px solid transparent;
|
|
281
|
+
background: none;
|
|
282
|
+
color: #6c757d;
|
|
283
|
+
padding: 1rem 1.5rem;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.nav-tabs .nav-link:hover {
|
|
287
|
+
border-bottom-color: #e9ecef;
|
|
288
|
+
color: #495057;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.nav-tabs .nav-link.active {
|
|
292
|
+
color: #0d6efd;
|
|
293
|
+
border-bottom-color: #0d6efd;
|
|
294
|
+
background: none;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.card {
|
|
298
|
+
transition: box-shadow 0.15s ease-in-out;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.card:hover {
|
|
302
|
+
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
|
|
303
|
+
}
|
|
304
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
show: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onDataRefresh?: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const AntennaSettingsModal: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
type AntennaSettingsModal = ReturnType<typeof AntennaSettingsModal>;
|
|
8
|
+
export default AntennaSettingsModal;
|