meerschaum 3.0.0rc3__py3-none-any.whl → 3.0.0rc7__py3-none-any.whl
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.
- meerschaum/_internal/arguments/_parser.py +14 -2
- meerschaum/_internal/cli/__init__.py +6 -0
- meerschaum/_internal/cli/daemons.py +103 -0
- meerschaum/_internal/cli/entry.py +220 -0
- meerschaum/_internal/cli/workers.py +434 -0
- meerschaum/_internal/docs/index.py +1 -2
- meerschaum/_internal/entry.py +44 -8
- meerschaum/_internal/shell/Shell.py +113 -19
- meerschaum/_internal/shell/__init__.py +4 -1
- meerschaum/_internal/static.py +3 -1
- meerschaum/_internal/term/TermPageHandler.py +1 -2
- meerschaum/_internal/term/__init__.py +40 -6
- meerschaum/_internal/term/tools.py +33 -8
- meerschaum/actions/__init__.py +6 -4
- meerschaum/actions/api.py +39 -11
- meerschaum/actions/attach.py +1 -0
- meerschaum/actions/delete.py +4 -2
- meerschaum/actions/edit.py +27 -8
- meerschaum/actions/login.py +8 -8
- meerschaum/actions/register.py +13 -7
- meerschaum/actions/reload.py +22 -5
- meerschaum/actions/restart.py +14 -0
- meerschaum/actions/show.py +69 -4
- meerschaum/actions/start.py +135 -14
- meerschaum/actions/stop.py +36 -3
- meerschaum/actions/sync.py +6 -1
- meerschaum/api/__init__.py +35 -13
- meerschaum/api/_events.py +7 -2
- meerschaum/api/_oauth2.py +47 -4
- meerschaum/api/dash/callbacks/dashboard.py +103 -97
- meerschaum/api/dash/callbacks/jobs.py +3 -2
- meerschaum/api/dash/callbacks/login.py +10 -1
- meerschaum/api/dash/callbacks/pipes.py +136 -57
- meerschaum/api/dash/callbacks/register.py +9 -2
- meerschaum/api/dash/callbacks/tokens.py +2 -1
- meerschaum/api/dash/components.py +6 -7
- meerschaum/api/dash/keys.py +17 -1
- meerschaum/api/dash/pages/login.py +2 -2
- meerschaum/api/dash/pages/pipes.py +14 -4
- meerschaum/api/dash/pipes.py +186 -65
- meerschaum/api/dash/tokens.py +1 -1
- meerschaum/api/dash/webterm.py +14 -6
- meerschaum/api/models/_pipes.py +7 -1
- meerschaum/api/resources/static/js/terminado.js +3 -0
- meerschaum/api/resources/static/js/xterm-addon-unicode11.js +2 -0
- meerschaum/api/resources/templates/termpage.html +1 -0
- meerschaum/api/routes/_jobs.py +23 -11
- meerschaum/api/routes/_login.py +73 -5
- meerschaum/api/routes/_pipes.py +6 -4
- meerschaum/api/routes/_webterm.py +3 -3
- meerschaum/config/__init__.py +60 -13
- meerschaum/config/_default.py +89 -61
- meerschaum/config/_edit.py +10 -8
- meerschaum/config/_formatting.py +2 -0
- meerschaum/config/_patch.py +4 -2
- meerschaum/config/_paths.py +127 -12
- meerschaum/config/_read_config.py +20 -10
- meerschaum/config/_version.py +1 -1
- meerschaum/config/environment.py +262 -0
- meerschaum/config/stack/__init__.py +7 -5
- meerschaum/connectors/_Connector.py +1 -2
- meerschaum/connectors/__init__.py +37 -2
- meerschaum/connectors/api/_APIConnector.py +1 -1
- meerschaum/connectors/api/_jobs.py +11 -0
- meerschaum/connectors/api/_pipes.py +7 -1
- meerschaum/connectors/instance/_plugins.py +9 -1
- meerschaum/connectors/instance/_tokens.py +20 -3
- meerschaum/connectors/instance/_users.py +8 -1
- meerschaum/connectors/parse.py +1 -1
- meerschaum/connectors/sql/_create_engine.py +3 -0
- meerschaum/connectors/sql/_pipes.py +98 -79
- meerschaum/connectors/sql/_users.py +8 -1
- meerschaum/connectors/sql/tables/__init__.py +20 -3
- meerschaum/connectors/valkey/_ValkeyConnector.py +3 -3
- meerschaum/connectors/valkey/_pipes.py +7 -5
- meerschaum/core/Pipe/__init__.py +62 -72
- meerschaum/core/Pipe/_attributes.py +66 -90
- meerschaum/core/Pipe/_cache.py +555 -0
- meerschaum/core/Pipe/_clear.py +0 -11
- meerschaum/core/Pipe/_data.py +0 -50
- meerschaum/core/Pipe/_deduplicate.py +0 -13
- meerschaum/core/Pipe/_delete.py +12 -21
- meerschaum/core/Pipe/_drop.py +11 -23
- meerschaum/core/Pipe/_dtypes.py +1 -1
- meerschaum/core/Pipe/_index.py +8 -14
- meerschaum/core/Pipe/_sync.py +12 -18
- meerschaum/core/Plugin/_Plugin.py +7 -1
- meerschaum/core/Token/_Token.py +1 -1
- meerschaum/core/User/_User.py +1 -2
- meerschaum/jobs/_Executor.py +88 -4
- meerschaum/jobs/_Job.py +135 -35
- meerschaum/jobs/systemd.py +7 -2
- meerschaum/plugins/__init__.py +277 -81
- meerschaum/utils/_get_pipes.py +30 -4
- meerschaum/utils/daemon/Daemon.py +195 -41
- meerschaum/utils/daemon/FileDescriptorInterceptor.py +0 -1
- meerschaum/utils/daemon/RotatingFile.py +63 -36
- meerschaum/utils/daemon/StdinFile.py +53 -13
- meerschaum/utils/daemon/__init__.py +18 -5
- meerschaum/utils/daemon/_names.py +6 -3
- meerschaum/utils/debug.py +34 -4
- meerschaum/utils/dtypes/__init__.py +5 -1
- meerschaum/utils/formatting/__init__.py +4 -1
- meerschaum/utils/formatting/_jobs.py +1 -1
- meerschaum/utils/formatting/_pipes.py +47 -46
- meerschaum/utils/formatting/_pprint.py +1 -0
- meerschaum/utils/formatting/_shell.py +16 -6
- meerschaum/utils/misc.py +18 -38
- meerschaum/utils/packages/__init__.py +15 -13
- meerschaum/utils/packages/_packages.py +1 -0
- meerschaum/utils/pipes.py +39 -7
- meerschaum/utils/process.py +1 -1
- meerschaum/utils/prompt.py +171 -144
- meerschaum/utils/sql.py +12 -2
- meerschaum/utils/threading.py +42 -0
- meerschaum/utils/venv/__init__.py +2 -0
- meerschaum/utils/warnings.py +19 -13
- {meerschaum-3.0.0rc3.dist-info → meerschaum-3.0.0rc7.dist-info}/METADATA +3 -1
- {meerschaum-3.0.0rc3.dist-info → meerschaum-3.0.0rc7.dist-info}/RECORD +125 -119
- meerschaum/config/_environment.py +0 -145
- {meerschaum-3.0.0rc3.dist-info → meerschaum-3.0.0rc7.dist-info}/WHEEL +0 -0
- {meerschaum-3.0.0rc3.dist-info → meerschaum-3.0.0rc7.dist-info}/entry_points.txt +0 -0
- {meerschaum-3.0.0rc3.dist-info → meerschaum-3.0.0rc7.dist-info}/licenses/LICENSE +0 -0
- {meerschaum-3.0.0rc3.dist-info → meerschaum-3.0.0rc7.dist-info}/licenses/NOTICE +0 -0
- {meerschaum-3.0.0rc3.dist-info → meerschaum-3.0.0rc7.dist-info}/top_level.txt +0 -0
- {meerschaum-3.0.0rc3.dist-info → meerschaum-3.0.0rc7.dist-info}/zip-safe +0 -0
meerschaum/api/dash/pipes.py
CHANGED
@@ -14,17 +14,24 @@ from urllib.parse import urlencode
|
|
14
14
|
|
15
15
|
from meerschaum.utils import fetch_pipes_keys
|
16
16
|
from meerschaum.utils.typing import List, Optional, Dict, Any, Tuple, Union
|
17
|
-
from meerschaum.utils.misc import
|
17
|
+
from meerschaum.utils.misc import get_connector_labels
|
18
|
+
from meerschaum.connectors import instance_types
|
18
19
|
from meerschaum.utils.packages import attempt_import, import_dcc, import_html, import_pandas
|
19
20
|
from meerschaum.utils.sql import get_pd_type
|
20
21
|
from meerschaum.utils.yaml import yaml
|
21
22
|
from meerschaum.utils.warnings import warn
|
22
23
|
from meerschaum.utils.dataframe import to_json, to_simple_lines
|
23
24
|
from meerschaum.connectors.sql._fetch import get_pipe_query
|
24
|
-
from meerschaum.api import CHECK_UPDATE
|
25
|
+
from meerschaum.api import CHECK_UPDATE, get_api_connector
|
25
26
|
from meerschaum.api.dash import debug, _get_pipes
|
26
27
|
from meerschaum.api.dash.connectors import get_web_connector
|
27
|
-
from meerschaum.api.dash.components import
|
28
|
+
from meerschaum.api.dash.components import (
|
29
|
+
alert_from_success_tuple,
|
30
|
+
build_cards_grid,
|
31
|
+
sign_out_button,
|
32
|
+
logo_row,
|
33
|
+
pages_offcanvas,
|
34
|
+
)
|
28
35
|
from meerschaum.api.dash.sessions import is_session_authenticated
|
29
36
|
from meerschaum.config import get_config
|
30
37
|
import meerschaum as mrsm
|
@@ -370,48 +377,48 @@ def accordion_items_from_pipe(
|
|
370
377
|
html.Th(
|
371
378
|
html.Span(
|
372
379
|
"Key",
|
373
|
-
id={'type': 'key-table-header', '
|
380
|
+
id={'type': 'key-table-header', 'index': pipe_meta_str},
|
374
381
|
style={"textDecoration": "underline", "cursor": "pointer"},
|
375
382
|
),
|
376
383
|
),
|
377
384
|
html.Th(
|
378
385
|
html.Span(
|
379
386
|
"Column",
|
380
|
-
id={'type': 'column-table-header', '
|
387
|
+
id={'type': 'column-table-header', 'index': pipe_meta_str},
|
381
388
|
style={"textDecoration": "underline", "cursor": "pointer"},
|
382
389
|
),
|
383
390
|
),
|
384
391
|
html.Th(
|
385
392
|
html.Span(
|
386
393
|
"Index",
|
387
|
-
id={'type': 'index-table-header', '
|
394
|
+
id={'type': 'index-table-header', 'index': pipe_meta_str},
|
388
395
|
style={"textDecoration": "underline", "cursor": "pointer"},
|
389
396
|
),
|
390
397
|
),
|
391
398
|
html.Th(
|
392
399
|
html.Span(
|
393
400
|
"Is Composite",
|
394
|
-
id={'type': 'is-composite-table-header', '
|
401
|
+
id={'type': 'is-composite-table-header', 'index': pipe_meta_str},
|
395
402
|
style={"textDecoration": "underline", "cursor": "pointer"},
|
396
403
|
),
|
397
404
|
),
|
398
405
|
dbc.Tooltip(
|
399
406
|
"Unique reference name for the index "
|
400
407
|
"(e.g. `datetime` for the range axis)",
|
401
|
-
target={'type': 'key-table-header', '
|
408
|
+
target={'type': 'key-table-header', 'index': pipe_meta_str},
|
402
409
|
),
|
403
410
|
dbc.Tooltip(
|
404
411
|
"The actual column (field name) in the target dataset.",
|
405
|
-
target={'type': 'column-table-header', '
|
412
|
+
target={'type': 'column-table-header', 'index': pipe_meta_str},
|
406
413
|
),
|
407
414
|
dbc.Tooltip(
|
408
415
|
"The name of the index created on the given columns.",
|
409
|
-
target={'type': 'index-table-header', '
|
416
|
+
target={'type': 'index-table-header', 'index': pipe_meta_str},
|
410
417
|
),
|
411
418
|
dbc.Tooltip(
|
412
419
|
"Whether the column is used in the composite primary key "
|
413
420
|
"to determine updates.",
|
414
|
-
target={'type': 'is-composite-table-header', '
|
421
|
+
target={'type': 'is-composite-table-header', 'index': pipe_meta_str},
|
415
422
|
),
|
416
423
|
]
|
417
424
|
)
|
@@ -476,9 +483,14 @@ def accordion_items_from_pipe(
|
|
476
483
|
])
|
477
484
|
)
|
478
485
|
|
479
|
-
items_bodies['overview'] =
|
480
|
-
|
481
|
-
|
486
|
+
items_bodies['overview'] = html.Div(
|
487
|
+
dbc.Table(
|
488
|
+
overview_header + [html.Tbody(overview_rows)],
|
489
|
+
bordered=False,
|
490
|
+
hover=True,
|
491
|
+
striped=False,
|
492
|
+
),
|
493
|
+
style={'overflowX': 'auto'},
|
482
494
|
)
|
483
495
|
|
484
496
|
if 'stats' in active_items:
|
@@ -490,17 +502,13 @@ def accordion_items_from_pipe(
|
|
490
502
|
(newest_time - oldest_time) if newest_time is not None and oldest_time is not None
|
491
503
|
else None
|
492
504
|
)
|
493
|
-
rowcount = pipe.get_rowcount(debug=debug)
|
494
505
|
except Exception:
|
495
506
|
oldest_time = None
|
496
507
|
newest_time = None
|
497
508
|
interval = None
|
498
|
-
rowcount = None
|
499
509
|
|
500
510
|
stats_rows = []
|
501
|
-
if
|
502
|
-
stats_rows.append(html.Tr([html.Td("Row Count"), html.Td(f"{rowcount:,}")]))
|
503
|
-
if interval is not None:
|
511
|
+
if interval is not None and not isinstance(interval, int):
|
504
512
|
stats_rows.append(
|
505
513
|
html.Tr([html.Td("Timespan"), html.Td(humanfriendly.format_timespan(interval))])
|
506
514
|
)
|
@@ -509,7 +517,39 @@ def accordion_items_from_pipe(
|
|
509
517
|
if newest_time is not None:
|
510
518
|
stats_rows.append(html.Tr([html.Td("Newest time"), html.Td(str(newest_time))]))
|
511
519
|
|
512
|
-
|
520
|
+
precision = pipe.precision
|
521
|
+
if precision:
|
522
|
+
stats_rows.append(
|
523
|
+
html.Tr([
|
524
|
+
html.Td("Precision"),
|
525
|
+
html.Td(str(precision.get('interval', 1)) + ' ' + str(precision.get('unit', 'unit')))
|
526
|
+
])
|
527
|
+
)
|
528
|
+
|
529
|
+
stats_rows.append(
|
530
|
+
html.Tr([
|
531
|
+
html.Td("Row count"),
|
532
|
+
html.Td(
|
533
|
+
html.Div(
|
534
|
+
dbc.Button(
|
535
|
+
"Calculate",
|
536
|
+
color='link',
|
537
|
+
size='sm',
|
538
|
+
style={'text-decoration': 'none'},
|
539
|
+
id={'type': 'calculate-rowcount-button', 'index': pipe_meta_str},
|
540
|
+
)
|
541
|
+
if pipe.exists(debug=debug)
|
542
|
+
else '0'
|
543
|
+
),
|
544
|
+
id={'type': 'calculate-rowcount-div', 'index': pipe_meta_str},
|
545
|
+
)
|
546
|
+
])
|
547
|
+
)
|
548
|
+
|
549
|
+
items_bodies['stats'] = html.Div(
|
550
|
+
dbc.Table(stats_header + [html.Tbody(stats_rows)], hover=True),
|
551
|
+
style={'overflowX': 'auto'},
|
552
|
+
)
|
513
553
|
|
514
554
|
if 'columns' in active_items:
|
515
555
|
try:
|
@@ -539,7 +579,7 @@ def accordion_items_from_pipe(
|
|
539
579
|
mode='norm',
|
540
580
|
tabSize=4,
|
541
581
|
theme='twilight',
|
542
|
-
id={'type': 'parameters-editor', 'index':
|
582
|
+
id={'type': 'parameters-editor', 'index': pipe_meta_str},
|
543
583
|
width='100%',
|
544
584
|
height='500px',
|
545
585
|
readOnly=False,
|
@@ -551,19 +591,19 @@ def accordion_items_from_pipe(
|
|
551
591
|
)
|
552
592
|
update_parameters_button = dbc.Button(
|
553
593
|
"Update",
|
554
|
-
id={'type': 'update-parameters-button', 'index':
|
594
|
+
id={'type': 'update-parameters-button', 'index': pipe_meta_str},
|
555
595
|
)
|
556
596
|
|
557
597
|
as_yaml_button = dbc.Button(
|
558
598
|
"YAML",
|
559
|
-
id={'type': 'parameters-as-yaml-button', 'index':
|
599
|
+
id={'type': 'parameters-as-yaml-button', 'index': pipe_meta_str},
|
560
600
|
color='link',
|
561
601
|
size='sm',
|
562
602
|
style={'text-decoration': 'none'},
|
563
603
|
)
|
564
604
|
as_json_button = dbc.Button(
|
565
605
|
"JSON",
|
566
|
-
id={'type': 'parameters-as-json-button', 'index':
|
606
|
+
id={'type': 'parameters-as-json-button', 'index': pipe_meta_str},
|
567
607
|
color='link',
|
568
608
|
size='sm',
|
569
609
|
style={'text-decoration': 'none', 'margin-left': '10px'},
|
@@ -589,7 +629,7 @@ def accordion_items_from_pipe(
|
|
589
629
|
html.Div(
|
590
630
|
id={
|
591
631
|
'type': 'update-parameters-success-div',
|
592
|
-
'index':
|
632
|
+
'index': pipe_meta_str,
|
593
633
|
}
|
594
634
|
)
|
595
635
|
],
|
@@ -633,7 +673,7 @@ def accordion_items_from_pipe(
|
|
633
673
|
mode='sql',
|
634
674
|
tabSize=4,
|
635
675
|
theme='twilight',
|
636
|
-
id={'type': 'sql-editor', 'index':
|
676
|
+
id={'type': 'sql-editor', 'index': pipe_meta_str},
|
637
677
|
width='100%',
|
638
678
|
height='500px',
|
639
679
|
readOnly=False,
|
@@ -645,7 +685,7 @@ def accordion_items_from_pipe(
|
|
645
685
|
)
|
646
686
|
update_sql_button = dbc.Button(
|
647
687
|
"Update",
|
648
|
-
id={'type': 'update-sql-button', 'index':
|
688
|
+
id={'type': 'update-sql-button', 'index': pipe_meta_str},
|
649
689
|
)
|
650
690
|
items_bodies['sql'] = html.Div([
|
651
691
|
sql_editor,
|
@@ -654,7 +694,7 @@ def accordion_items_from_pipe(
|
|
654
694
|
dbc.Col([update_sql_button], width=2),
|
655
695
|
dbc.Col([
|
656
696
|
html.Div(
|
657
|
-
id={'type': 'update-sql-success-div', 'index':
|
697
|
+
id={'type': 'update-sql-success-div', 'index': pipe_meta_str}
|
658
698
|
)
|
659
699
|
],
|
660
700
|
width=True,
|
@@ -676,7 +716,7 @@ def accordion_items_from_pipe(
|
|
676
716
|
mode='norm',
|
677
717
|
tabSize=4,
|
678
718
|
theme='twilight',
|
679
|
-
id={'type': 'query-editor', 'index':
|
719
|
+
id={'type': 'query-editor', 'index': pipe_meta_str},
|
680
720
|
width='100%',
|
681
721
|
height='200px',
|
682
722
|
readOnly=False,
|
@@ -688,17 +728,17 @@ def accordion_items_from_pipe(
|
|
688
728
|
)
|
689
729
|
query_data_button = dbc.Button(
|
690
730
|
"Query",
|
691
|
-
id={'type': 'query-data-button', 'index':
|
731
|
+
id={'type': 'query-data-button', 'index': pipe_meta_str},
|
692
732
|
)
|
693
733
|
|
694
734
|
begin_end_input_group = dbc.InputGroup(
|
695
735
|
[
|
696
736
|
dbc.Input(
|
697
|
-
id={'type': 'query-data-begin-input', 'index':
|
737
|
+
id={'type': 'query-data-begin-input', 'index': pipe_meta_str},
|
698
738
|
placeholder="Begin",
|
699
739
|
),
|
700
740
|
dbc.Input(
|
701
|
-
id={'type': 'query-data-end-input', 'index':
|
741
|
+
id={'type': 'query-data-end-input', 'index': pipe_meta_str},
|
702
742
|
placeholder="End",
|
703
743
|
),
|
704
744
|
],
|
@@ -712,9 +752,12 @@ def accordion_items_from_pipe(
|
|
712
752
|
value=10,
|
713
753
|
step=1,
|
714
754
|
placeholder="Limit",
|
715
|
-
id={'type': 'limit-input', 'index':
|
755
|
+
id={'type': 'limit-input', 'index': pipe_meta_str},
|
756
|
+
)
|
757
|
+
query_result_div = html.Div(
|
758
|
+
id={'type': 'query-result-div', 'index': pipe_meta_str},
|
759
|
+
style={'overflowX': 'auto'},
|
716
760
|
)
|
717
|
-
query_result_div = html.Div(id={'type': 'query-result-div', 'index': json.dumps(pipe.meta)})
|
718
761
|
|
719
762
|
items_bodies['query-data'] = html.Div([
|
720
763
|
query_editor,
|
@@ -739,7 +782,7 @@ def accordion_items_from_pipe(
|
|
739
782
|
mode = 'norm',
|
740
783
|
tabSize = 4,
|
741
784
|
theme = 'twilight',
|
742
|
-
id = {'type': 'sync-editor', 'index':
|
785
|
+
id = {'type': 'sync-editor', 'index': pipe_meta_str},
|
743
786
|
width = '100%',
|
744
787
|
height = '500px',
|
745
788
|
readOnly = False,
|
@@ -752,14 +795,14 @@ def accordion_items_from_pipe(
|
|
752
795
|
|
753
796
|
sync_as_json_button = dbc.Button(
|
754
797
|
"JSON",
|
755
|
-
id={'type': 'sync-as-json-button', 'index':
|
798
|
+
id={'type': 'sync-as-json-button', 'index': pipe_meta_str},
|
756
799
|
color='link',
|
757
800
|
size='sm',
|
758
801
|
style={'text-decoration': 'none', 'margin-left': '10px'},
|
759
802
|
)
|
760
803
|
sync_as_lines_button = dbc.Button(
|
761
804
|
"Lines",
|
762
|
-
id={'type': 'sync-as-lines-button', 'index':
|
805
|
+
id={'type': 'sync-as-lines-button', 'index': pipe_meta_str},
|
763
806
|
color='link',
|
764
807
|
size='sm',
|
765
808
|
style={'text-decoration': 'none', 'margin-left': '10px'},
|
@@ -767,9 +810,9 @@ def accordion_items_from_pipe(
|
|
767
810
|
|
768
811
|
update_sync_button = dbc.Button(
|
769
812
|
"Sync",
|
770
|
-
id = {'type': 'update-sync-button', 'index':
|
813
|
+
id = {'type': 'update-sync-button', 'index': pipe_meta_str},
|
771
814
|
)
|
772
|
-
sync_success_div = html.Div(id={'type': 'sync-success-div', 'index':
|
815
|
+
sync_success_div = html.Div(id={'type': 'sync-success-div', 'index': pipe_meta_str})
|
773
816
|
items_bodies['sync-data'] = html.Div([
|
774
817
|
sync_editor,
|
775
818
|
html.Br(),
|
@@ -835,6 +878,28 @@ def build_pipes_dropdown_keys_row(
|
|
835
878
|
mk_alone = metric_keys and not any([str(x) for x in (connector_keys + tags + location_keys)])
|
836
879
|
lk_alone = location_keys and not any([str(x) for x in (connector_keys + metric_keys + tags)])
|
837
880
|
all_keys = fetch_pipes_keys('registered', instance_connector)
|
881
|
+
|
882
|
+
ck_options_source = (
|
883
|
+
{keys_tuple[0] for keys_tuple in all_keys}
|
884
|
+
if ck_alone
|
885
|
+
else {p.connector_keys for p in pipes}
|
886
|
+
)
|
887
|
+
ck_options = sorted(ck_options_source.union(connector_keys))
|
888
|
+
|
889
|
+
mk_options_source = (
|
890
|
+
{keys_tuple[1] for keys_tuple in all_keys}
|
891
|
+
if mk_alone
|
892
|
+
else {p.metric_key for p in pipes}
|
893
|
+
)
|
894
|
+
mk_options = sorted(mk_options_source.union(metric_keys))
|
895
|
+
|
896
|
+
lk_options_source = (
|
897
|
+
{str(keys_tuple[2]) for keys_tuple in all_keys}
|
898
|
+
if lk_alone
|
899
|
+
else {str(p.location_key) for p in pipes}
|
900
|
+
)
|
901
|
+
lk_options = sorted(lk_options_source.union({str(lk) for lk in location_keys}))
|
902
|
+
|
838
903
|
return dbc.Row(
|
839
904
|
[
|
840
905
|
dbc.Col(
|
@@ -842,11 +907,7 @@ def build_pipes_dropdown_keys_row(
|
|
842
907
|
[
|
843
908
|
dcc.Dropdown(
|
844
909
|
id='pipes-connector-keys-dropdown',
|
845
|
-
options=
|
846
|
-
sorted(list({pipe.connector_keys for pipe in pipes}))
|
847
|
-
if not ck_alone
|
848
|
-
else sorted(list({ck for ck, _, _ in all_keys}))
|
849
|
-
),
|
910
|
+
options=ck_options,
|
850
911
|
value=[str(ck) for ck in connector_keys],
|
851
912
|
placeholder='Connectors',
|
852
913
|
multi=True,
|
@@ -863,11 +924,7 @@ def build_pipes_dropdown_keys_row(
|
|
863
924
|
[
|
864
925
|
dcc.Dropdown(
|
865
926
|
id='pipes-metric-keys-dropdown',
|
866
|
-
options=
|
867
|
-
sorted(list({pipe.metric_key for pipe in pipes}))
|
868
|
-
if not mk_alone
|
869
|
-
else sorted(list({mk for _, mk, _ in all_keys}))
|
870
|
-
),
|
927
|
+
options=mk_options,
|
871
928
|
value=[str(mk) for mk in metric_keys],
|
872
929
|
placeholder='Metrics',
|
873
930
|
multi=True,
|
@@ -884,11 +941,7 @@ def build_pipes_dropdown_keys_row(
|
|
884
941
|
[
|
885
942
|
dcc.Dropdown(
|
886
943
|
id='pipes-location-keys-dropdown',
|
887
|
-
options=
|
888
|
-
sorted(list({str(pipe.location_key) for pipe in pipes}))
|
889
|
-
if not lk_alone
|
890
|
-
else sorted(list({str(lk) for _, _, lk in all_keys}))
|
891
|
-
),
|
944
|
+
options=lk_options,
|
892
945
|
value=[str(lk) for lk in location_keys],
|
893
946
|
placeholder='Locations',
|
894
947
|
multi=True,
|
@@ -910,7 +963,7 @@ def build_pipes_tags_dropdown(
|
|
910
963
|
location_keys: List[str],
|
911
964
|
tags: List[str],
|
912
965
|
instance: str,
|
913
|
-
) ->
|
966
|
+
) -> dbc.Row:
|
914
967
|
"""
|
915
968
|
Build the tags dropdown for the dedicated pipes page.
|
916
969
|
"""
|
@@ -935,16 +988,84 @@ def build_pipes_tags_dropdown(
|
|
935
988
|
str(tag)
|
936
989
|
for tag in (_all_tags if _tags_alone else _tags_pipes)
|
937
990
|
]
|
991
|
+
if tags:
|
992
|
+
tags_options += [tag for tag in tags if tag not in tags_options]
|
993
|
+
|
994
|
+
return dbc.Row(
|
995
|
+
[
|
996
|
+
dbc.Col(
|
997
|
+
html.Div(
|
998
|
+
dcc.Dropdown(
|
999
|
+
id='pipes-tags-dropdown',
|
1000
|
+
options=tags_options,
|
1001
|
+
value=tags,
|
1002
|
+
placeholder='Tags',
|
1003
|
+
multi=True,
|
1004
|
+
searchable=True,
|
1005
|
+
),
|
1006
|
+
className="dbc_dark",
|
1007
|
+
id="pipes-tags-dropdown-div",
|
1008
|
+
),
|
1009
|
+
width=True,
|
1010
|
+
),
|
1011
|
+
dbc.Col(
|
1012
|
+
dbc.Button(
|
1013
|
+
"Clear all",
|
1014
|
+
color='link',
|
1015
|
+
size='sm',
|
1016
|
+
style={'text-decoration': 'none'},
|
1017
|
+
id='pipes-clear-all-button',
|
1018
|
+
),
|
1019
|
+
width='auto',
|
1020
|
+
),
|
1021
|
+
],
|
1022
|
+
className='g-0',
|
1023
|
+
align='center',
|
1024
|
+
)
|
1025
|
+
|
938
1026
|
|
1027
|
+
def build_pipes_navbar(instance_keys: Optional[str] = None, with_instance_select: bool = True):
|
1028
|
+
"""
|
1029
|
+
Build the navbar from the selected instance keys.
|
1030
|
+
"""
|
1031
|
+
instance_select = dbc.Select(
|
1032
|
+
id='instance-select',
|
1033
|
+
size='sm',
|
1034
|
+
value=instance_keys or str(get_api_connector()),
|
1035
|
+
options=[
|
1036
|
+
{'label': (i[:32] + '…') if len(i) > 32 else i, 'value': i}
|
1037
|
+
for i in get_connector_labels(*instance_types)
|
1038
|
+
],
|
1039
|
+
class_name='dbc_dark custom-select custom-select-sm',
|
1040
|
+
)
|
1041
|
+
instance_select_div_style = {} if with_instance_select else {'visibility': 'hidden'}
|
1042
|
+
instance_select_div = html.Div(instance_select, style=instance_select_div_style)
|
939
1043
|
return html.Div(
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
1044
|
+
[
|
1045
|
+
pages_offcanvas,
|
1046
|
+
dbc.Navbar(
|
1047
|
+
dbc.Container(
|
1048
|
+
[
|
1049
|
+
logo_row,
|
1050
|
+
dbc.NavbarToggler(id="navbar-toggler", n_clicks=0),
|
1051
|
+
dbc.Collapse(
|
1052
|
+
dbc.Row(
|
1053
|
+
[
|
1054
|
+
dbc.Col(instance_select_div, width='auto'),
|
1055
|
+
dbc.Col(sign_out_button, width='auto'),
|
1056
|
+
],
|
1057
|
+
className="g-0 ms-auto flex-nowrap mt-3 mt-md-0",
|
1058
|
+
align='center',
|
1059
|
+
),
|
1060
|
+
id='navbar-collapse',
|
1061
|
+
is_open=False,
|
1062
|
+
navbar=True,
|
1063
|
+
),
|
1064
|
+
]
|
1065
|
+
),
|
1066
|
+
dark=True,
|
1067
|
+
color='dark'
|
1068
|
+
),
|
1069
|
+
],
|
1070
|
+
id='pages-navbar-div',
|
950
1071
|
)
|
meerschaum/api/dash/tokens.py
CHANGED
@@ -65,7 +65,7 @@ def get_tokens_table(session_id: Optional[str] = None) -> Tuple[dbc.Table, List[
|
|
65
65
|
html.Td("✅" if token.is_valid else "❌"),
|
66
66
|
html.Td([
|
67
67
|
dbc.Button(
|
68
|
-
html.B("
|
68
|
+
html.B("⋮"),
|
69
69
|
color='link',
|
70
70
|
size='sm',
|
71
71
|
id={'type': 'tokens-context-button', 'index': str(token.id)},
|
meerschaum/api/dash/webterm.py
CHANGED
@@ -7,12 +7,13 @@ Functions for interacting with the Webterm via the dashboard.
|
|
7
7
|
"""
|
8
8
|
|
9
9
|
import time
|
10
|
+
from typing import Optional, Tuple, Any
|
10
11
|
|
11
12
|
import meerschaum as mrsm
|
12
|
-
from meerschaum.api import CHECK_UPDATE, get_api_connector
|
13
|
+
from meerschaum.api import CHECK_UPDATE, get_api_connector, webterm_port
|
13
14
|
from meerschaum.api.dash.sessions import is_session_authenticated, get_username_from_session
|
14
15
|
from meerschaum.api.dash.components import alert_from_success_tuple, console_div
|
15
|
-
from meerschaum.utils.typing import WebState
|
16
|
+
from meerschaum.utils.typing import WebState
|
16
17
|
from meerschaum.utils.packages import attempt_import, import_html, import_dcc
|
17
18
|
from meerschaum._internal.term.tools import is_webterm_running
|
18
19
|
from meerschaum.utils.threading import Thread, RLock
|
@@ -22,7 +23,7 @@ dbc = attempt_import('dash_bootstrap_components', lazy=False, check_update=CHECK
|
|
22
23
|
|
23
24
|
MAX_WEBTERM_ATTEMPTS: int = 10
|
24
25
|
TMUX_IS_ENABLED: bool = (
|
25
|
-
is_tmux_available() and mrsm.get_config('
|
26
|
+
is_tmux_available() and mrsm.get_config('api', 'webterm', 'tmux', 'enabled')
|
26
27
|
)
|
27
28
|
|
28
29
|
_locks = {'webterm_thread': RLock()}
|
@@ -51,7 +52,7 @@ def get_webterm(state: WebState) -> Tuple[Any, Any]:
|
|
51
52
|
)
|
52
53
|
|
53
54
|
for i in range(MAX_WEBTERM_ATTEMPTS):
|
54
|
-
if is_webterm_running('localhost',
|
55
|
+
if is_webterm_running('localhost', webterm_port, session_id=(username or session_id)):
|
55
56
|
return (
|
56
57
|
[
|
57
58
|
html.Div(
|
@@ -91,7 +92,7 @@ def get_webterm(state: WebState) -> Tuple[Any, Any]:
|
|
91
92
|
|
92
93
|
|
93
94
|
webterm_procs = {}
|
94
|
-
def start_webterm() -> None:
|
95
|
+
def start_webterm(webterm_port: Optional[int] = None) -> None:
|
95
96
|
"""
|
96
97
|
Start the webterm thread.
|
97
98
|
"""
|
@@ -101,7 +102,14 @@ def start_webterm() -> None:
|
|
101
102
|
conn = get_api_connector()
|
102
103
|
_ = run_python_package(
|
103
104
|
'meerschaum',
|
104
|
-
|
105
|
+
(
|
106
|
+
['start', 'webterm', '-i', str(conn)]
|
107
|
+
+ (
|
108
|
+
[]
|
109
|
+
if not webterm_port
|
110
|
+
else ['-p', str(webterm_port)]
|
111
|
+
)
|
112
|
+
),
|
105
113
|
capture_output=True,
|
106
114
|
as_proc=True,
|
107
115
|
store_proc_dict=webterm_procs,
|
meerschaum/api/models/_pipes.py
CHANGED
@@ -54,7 +54,13 @@ class PipeModel(BasePipeModel):
|
|
54
54
|
|
55
55
|
|
56
56
|
class FetchPipesKeysResponseModel(
|
57
|
-
RootModel[
|
57
|
+
RootModel[
|
58
|
+
Union[
|
59
|
+
List[Tuple[ConnectorKeysModel, MetricKeyModel, LocationKeyModel]],
|
60
|
+
List[Tuple[ConnectorKeysModel, MetricKeyModel, LocationKeyModel, Dict[str, Any]]],
|
61
|
+
List[Tuple[ConnectorKeysModel, MetricKeyModel, LocationKeyModel, List[str]]],
|
62
|
+
]
|
63
|
+
]
|
58
64
|
):
|
59
65
|
"""
|
60
66
|
A list of tuples containing connector, metric, and location keys.
|
@@ -11,7 +11,10 @@ function make_terminal(element, size, ws_url) {
|
|
11
11
|
useStyle: true,
|
12
12
|
scrollback: 9999999,
|
13
13
|
cursorBlink: true,
|
14
|
+
allowProposedApi: true
|
14
15
|
});
|
16
|
+
term.loadAddon(new Unicode11Addon.Unicode11Addon());
|
17
|
+
term.unicode.activeVersion = '11';
|
15
18
|
term.attachCustomKeyEventHandler(copyPasteKeyEventHandler);
|
16
19
|
term.open(element);
|
17
20
|
|
@@ -0,0 +1,2 @@
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Unicode11Addon=t():e.Unicode11Addon=t()}(this,(()=>(()=>{"use strict";var e={433:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV11=void 0;const r=i(938),s=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],n=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],o=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],c=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let l;function d(e,t){let i,r=0,s=t.length-1;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=r;)if(i=r+s>>1,e>t[i][1])r=i+1;else{if(!(e<t[i][0]))return!0;s=i-1}return!1}t.UnicodeV11=class{constructor(){if(this.version="11",!l){l=new Uint8Array(65536),l.fill(1),l[0]=0,l.fill(0,1,32),l.fill(0,127,160);for(let e=0;e<s.length;++e)l.fill(0,s[e][0],s[e][1]+1);for(let e=0;e<o.length;++e)l.fill(2,o[e][0],o[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?l[e]:d(e,n)?0:d(e,c)?2:1}charProperties(e,t){let i=this.wcwidth(e),s=0===i&&0!==t;if(s){const e=r.UnicodeService.extractWidth(t);0===e?s=!1:e>i&&(i=e)}return r.UnicodeService.createPropertyValue(0,i,s)}}},345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}})),this._event}fire(e,t){const i=[];for(let e=0;e<this._listeners.length;e++)i.push(this._listeners[e]);for(let r=0;r<i.length;r++)i[r].call(void 0,e,t)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))},t.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))}},490:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const r=i(938),s=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let o;t.UnicodeV6=class{constructor(){if(this.version="6",!o){o=new Uint8Array(65536),o.fill(1),o[0]=0,o.fill(0,1,32),o.fill(0,127,160),o.fill(2,4352,4448),o[9001]=2,o[9002]=2,o.fill(2,11904,42192),o[12351]=1,o.fill(2,44032,55204),o.fill(2,63744,64256),o.fill(2,65040,65050),o.fill(2,65072,65136),o.fill(2,65280,65377),o.fill(2,65504,65511);for(let e=0;e<s.length;++e)o.fill(0,s[e][0],s[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?o[e]:function(e,t){let i,r=0,s=t.length-1;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=r;)if(i=r+s>>1,e>t[i][1])r=i+1;else{if(!(e<t[i][0]))return!0;s=i-1}return!1}(e,n)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=0===i&&0!==t;if(s){const e=r.UnicodeService.extractWidth(t);0===e?s=!1:e>i&&(i=e)}return r.UnicodeService.createPropertyValue(0,i,s)}}},938:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const r=i(345),s=i(490);class n{static extractShouldJoin(e){return 0!=(1&e)}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,i=!1){return(16777215&e)<<3|(3&t)<<1|(i?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new r.EventEmitter,this.onChange=this._onChange.event;const e=new s.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,i=0;const r=e.length;for(let s=0;s<r;++s){let o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=r)return t+this.wcwidth(o);const i=e.charCodeAt(s);56320<=i&&i<=57343?o=1024*(o-55296)+i-56320+65536:t+=this.wcwidth(i)}const c=this.charProperties(o,i);let l=n.extractWidth(c);n.extractShouldJoin(c)&&(l-=n.extractWidth(i)),t+=l,i=c}return t}charProperties(e,t){return this._activeProvider.charProperties(e,t)}}t.UnicodeService=n}},t={};function i(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,i),n.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.Unicode11Addon=void 0;const t=i(433);e.Unicode11Addon=class{activate(e){e.unicode.register(new t.UnicodeV11)}dispose(){}}})(),r})()));
|
2
|
+
//# sourceMappingURL=addon-unicode11.js.map
|
@@ -9,6 +9,7 @@
|
|
9
9
|
</style>
|
10
10
|
<link rel="stylesheet" href="{{ static('css/xterm.css') }}"/>
|
11
11
|
<script src="{{ static('js/xterm.js') }}"></script>
|
12
|
+
<script src="{{ static('js/xterm-addon-unicode11.js') }}"></script>
|
12
13
|
<script src="{{ static('js/terminado.js') }}"></script>
|
13
14
|
<script>
|
14
15
|
|