LogstashUI 0.5.5.dev0__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.
- AI/__init__.py +0 -0
- AI/integration_factory.py +1392 -0
- AI/migrations/0001_initial.py +58 -0
- AI/migrations/0002_draftdefinition_normalizers.py +23 -0
- AI/migrations/0003_delete_aisettings_delete_draftdefinition.py +19 -0
- AI/migrations/__init__.py +0 -0
- AI/models.py +5 -0
- AI/static/js/integration_factory.js +1102 -0
- AI/system_prompts/dashboard_generator.md +367 -0
- AI/system_prompts/grok_patterns.txt +95 -0
- AI/system_prompts/ingest_pipeline_generator.md +331 -0
- AI/system_prompts/ingest_pipeline_processors.json +2851 -0
- AI/system_prompts/ingest_verifier.md +84 -0
- AI/system_prompts/integrations_list.json +2690 -0
- AI/system_prompts/log_classifier.md +134 -0
- AI/system_prompts/template_creator.md +123 -0
- AI/templates/integration_factory.html +200 -0
- AI/urls.py +16 -0
- AI/views.py +20 -0
- API/__init__.py +0 -0
- API/admin.py +7 -0
- API/api.http +784 -0
- API/apps.py +9 -0
- API/auth.py +101 -0
- API/connections_views.py +312 -0
- API/guides.py +88 -0
- API/mcp/__init__.py +5 -0
- API/mcp/dispatch.py +179 -0
- API/mcp/tools.py +890 -0
- API/mcp/views.py +215 -0
- API/migrations/__init__.py +0 -0
- API/models.py +7 -0
- API/pipelines_views.py +1224 -0
- API/policies_views.py +1015 -0
- API/security_views.py +488 -0
- API/simulation_detail.py +219 -0
- API/snmp_views.py +1539 -0
- API/urls.py +81 -0
- Common/__init__.py +0 -0
- Common/ai/agent_builder.py +690 -0
- Common/context_processors.py +49 -0
- Common/decorators.py +68 -0
- Common/elastic_utils.py +1154 -0
- Common/encryption.py +271 -0
- Common/error_handlers.py +65 -0
- Common/formatters.py +106 -0
- Common/logstash_config_parse.py +1469 -0
- Common/logstash_utils.py +34 -0
- Common/middleware.py +216 -0
- Common/product_ca.py +1124 -0
- Common/validators.py +66 -0
- Documentation/__init__.py +0 -0
- Documentation/admin.py +7 -0
- Documentation/apps.py +9 -0
- Documentation/content/CHANGELOG.md +890 -0
- Documentation/content/docs/getting_started.md +92 -0
- Documentation/content/docs/index.md +124 -0
- Documentation/content/docs/logstashagent/configuration/index.md +60 -0
- Documentation/content/docs/logstashagent/configuration/logstashagent.yml.md +141 -0
- Documentation/content/docs/logstashagent/general/build.md +217 -0
- Documentation/content/docs/logstashagent/general/index.md +38 -0
- Documentation/content/docs/logstashagent/general/roles.md +267 -0
- Documentation/content/docs/logstashagent/index.md +264 -0
- Documentation/content/docs/logstashui/SNMP/Quickstart.md +94 -0
- Documentation/content/docs/logstashui/SNMP/architecture.md +64 -0
- Documentation/content/docs/logstashui/SNMP/configuration.md +147 -0
- Documentation/content/docs/logstashui/SNMP/data_overview.md +59 -0
- Documentation/content/docs/logstashui/SNMP/deploying_changes.md +71 -0
- Documentation/content/docs/logstashui/SNMP/device_support.md +39 -0
- Documentation/content/docs/logstashui/SNMP/discovery.md +48 -0
- Documentation/content/docs/logstashui/SNMP/index.md +58 -0
- Documentation/content/docs/logstashui/SNMP/pipeline_generation.md +63 -0
- Documentation/content/docs/logstashui/SNMP/schema.md +595 -0
- Documentation/content/docs/logstashui/SNMP/testing.md +47 -0
- Documentation/content/docs/logstashui/SNMP/traps.md +45 -0
- Documentation/content/docs/logstashui/SNMP/tsds_implementation.md +82 -0
- Documentation/content/docs/logstashui/agent_guides/concepts.md +25 -0
- Documentation/content/docs/logstashui/agent_guides/deploy.md +30 -0
- Documentation/content/docs/logstashui/agent_guides/pipeline-review.md +24 -0
- Documentation/content/docs/logstashui/agent_guides/simulation.md +55 -0
- Documentation/content/docs/logstashui/agent_guides/snmp.md +57 -0
- Documentation/content/docs/logstashui/agent_guides/troubleshooting.md +21 -0
- Documentation/content/docs/logstashui/architecture.md +11 -0
- Documentation/content/docs/logstashui/compatibility.md +58 -0
- Documentation/content/docs/logstashui/configuration/environment.md +193 -0
- Documentation/content/docs/logstashui/configuration/host_mode.md +94 -0
- Documentation/content/docs/logstashui/configuration/index.md +72 -0
- Documentation/content/docs/logstashui/configuration/logstash_proxy.md +138 -0
- Documentation/content/docs/logstashui/configuration/logstashui.yml.md +16 -0
- Documentation/content/docs/logstashui/configuration/simulation.md +84 -0
- Documentation/content/docs/logstashui/database/examples/README.md +15 -0
- Documentation/content/docs/logstashui/database/examples/create-mariadb.sql +13 -0
- Documentation/content/docs/logstashui/database/examples/create-mysql.sql +12 -0
- Documentation/content/docs/logstashui/database/examples/create-postgresql.sql +13 -0
- Documentation/content/docs/logstashui/database/examples/schema-mysql.sql +502 -0
- Documentation/content/docs/logstashui/database/examples/schema-postgresql.sql +1709 -0
- Documentation/content/docs/logstashui/database/index.md +79 -0
- Documentation/content/docs/logstashui/database/migration.md +75 -0
- Documentation/content/docs/logstashui/general/build.md +154 -0
- Documentation/content/docs/logstashui/general/deploy.md +122 -0
- Documentation/content/docs/logstashui/general/deployment-recs.md +32 -0
- Documentation/content/docs/logstashui/general/index.md +62 -0
- Documentation/content/docs/logstashui/general/offline.md +68 -0
- Documentation/content/docs/logstashui/general/updating.md +50 -0
- Documentation/content/docs/logstashui/index.md +90 -0
- Documentation/content/docs/logstashui/kubernetes/cnpg.md +98 -0
- Documentation/content/docs/logstashui/kubernetes/envoy-gateway.md +112 -0
- Documentation/content/docs/logstashui/kubernetes/examples/README.md +46 -0
- Documentation/content/docs/logstashui/kubernetes/examples/embedded-agent.yaml +122 -0
- Documentation/content/docs/logstashui/kubernetes/examples/mysql/configmap.yaml +41 -0
- Documentation/content/docs/logstashui/kubernetes/examples/mysql/ingress.yaml +31 -0
- Documentation/content/docs/logstashui/kubernetes/examples/mysql/namespace.yaml +8 -0
- Documentation/content/docs/logstashui/kubernetes/examples/mysql/secret.yaml +19 -0
- Documentation/content/docs/logstashui/kubernetes/examples/mysql/statefulset.yaml +106 -0
- Documentation/content/docs/logstashui/kubernetes/examples/postgresql/cnpg.yaml +25 -0
- Documentation/content/docs/logstashui/kubernetes/examples/postgresql/configmap.yaml +42 -0
- Documentation/content/docs/logstashui/kubernetes/examples/postgresql/ingress.yaml +31 -0
- Documentation/content/docs/logstashui/kubernetes/examples/postgresql/namespace.yaml +8 -0
- Documentation/content/docs/logstashui/kubernetes/examples/postgresql/secret.yaml +19 -0
- Documentation/content/docs/logstashui/kubernetes/examples/postgresql/statefulset.yaml +106 -0
- Documentation/content/docs/logstashui/kubernetes/examples/sqlite/configmap.yaml +35 -0
- Documentation/content/docs/logstashui/kubernetes/examples/sqlite/ingress.yaml +31 -0
- Documentation/content/docs/logstashui/kubernetes/examples/sqlite/namespace.yaml +8 -0
- Documentation/content/docs/logstashui/kubernetes/examples/sqlite/secret.yaml +18 -0
- Documentation/content/docs/logstashui/kubernetes/examples/sqlite/statefulset.yaml +106 -0
- Documentation/content/docs/logstashui/kubernetes/index.md +121 -0
- Documentation/content/docs/logstashui/mcp.md +224 -0
- Documentation/content/docs/logstashui/mcp_scenarios.md +234 -0
- Documentation/content/docs/logstashui/rest_api.md +2783 -0
- Documentation/content/docs/logstashui/utilities/dissect_debugger.md +89 -0
- Documentation/content/docs/logstashui/utilities/grok_debugger.md +114 -0
- Documentation/content/docs/logstashui/utilities/index.md +40 -0
- Documentation/content/images/LogstashIcon.png +0 -0
- Documentation/content/images/architecture.png +0 -0
- Documentation/content/images/connection_manager.png +0 -0
- Documentation/content/images/control_plane.png +0 -0
- Documentation/content/images/graph.gif +0 -0
- Documentation/content/images/login.png +0 -0
- Documentation/content/images/monitoring.png +0 -0
- Documentation/content/images/new_connection.gif +0 -0
- Documentation/content/images/simulate.gif +0 -0
- Documentation/content/images/simulate.png +0 -0
- Documentation/content/images/snmp.gif +0 -0
- Documentation/content/images/snmp.png +0 -0
- Documentation/content/images/snmp_architecture.png +0 -0
- Documentation/migrations/__init__.py +0 -0
- Documentation/models.py +9 -0
- Documentation/static/css/markdown.css +250 -0
- Documentation/templates/documentation.html +225 -0
- Documentation/templates/nav_item.html +41 -0
- Documentation/urls.py +11 -0
- Documentation/views.py +442 -0
- LogstashUI/__init__.py +0 -0
- LogstashUI/__main__.py +10 -0
- LogstashUI/asgi.py +16 -0
- LogstashUI/cli.py +626 -0
- LogstashUI/config.py +116 -0
- LogstashUI/database.py +263 -0
- LogstashUI/insecure_http.py +117 -0
- LogstashUI/logging_config.py +99 -0
- LogstashUI/migrate_engine.py +282 -0
- LogstashUI/packaging/__init__.py +3 -0
- LogstashUI/packaging/logstashui.default +68 -0
- LogstashUI/packaging/logstashui.service.in +22 -0
- LogstashUI/paths.py +181 -0
- LogstashUI/settings.py +437 -0
- LogstashUI/telemetry.py +159 -0
- LogstashUI/urls.py +56 -0
- LogstashUI/wsgi.py +77 -0
- Management/__init__.py +0 -0
- Management/apps.py +10 -0
- Management/migrations/0001_initial.py +29 -0
- Management/migrations/0002_settings.py +25 -0
- Management/migrations/0003_settings_agent_ui_url.py +29 -0
- Management/migrations/0004_settings_logstash_artifact_base_url.py +29 -0
- Management/migrations/__init__.py +0 -0
- Management/models.py +92 -0
- Management/templates/api_tokens.html +214 -0
- Management/templates/components/api_token_created.html +38 -0
- Management/templates/components/api_token_row.html +84 -0
- Management/templates/components/logstash_artifact_row.html +100 -0
- Management/templates/components/logstash_artifact_tbody.html +26 -0
- Management/templates/components/user_row.html +67 -0
- Management/templates/logs.html +98 -0
- Management/templates/logstash_artifacts.html +172 -0
- Management/templates/management.html +80 -0
- Management/templates/management_settings.html +320 -0
- Management/templates/registration/login.html +404 -0
- Management/templates/users.html +304 -0
- Management/urls.py +23 -0
- Management/views.py +804 -0
- Monitoring/__init__.py +0 -0
- Monitoring/apps.py +9 -0
- Monitoring/migrations/__init__.py +0 -0
- Monitoring/static/js/monitoring.js +463 -0
- Monitoring/templates/components/node_metrics.html +161 -0
- Monitoring/templates/components/pipeline_metrics.html +189 -0
- Monitoring/templates/monitoring.html +271 -0
- Monitoring/urls.py +16 -0
- Monitoring/views.py +724 -0
- PipelineManager/__init__.py +0 -0
- PipelineManager/agent_api.py +1173 -0
- PipelineManager/agent_client.py +59 -0
- PipelineManager/agent_modes.py +880 -0
- PipelineManager/agent_policies.py +689 -0
- PipelineManager/agent_versions.py +151 -0
- PipelineManager/apps.py +10 -0
- PipelineManager/artifact_metrics.py +171 -0
- PipelineManager/artifacts.py +820 -0
- PipelineManager/connections_crud.py +722 -0
- PipelineManager/data/default_jvm.options +76 -0
- PipelineManager/data/default_log4j2.properties +165 -0
- PipelineManager/data/default_logstash.yml +405 -0
- PipelineManager/data/plugins.json +29109 -0
- PipelineManager/editor_views.py +608 -0
- PipelineManager/forms.py +284 -0
- PipelineManager/manager_views.py +490 -0
- PipelineManager/migrations/0001_initial.py +38 -0
- PipelineManager/migrations/0002_alter_connection_connection_type_and_more.py +38 -0
- PipelineManager/migrations/0003_policy_connection_policy.py +38 -0
- PipelineManager/migrations/0004_policy_current_revision_number_and_more.py +75 -0
- PipelineManager/migrations/0005_apikey_enrollmenttoken.py +38 -0
- PipelineManager/migrations/0006_enrollmenttoken_name.py +18 -0
- PipelineManager/migrations/0007_alter_enrollmenttoken_options_and_more.py +21 -0
- PipelineManager/migrations/0008_connection_agent_id.py +18 -0
- PipelineManager/migrations/0009_connection_last_check_in_policy_jvm_options_hash_and_more.py +33 -0
- PipelineManager/migrations/0010_keystore_revision_number_pipeline_revision_number.py +23 -0
- PipelineManager/migrations/0011_keystore_kv_hash.py +18 -0
- PipelineManager/migrations/0012_policy_binary_path.py +18 -0
- PipelineManager/migrations/0013_connection_status_blob.py +18 -0
- PipelineManager/migrations/0014_pipeline_pipeline_batch_delay_and_more.py +43 -0
- PipelineManager/migrations/0015_add_pipeline_hash.py +18 -0
- PipelineManager/migrations/0016_backfill_pipeline_hash.py +32 -0
- PipelineManager/migrations/0017_policy_keystore_password.py +31 -0
- PipelineManager/migrations/0018_policy_last_deployed_at.py +18 -0
- PipelineManager/migrations/0019_connection_restart_on_next_checkin.py +18 -0
- PipelineManager/migrations/0020_pipeline_no_input_pipeline_non_reloadable.py +23 -0
- PipelineManager/migrations/0021_connection_desired_agent_version.py +18 -0
- PipelineManager/migrations/0022_keystore_managed_by_pipeline_managed_by.py +23 -0
- PipelineManager/migrations/0023_agent_modes_policy_connection.py +89 -0
- PipelineManager/migrations/0024_seed_system_policies.py +173 -0
- PipelineManager/migrations/0025_packaged_managed_policy_types.py +166 -0
- PipelineManager/migrations/0026_normalize_opt_logstash_agent_paths.py +63 -0
- PipelineManager/migrations/0027_packaged_managed_default_ports.py +49 -0
- PipelineManager/migrations/0028_apikey_admin_tokens.py +80 -0
- PipelineManager/migrations/0029_logstash_artifacts.py +45 -0
- PipelineManager/migrations/0030_connection_allow_self_signed_certs.py +33 -0
- PipelineManager/migrations/0031_deploy_system_policies.py +93 -0
- PipelineManager/migrations/0032_connection_agent_inbound_key.py +30 -0
- PipelineManager/migrations/0033_simulation_result.py +26 -0
- PipelineManager/migrations/__init__.py +0 -0
- PipelineManager/models.py +1300 -0
- PipelineManager/pipelines_crud.py +738 -0
- PipelineManager/policies_crud.py +772 -0
- PipelineManager/sim_keystore.py +319 -0
- PipelineManager/simulation.py +1581 -0
- PipelineManager/static/css/codemirror.min.css +1 -0
- PipelineManager/static/css/graph_move.css +79 -0
- PipelineManager/static/css/monokai.min.css +1 -0
- PipelineManager/static/css/move_mode.css +144 -0
- PipelineManager/static/css/show-hint.min.css +1 -0
- PipelineManager/static/images/age.png +0 -0
- PipelineManager/static/images/aggregate.png +0 -0
- PipelineManager/static/images/alter.png +0 -0
- PipelineManager/static/images/azure_event_hubs.png +0 -0
- PipelineManager/static/images/beats.png +0 -0
- PipelineManager/static/images/boundary.png +0 -0
- PipelineManager/static/images/bytes.png +0 -0
- PipelineManager/static/images/cidr.png +0 -0
- PipelineManager/static/images/cipher.png +0 -0
- PipelineManager/static/images/circonus.png +0 -0
- PipelineManager/static/images/clone.png +0 -0
- PipelineManager/static/images/cloudwatch.png +0 -0
- PipelineManager/static/images/comment.png +0 -0
- PipelineManager/static/images/continue.png +0 -0
- PipelineManager/static/images/couchdb_changes.png +0 -0
- PipelineManager/static/images/csv.png +0 -0
- PipelineManager/static/images/datadog.png +0 -0
- PipelineManager/static/images/datadog_metrics.png +0 -0
- PipelineManager/static/images/date.png +0 -0
- PipelineManager/static/images/de_dot.png +0 -0
- PipelineManager/static/images/dead_letter_queue.png +0 -0
- PipelineManager/static/images/dissect.png +0 -0
- PipelineManager/static/images/dns.png +0 -0
- PipelineManager/static/images/drop.png +0 -0
- PipelineManager/static/images/dynatrace.png +0 -0
- PipelineManager/static/images/elapsed.png +0 -0
- PipelineManager/static/images/elastic_agent.png +0 -0
- PipelineManager/static/images/elastic_integration.png +0 -0
- PipelineManager/static/images/elastic_serverless_forwarder.png +0 -0
- PipelineManager/static/images/elastic_workplace_search.png +0 -0
- PipelineManager/static/images/elasticsearch.png +0 -0
- PipelineManager/static/images/else.png +0 -0
- PipelineManager/static/images/else_if.png +0 -0
- PipelineManager/static/images/email.png +0 -0
- PipelineManager/static/images/environment.png +0 -0
- PipelineManager/static/images/exec.png +0 -0
- PipelineManager/static/images/extractnumbers.png +0 -0
- PipelineManager/static/images/file.png +0 -0
- PipelineManager/static/images/fingerprint.png +0 -0
- PipelineManager/static/images/ganglia.png +0 -0
- PipelineManager/static/images/gelf.png +0 -0
- PipelineManager/static/images/generator.png +0 -0
- PipelineManager/static/images/geoip.png +0 -0
- PipelineManager/static/images/github.png +0 -0
- PipelineManager/static/images/google_bigquery.png +0 -0
- PipelineManager/static/images/google_cloud_storage.png +0 -0
- PipelineManager/static/images/google_pubsub.png +0 -0
- PipelineManager/static/images/graphite.png +0 -0
- PipelineManager/static/images/graphtastic.png +0 -0
- PipelineManager/static/images/grok.png +0 -0
- PipelineManager/static/images/heartbeat.png +0 -0
- PipelineManager/static/images/http.png +0 -0
- PipelineManager/static/images/http_poller.png +0 -0
- PipelineManager/static/images/i18n.png +0 -0
- PipelineManager/static/images/if.png +0 -0
- PipelineManager/static/images/imap.png +0 -0
- PipelineManager/static/images/influxdb.png +0 -0
- PipelineManager/static/images/irc.png +0 -0
- PipelineManager/static/images/java_generator.png +0 -0
- PipelineManager/static/images/java_stdin.png +0 -0
- PipelineManager/static/images/java_stdout.png +0 -0
- PipelineManager/static/images/java_uuid.png +0 -0
- PipelineManager/static/images/jdbc.png +0 -0
- PipelineManager/static/images/jdbc_static.png +0 -0
- PipelineManager/static/images/jdbc_streaming.png +0 -0
- PipelineManager/static/images/jms.png +0 -0
- PipelineManager/static/images/jmx.png +0 -0
- PipelineManager/static/images/json.png +0 -0
- PipelineManager/static/images/json_encode.png +0 -0
- PipelineManager/static/images/juggernaut.png +0 -0
- PipelineManager/static/images/kafka.png +0 -0
- PipelineManager/static/images/kinesis.png +0 -0
- PipelineManager/static/images/kv.png +0 -0
- PipelineManager/static/images/librato.png +0 -0
- PipelineManager/static/images/log4j.png +0 -0
- PipelineManager/static/images/loggly.png +0 -0
- PipelineManager/static/images/logstash.png +0 -0
- PipelineManager/static/images/lumberjack.png +0 -0
- PipelineManager/static/images/meetup.png +0 -0
- PipelineManager/static/images/memcached.png +0 -0
- PipelineManager/static/images/metriccatcher.png +0 -0
- PipelineManager/static/images/metricize.png +0 -0
- PipelineManager/static/images/metrics.png +0 -0
- PipelineManager/static/images/mongodb.png +0 -0
- PipelineManager/static/images/mutate.png +0 -0
- PipelineManager/static/images/nagios.png +0 -0
- PipelineManager/static/images/nagios_nsca.png +0 -0
- PipelineManager/static/images/opentsdb.png +0 -0
- PipelineManager/static/images/pagerduty.png +0 -0
- PipelineManager/static/images/pipe.png +0 -0
- PipelineManager/static/images/pipeline.png +0 -0
- PipelineManager/static/images/prune.png +0 -0
- PipelineManager/static/images/puppet_facter.png +0 -0
- PipelineManager/static/images/rabbitmq.png +0 -0
- PipelineManager/static/images/range.png +0 -0
- PipelineManager/static/images/redis.png +0 -0
- PipelineManager/static/images/redmine.png +0 -0
- PipelineManager/static/images/relp.png +0 -0
- PipelineManager/static/images/riak.png +0 -0
- PipelineManager/static/images/riemann.png +0 -0
- PipelineManager/static/images/rss.png +0 -0
- PipelineManager/static/images/ruby.png +0 -0
- PipelineManager/static/images/s3-sns-sqs.png +0 -0
- PipelineManager/static/images/s3.png +0 -0
- PipelineManager/static/images/salesforce.png +0 -0
- PipelineManager/static/images/sink.png +0 -0
- PipelineManager/static/images/sleep.png +0 -0
- PipelineManager/static/images/snmp.png +0 -0
- PipelineManager/static/images/snmptrap.png +0 -0
- PipelineManager/static/images/sns.png +0 -0
- PipelineManager/static/images/solr_http.png +0 -0
- PipelineManager/static/images/split.png +0 -0
- PipelineManager/static/images/sqlite.png +0 -0
- PipelineManager/static/images/sqs.png +0 -0
- PipelineManager/static/images/statsd.png +0 -0
- PipelineManager/static/images/stdin.png +0 -0
- PipelineManager/static/images/stdout.png +0 -0
- PipelineManager/static/images/stomp.png +0 -0
- PipelineManager/static/images/syslog.png +0 -0
- PipelineManager/static/images/syslog_pri.png +0 -0
- PipelineManager/static/images/tcp.png +0 -0
- PipelineManager/static/images/threats_classifier.png +0 -0
- PipelineManager/static/images/throttle.png +0 -0
- PipelineManager/static/images/timber.png +0 -0
- PipelineManager/static/images/tld.png +0 -0
- PipelineManager/static/images/translate.png +0 -0
- PipelineManager/static/images/truncate.png +0 -0
- PipelineManager/static/images/twitter.png +0 -0
- PipelineManager/static/images/udp.png +0 -0
- PipelineManager/static/images/unix.png +0 -0
- PipelineManager/static/images/urldecode.png +0 -0
- PipelineManager/static/images/useragent.png +0 -0
- PipelineManager/static/images/uuid.png +0 -0
- PipelineManager/static/images/varnishlog.png +0 -0
- PipelineManager/static/images/webhdfs.png +0 -0
- PipelineManager/static/images/websocket.png +0 -0
- PipelineManager/static/images/wmi.png +0 -0
- PipelineManager/static/images/wurfl_device_detection.png +0 -0
- PipelineManager/static/images/xml.png +0 -0
- PipelineManager/static/images/xmpp.png +0 -0
- PipelineManager/static/images/zabbix.png +0 -0
- PipelineManager/static/js/agent_inspect_modal.js +141 -0
- PipelineManager/static/js/agent_policies.js +3746 -0
- PipelineManager/static/js/agent_status_sse.js +166 -0
- PipelineManager/static/js/codemirror.min.js +1 -0
- PipelineManager/static/js/connections_table.js +551 -0
- PipelineManager/static/js/d3.v7.js +20625 -0
- PipelineManager/static/js/diff_modal.js +995 -0
- PipelineManager/static/js/expression_editor.js +291 -0
- PipelineManager/static/js/js-yaml.min.js +1 -0
- PipelineManager/static/js/logstashyml_guides.js +1063 -0
- PipelineManager/static/js/move_graph.js +577 -0
- PipelineManager/static/js/move_mode.js +559 -0
- PipelineManager/static/js/pipeline_editor.js +4102 -0
- PipelineManager/static/js/pipeline_graph_editor.js +3542 -0
- PipelineManager/static/js/pipeline_list.js +274 -0
- PipelineManager/static/js/pipeline_settings.js +121 -0
- PipelineManager/static/js/pipeline_text_editor.js +2088 -0
- PipelineManager/static/js/plugin_config_modal.js +2827 -0
- PipelineManager/static/js/policy_deploy_modal.js +1066 -0
- PipelineManager/static/js/show-hint.min.js +1 -0
- PipelineManager/static/js/sim_targets.js +380 -0
- PipelineManager/static/js/simple-comment-mode.js +56 -0
- PipelineManager/static/js/simulation_modal.js +1135 -0
- PipelineManager/static/js/simulation_results.js +2778 -0
- PipelineManager/static/js/stats_strip.js +231 -0
- PipelineManager/static/js/yaml.js +120 -0
- PipelineManager/system_policy_defaults.py +279 -0
- PipelineManager/templates/components/pipeline_editor/diff_modal.html +127 -0
- PipelineManager/templates/components/pipeline_editor/expression_editor.html +160 -0
- PipelineManager/templates/components/pipeline_editor/plugin_config_modal.html +119 -0
- PipelineManager/templates/components/pipeline_editor/plugin_modal.html +1016 -0
- PipelineManager/templates/components/pipeline_editor/simulation_modal.html +394 -0
- PipelineManager/templates/components/pipeline_editor/simulation_results.html +123 -0
- PipelineManager/templates/components/pipeline_editor/stats_strip.html +123 -0
- PipelineManager/templates/components/pipeline_editor/view_code_modal.html +133 -0
- PipelineManager/templates/components/pipeline_manager/agent_inspect_content.html +805 -0
- PipelineManager/templates/components/pipeline_manager/agent_inspect_modal.html +40 -0
- PipelineManager/templates/components/pipeline_manager/agent_policies.html +2421 -0
- PipelineManager/templates/components/pipeline_manager/change_policy_modal.html +210 -0
- PipelineManager/templates/components/pipeline_manager/collapsible_row.html +11 -0
- PipelineManager/templates/components/pipeline_manager/connection_modal.html +1361 -0
- PipelineManager/templates/components/pipeline_manager/keystore_modal.html +269 -0
- PipelineManager/templates/components/pipeline_manager/logstashyml_guides/centralized_pipeline_management.html +291 -0
- PipelineManager/templates/components/pipeline_manager/logstashyml_guides/default.html +166 -0
- PipelineManager/templates/components/pipeline_manager/mcp_modal.html +241 -0
- PipelineManager/templates/components/pipeline_manager/pipeline_list_content.html +586 -0
- PipelineManager/templates/components/pipeline_manager/policy_deploy_modal.html +238 -0
- PipelineManager/templates/pipeline_editor.html +1738 -0
- PipelineManager/templates/pipeline_graph_editor.html +99 -0
- PipelineManager/templates/pipeline_manager.html +584 -0
- PipelineManager/templates/pipeline_text_editor.html +350 -0
- PipelineManager/urls.py +99 -0
- SNMP/__init__.py +0 -0
- SNMP/ai_template_generation.py +232 -0
- SNMP/apps.py +9 -0
- SNMP/assets/device_template_generation/agents/snmp-profile-author.json +15 -0
- SNMP/assets/device_template_generation/skills/snmp-catalog.json +9 -0
- SNMP/data/authoring_instructions.md +65 -0
- SNMP/data/grounding/.gitignore +4 -0
- SNMP/data/grounding/build_grounding.py +35 -0
- SNMP/data/grounding/grounding.json +1 -0
- SNMP/data/grounding/sample_agent_payload.cisco2960x.json +2184 -0
- SNMP/data/mib_reference/std_bgp4_mib.json +43 -0
- SNMP/data/mib_reference/std_entity_sensors.json +28 -0
- SNMP/data/mib_reference/std_host_resources.json +32 -0
- SNMP/data/mib_reference/std_ospf_mib.json +55 -0
- SNMP/data/mib_reference/std_ucd_linux.json +27 -0
- SNMP/data/normalizers.json +103 -0
- SNMP/data/official_device_templates/arista_eos.json +24 -0
- SNMP/data/official_device_templates/aruba_wireless_controller.json +23 -0
- SNMP/data/official_device_templates/brocade_fc_switch.json +20 -0
- SNMP/data/official_device_templates/cisco_ios.json +21 -0
- SNMP/data/official_device_templates/default.json +13 -0
- SNMP/data/official_device_templates/dell_idrac.json +22 -0
- SNMP/data/official_device_templates/dell_x1026.json +16 -0
- SNMP/data/official_device_templates/dlink_dgs1210_switch.json +19 -0
- SNMP/data/official_device_templates/eastpower_ups.json +20 -0
- SNMP/data/official_device_templates/eaton_ups.json +22 -0
- SNMP/data/official_device_templates/epson_printer.json +18 -0
- SNMP/data/official_device_templates/geist_watchdog.json +20 -0
- SNMP/data/official_device_templates/generic_linux.json +18 -0
- SNMP/data/official_device_templates/generic_ont.json +18 -0
- SNMP/data/official_device_templates/generic_ups.json +16 -0
- SNMP/data/official_device_templates/hp_laserjet_mfp_m281cdw.json +18 -0
- SNMP/data/official_device_templates/hpe_nimble.json +17 -0
- SNMP/data/official_device_templates/huawei_ups.json +19 -0
- SNMP/data/official_device_templates/ingrasys_ups.json +19 -0
- SNMP/data/official_device_templates/isilon_onefs.json +22 -0
- SNMP/data/official_device_templates/mellanox_sx6036.json +20 -0
- SNMP/data/official_device_templates/netapp_7mode.json +22 -0
- SNMP/data/official_device_templates/palo_alto_firewall.json +21 -0
- SNMP/data/official_device_templates/phoenixtec_ups.json +18 -0
- SNMP/data/official_device_templates/ubiquiti_unifi_ap.json +19 -0
- SNMP/data/official_device_templates/ubiquiti_unifi_switch.json +18 -0
- SNMP/data/official_device_templates/ubiquiti_unifi_udm.json +19 -0
- SNMP/data/official_device_templates/versa_flexvnf_appliance.json +19 -0
- SNMP/data/official_profiles/arista_eos.json +16 -0
- SNMP/data/official_profiles/aruba_wireless_controller.json +145 -0
- SNMP/data/official_profiles/brocade_fibre_channel_switch_fibre_channel_ports.json +35 -0
- SNMP/data/official_profiles/brocade_fibre_channel_switch_name_server.json +23 -0
- SNMP/data/official_profiles/brocade_fibre_channel_switch_system_metrics.json +36 -0
- SNMP/data/official_profiles/cisco_cdp.json +26 -0
- SNMP/data/official_profiles/cisco_fans.json +18 -0
- SNMP/data/official_profiles/cisco_sensors.json +21 -0
- SNMP/data/official_profiles/cisco_system_metrics.json +40 -0
- SNMP/data/official_profiles/dell_idrac_cpu.json +19 -0
- SNMP/data/official_profiles/dell_idrac_fans.json +20 -0
- SNMP/data/official_profiles/dell_idrac_global_status.json +13 -0
- SNMP/data/official_profiles/dell_idrac_memory.json +20 -0
- SNMP/data/official_profiles/dell_idrac_power_supply.json +19 -0
- SNMP/data/official_profiles/dell_idrac_raid_controller.json +19 -0
- SNMP/data/official_profiles/dlink_dgs1210.json +15 -0
- SNMP/data/official_profiles/dlink_dgs1210_system_metrics.json +38 -0
- SNMP/data/official_profiles/eaton_ups.json +40 -0
- SNMP/data/official_profiles/geist_environment.json +50 -0
- SNMP/data/official_profiles/generic_arp.json +19 -0
- SNMP/data/official_profiles/generic_bgp.json +24 -0
- SNMP/data/official_profiles/generic_entity_psu.json +26 -0
- SNMP/data/official_profiles/generic_entity_sensor.json +22 -0
- SNMP/data/official_profiles/generic_host_system_metrics.json +68 -0
- SNMP/data/official_profiles/generic_interfaces.json +86 -0
- SNMP/data/official_profiles/generic_ip_addr.json +19 -0
- SNMP/data/official_profiles/generic_lldp.json +54 -0
- SNMP/data/official_profiles/generic_lm_sensors.json +37 -0
- SNMP/data/official_profiles/generic_mac_table.json +19 -0
- SNMP/data/official_profiles/generic_ont.json +88 -0
- SNMP/data/official_profiles/generic_ospf.json +21 -0
- SNMP/data/official_profiles/generic_printer_mib.json +48 -0
- SNMP/data/official_profiles/generic_rmon.json +38 -0
- SNMP/data/official_profiles/generic_system.json +17 -0
- SNMP/data/official_profiles/generic_ucd_system_metrics.json +63 -0
- SNMP/data/official_profiles/generic_ups_mib.json +154 -0
- SNMP/data/official_profiles/hpe_nimble_volumes.json +59 -0
- SNMP/data/official_profiles/huawei_ups.json +111 -0
- SNMP/data/official_profiles/isilon_performance.json +92 -0
- SNMP/data/official_profiles/isilon_protocols.json +77 -0
- SNMP/data/official_profiles/isilon_system.json +86 -0
- SNMP/data/official_profiles/mellanox_mlnx_os.json +15 -0
- SNMP/data/official_profiles/netapp_7mode_data_protection.json +106 -0
- SNMP/data/official_profiles/netapp_7mode_disks.json +51 -0
- SNMP/data/official_profiles/netapp_7mode_protocols.json +66 -0
- SNMP/data/official_profiles/netapp_7mode_system.json +92 -0
- SNMP/data/official_profiles/netapp_7mode_volumes.json +166 -0
- SNMP/data/official_profiles/paloalto_components.json +36 -0
- SNMP/data/official_profiles/paloalto_system.json +15 -0
- SNMP/data/official_profiles/traps.json +16 -0
- SNMP/data/official_profiles/ubiquiti_unifi_switch.json +18 -0
- SNMP/data/official_profiles/ubiquiti_unifi_switch_system.json +14 -0
- SNMP/data/official_profiles/ubiquiti_unifi_wireless.json +60 -0
- SNMP/data/official_profiles/versa_flexvnf.json +14 -0
- SNMP/data/schema.md +650 -0
- SNMP/data/schema_reference/snmp_field_schema.md +747 -0
- SNMP/data/snmp_template.json +629 -0
- SNMP/data/template_profile_context.md +3986 -0
- SNMP/inline_grounding.py +77 -0
- SNMP/management/__init__.py +1 -0
- SNMP/management/commands/__init__.py +1 -0
- SNMP/management/commands/generate_template_profile_context.py +272 -0
- SNMP/management/commands/load_test_snmp_data.py +240 -0
- SNMP/management/commands/sync_snmp_official_data.py +263 -0
- SNMP/management/commands/unload_test_snmp_data.py +77 -0
- SNMP/migrations/0001_initial.py +101 -0
- SNMP/migrations/0002_devicetemplate.py +34 -0
- SNMP/migrations/0003_remove_devicetemplate_type_remove_profile_type_and_more.py +31 -0
- SNMP/migrations/0004_device_device_template.py +19 -0
- SNMP/migrations/0005_devicetemplate_product_profile_product.py +23 -0
- SNMP/migrations/0006_alter_devicetemplate_model_and_more.py +28 -0
- SNMP/migrations/0007_remove_device_profiles.py +17 -0
- SNMP/migrations/0008_devicetemplate_type.py +18 -0
- SNMP/migrations/0009_alter_device_device_template.py +19 -0
- SNMP/migrations/0010_alter_device_device_template.py +19 -0
- SNMP/migrations/0011_network_namespace.py +18 -0
- SNMP/migrations/0012_profile_normalizers.py +18 -0
- SNMP/migrations/0013_snmpdeploymentstate.py +26 -0
- SNMP/migrations/0014_alter_snmpdeploymentstate_last_config_change.py +18 -0
- SNMP/migrations/0015_alter_snmpdeploymentstate_last_config_change.py +20 -0
- SNMP/migrations/0016_alter_snmpdeploymentstate_last_config_change.py +18 -0
- SNMP/migrations/0017_remove_network_logstash_name.py +17 -0
- SNMP/migrations/0018_add_official_key.py +39 -0
- SNMP/migrations/0019_network_namespace_from_device_template.py +18 -0
- SNMP/migrations/0020_device_hostname_alter_device_ip_address_and_more.py +27 -0
- SNMP/migrations/0021_device_building_device_latitude_device_longitude_and_more.py +43 -0
- SNMP/migrations/0022_alter_device_latitude_alter_device_longitude.py +23 -0
- SNMP/migrations/0023_network_agent_connection_network_deployment_mode_and_more.py +30 -0
- SNMP/migrations/0024_network_credential_mode.py +18 -0
- SNMP/migrations/0025_network_ssl_certificate_authorities.py +18 -0
- SNMP/migrations/__init__.py +0 -0
- SNMP/models.py +892 -0
- SNMP/network_map.py +660 -0
- SNMP/overview.py +394 -0
- SNMP/snmp_crud.py +6082 -0
- SNMP/snmp_grounding.py +146 -0
- SNMP/snmp_normalizers.py +594 -0
- SNMP/snmp_pipeline_generator.py +1658 -0
- SNMP/snmp_test.py +962 -0
- SNMP/static/css/snmp.css +33 -0
- SNMP/static/images/apc.png +0 -0
- SNMP/static/images/arista.png +0 -0
- SNMP/static/images/aruba.png +0 -0
- SNMP/static/images/brocade.png +0 -0
- SNMP/static/images/cisco.png +0 -0
- SNMP/static/images/dell.png +0 -0
- SNMP/static/images/dlink.png +0 -0
- SNMP/static/images/east.png +0 -0
- SNMP/static/images/eaton.png +0 -0
- SNMP/static/images/epson.png +0 -0
- SNMP/static/images/hauwei.png +0 -0
- SNMP/static/images/hp.png +0 -0
- SNMP/static/images/hpe.png +0 -0
- SNMP/static/images/ingrasys.png +0 -0
- SNMP/static/images/linux.png +0 -0
- SNMP/static/images/mellanox.png +0 -0
- SNMP/static/images/netapp.png +0 -0
- SNMP/static/images/paloalto.png +0 -0
- SNMP/static/images/phoenixtec.png +0 -0
- SNMP/static/images/ubiquiti.png +0 -0
- SNMP/static/images/unknown.png +0 -0
- SNMP/static/images/versa.png +0 -0
- SNMP/static/images/vertiv.png +0 -0
- SNMP/static/js/ai_device_template_modal.js +1116 -0
- SNMP/static/js/credentials_table.js +291 -0
- SNMP/static/js/devices_table.js +588 -0
- SNMP/static/js/discovered_devices.js +291 -0
- SNMP/static/js/network_map.js +1657 -0
- SNMP/static/js/networks_table.js +360 -0
- SNMP/static/js/onboarding.js +866 -0
- SNMP/static/js/overview.js +416 -0
- SNMP/static/js/snmp_changes_indicator.js +76 -0
- SNMP/static/js/snmp_commit_modal.js +39 -0
- SNMP/static/js/snmp_credentials_modal.js +217 -0
- SNMP/static/js/snmp_device_template_modal.js +669 -0
- SNMP/static/js/snmp_device_visual_preview.js +1707 -0
- SNMP/static/js/snmp_devices_modal.js +912 -0
- SNMP/static/js/snmp_diff_modal.js +1559 -0
- SNMP/static/js/snmp_network_modal.js +940 -0
- SNMP/static/js/snmp_profile_modal.js +1212 -0
- SNMP/static/js/snmp_profile_modal_helpers.js +17 -0
- SNMP/static/js/snmp_test.js +538 -0
- SNMP/templates/Credentials.html +325 -0
- SNMP/templates/DeviceTemplates.html +1059 -0
- SNMP/templates/Devices.html +274 -0
- SNMP/templates/Networks.html +469 -0
- SNMP/templates/Onboarding.html +521 -0
- SNMP/templates/Overview.html +227 -0
- SNMP/templates/components/ai_device_template_modal.html +46 -0
- SNMP/templates/components/ai_generate_template_content.html +224 -0
- SNMP/templates/components/device_template_profile_modal.html +60 -0
- SNMP/templates/components/discovered_devices_content.html +86 -0
- SNMP/templates/components/discovered_devices_modal.html +43 -0
- SNMP/templates/components/gmaps_latlon_modal.html +93 -0
- SNMP/templates/components/network_map.html +110 -0
- SNMP/templates/components/snmp_commit_modal.html +53 -0
- SNMP/templates/components/snmp_credentials_modal.html +189 -0
- SNMP/templates/components/snmp_device_modal.html +6 -0
- SNMP/templates/components/snmp_device_template_modal.html +129 -0
- SNMP/templates/components/snmp_device_visual_preview.html +347 -0
- SNMP/templates/components/snmp_devices_modal.html +330 -0
- SNMP/templates/components/snmp_diff_modal.html +148 -0
- SNMP/templates/components/snmp_network_modal.html +380 -0
- SNMP/templates/components/snmp_profile_modal.html +147 -0
- SNMP/templates/components/snmp_test_modal.html +398 -0
- SNMP/templatetags/__init__.py +0 -0
- SNMP/templatetags/snmp_extras.py +17 -0
- SNMP/urls.py +94 -0
- SNMP/views.py +913 -0
- Site/__init__.py +0 -0
- Site/apps.py +9 -0
- Site/migrations/__init__.py +0 -0
- Site/product_ca_views.py +41 -0
- Site/static/images/ElasticIcon.png +0 -0
- Site/static/images/LoggyIcon.png +0 -0
- Site/static/images/LoggyWizardIcon.png +0 -0
- Site/static/images/LogstashAgentIcon.png +0 -0
- Site/static/images/LogstashIcon.png +0 -0
- Site/static/js/base.js +192 -0
- Site/static/js/marked.min.js +69 -0
- Site/templates/base.html +52 -0
- Site/templates/error.html +65 -0
- Site/templates/home.html +148 -0
- Site/templates/navigation.html +530 -0
- Site/templates/popup.html +251 -0
- Site/templatetags/__init__.py +0 -0
- Site/templatetags/custom_filters.py +36 -0
- Site/urls.py +21 -0
- Site/views.py +200 -0
- Utilities/__init__.py +0 -0
- Utilities/apps.py +9 -0
- Utilities/data/grok-patterns/LICENSE +202 -0
- Utilities/data/grok-patterns/ecs-v1/aws +33 -0
- Utilities/data/grok-patterns/ecs-v1/bacula +53 -0
- Utilities/data/grok-patterns/ecs-v1/bind +13 -0
- Utilities/data/grok-patterns/ecs-v1/bro +30 -0
- Utilities/data/grok-patterns/ecs-v1/exim +26 -0
- Utilities/data/grok-patterns/ecs-v1/firewalls +111 -0
- Utilities/data/grok-patterns/ecs-v1/grok-patterns +95 -0
- Utilities/data/grok-patterns/ecs-v1/haproxy +40 -0
- Utilities/data/grok-patterns/ecs-v1/httpd +17 -0
- Utilities/data/grok-patterns/ecs-v1/java +34 -0
- Utilities/data/grok-patterns/ecs-v1/junos +13 -0
- Utilities/data/grok-patterns/ecs-v1/linux-syslog +16 -0
- Utilities/data/grok-patterns/ecs-v1/maven +1 -0
- Utilities/data/grok-patterns/ecs-v1/mcollective +4 -0
- Utilities/data/grok-patterns/ecs-v1/mongodb +7 -0
- Utilities/data/grok-patterns/ecs-v1/nagios +124 -0
- Utilities/data/grok-patterns/ecs-v1/postgresql +2 -0
- Utilities/data/grok-patterns/ecs-v1/rails +13 -0
- Utilities/data/grok-patterns/ecs-v1/redis +3 -0
- Utilities/data/grok-patterns/ecs-v1/ruby +2 -0
- Utilities/data/grok-patterns/ecs-v1/squid +6 -0
- Utilities/data/grok-patterns/ecs-v1/zeek +33 -0
- Utilities/data/grok-patterns/legacy/aws +14 -0
- Utilities/data/grok-patterns/legacy/bacula +50 -0
- Utilities/data/grok-patterns/legacy/bind +3 -0
- Utilities/data/grok-patterns/legacy/bro +13 -0
- Utilities/data/grok-patterns/legacy/exim +19 -0
- Utilities/data/grok-patterns/legacy/firewalls +91 -0
- Utilities/data/grok-patterns/legacy/grok-patterns +95 -0
- Utilities/data/grok-patterns/legacy/haproxy +39 -0
- Utilities/data/grok-patterns/legacy/httpd +15 -0
- Utilities/data/grok-patterns/legacy/java +17 -0
- Utilities/data/grok-patterns/legacy/junos +9 -0
- Utilities/data/grok-patterns/legacy/linux-syslog +16 -0
- Utilities/data/grok-patterns/legacy/maven +1 -0
- Utilities/data/grok-patterns/legacy/mcollective +1 -0
- Utilities/data/grok-patterns/legacy/mcollective-patterns +4 -0
- Utilities/data/grok-patterns/legacy/mongodb +7 -0
- Utilities/data/grok-patterns/legacy/nagios +124 -0
- Utilities/data/grok-patterns/legacy/postgresql +3 -0
- Utilities/data/grok-patterns/legacy/rails +13 -0
- Utilities/data/grok-patterns/legacy/redis +3 -0
- Utilities/data/grok-patterns/legacy/ruby +2 -0
- Utilities/data/grok-patterns/legacy/squid +4 -0
- Utilities/dissect.py +302 -0
- Utilities/grok.py +412 -0
- Utilities/migrations/__init__.py +0 -0
- Utilities/static/css/debugger_editor.css +88 -0
- Utilities/static/js/debugger_editor.js +93 -0
- Utilities/static/js/grok_debugger.js +131 -0
- Utilities/templates/dissect_debugger.html +95 -0
- Utilities/templates/grok_debugger.html +99 -0
- Utilities/urls.py +14 -0
- Utilities/views.py +363 -0
- logstashui-0.5.5.dev0.dist-info/METADATA +333 -0
- logstashui-0.5.5.dev0.dist-info/RECORD +762 -0
- logstashui-0.5.5.dev0.dist-info/WHEEL +4 -0
- logstashui-0.5.5.dev0.dist-info/entry_points.txt +2 -0
- logstashui-0.5.5.dev0.dist-info/licenses/LICENSE.txt +93 -0
- logstashui-0.5.5.dev0.dist-info/licenses/NOTICE.txt +2772 -0
- theme/__init__.py +0 -0
- theme/apps.py +9 -0
- theme/package-lock.json +6 -0
- theme/static/css/dist/styles.css +2 -0
- theme/static/images/favicon.ico +0 -0
- theme/static_src/.gitignore +1 -0
- theme/static_src/package-lock.json +1930 -0
- theme/static_src/package.json +26 -0
- theme/static_src/postcss.config.js +7 -0
- theme/static_src/src/styles.css +38 -0
- theme/static_src/tailwind.config.js +43 -0
- theme/templates/base.html +32 -0
|
@@ -0,0 +1,1059 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License;
|
|
4
|
+
* you may not use this file except in compliance with the Elastic License.
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
{% extends "base.html" %}
|
|
8
|
+
{% load static %}
|
|
9
|
+
|
|
10
|
+
{% block content %}
|
|
11
|
+
<link rel="stylesheet" href="{% static 'css/snmp.css' %}">
|
|
12
|
+
|
|
13
|
+
<div class="p-6">
|
|
14
|
+
<!-- Header with Add Button -->
|
|
15
|
+
<div class="page-header flex justify-between items-center mb-6">
|
|
16
|
+
<div class="flex items-center gap-2">
|
|
17
|
+
<h1 class="text-2xl font-bold text-white">Device Templates & Profiles</h1>
|
|
18
|
+
<div class="group relative inline-block">
|
|
19
|
+
<svg class="w-5 h-5 text-gray-400 hover:text-blue-400 cursor-help transition-colors" fill="currentColor" viewBox="0 0 20 20">
|
|
20
|
+
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
|
|
21
|
+
</svg>
|
|
22
|
+
<div class="invisible group-hover:visible opacity-0 group-hover:opacity-100 transition-opacity duration-200 absolute left-0 top-full mt-2 w-96 bg-gray-800 border border-gray-600 rounded-lg shadow-xl p-4 z-50">
|
|
23
|
+
<h4 class="text-sm font-semibold text-white mb-2">Device Templates & Profiles</h4>
|
|
24
|
+
<p class="text-xs text-gray-300 mb-2"><strong>Device Templates</strong> define which SNMP metrics to collect from devices. They include vendor/model information, matching rules for auto-assignment, and associated profiles.</p>
|
|
25
|
+
<p class="text-xs text-gray-300"><strong>Profiles</strong> define the actual SNMP OIDs and metrics to collect, including GET operations for scalar values and TABLE operations for tabular data.</p>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="flex gap-2 items-center">
|
|
30
|
+
<!-- Undeployed changes indicator -->
|
|
31
|
+
<div id="snmpUndeployedIndicator" class="hidden flex items-center gap-1 px-2 py-1 bg-orange-500/20 border border-orange-500/40 rounded-full">
|
|
32
|
+
<div class="w-1.5 h-1.5 bg-orange-400 rounded-full animate-pulse"></div>
|
|
33
|
+
<span class="text-xs text-orange-300 font-medium whitespace-nowrap">Undeployed changes</span>
|
|
34
|
+
</div>
|
|
35
|
+
{% if user.profile.role == 'admin' %}
|
|
36
|
+
<button id="generateTemplateBtn" class="btn border border-purple-400 text-purple-300 hover:bg-purple-400/10 flex items-center gap-x-2">
|
|
37
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
38
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z" />
|
|
39
|
+
</svg>
|
|
40
|
+
Generate Template and Profiles
|
|
41
|
+
</button>
|
|
42
|
+
{% endif %}
|
|
43
|
+
<button id="testSnmpBtn" class="btn border border-white text-white hover:bg-white/10 flex items-center gap-x-2">
|
|
44
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
45
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4" />
|
|
46
|
+
</svg>
|
|
47
|
+
Test SNMP
|
|
48
|
+
</button>
|
|
49
|
+
{% if user.profile.role == 'admin' %}
|
|
50
|
+
<button id="commitBtn" class="btn bg-green-600 hover:bg-green-700 text-white flex items-center gap-x-2">
|
|
51
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
52
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
|
|
53
|
+
</svg>
|
|
54
|
+
Deploy Changes
|
|
55
|
+
</button>
|
|
56
|
+
<button id="addItemBtn" class="btn btn-primary flex items-center justify-center gap-x-2 w-56">
|
|
57
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
58
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
|
|
59
|
+
</svg>
|
|
60
|
+
<span id="addItemBtnText">Add Device Template</span>
|
|
61
|
+
</button>
|
|
62
|
+
{% endif %}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<!-- Tabs -->
|
|
67
|
+
<div class="mb-6">
|
|
68
|
+
<div class="border-b border-gray-700">
|
|
69
|
+
<nav class="-mb-px flex space-x-8" aria-label="Tabs">
|
|
70
|
+
<button id="deviceTemplatesTab" class="tab-button active border-b-2 border-primary py-4 px-1 text-sm font-medium text-primary">
|
|
71
|
+
Device Templates
|
|
72
|
+
</button>
|
|
73
|
+
<button id="profilesTab" class="tab-button border-b-2 border-transparent py-4 px-1 text-sm font-medium text-gray-400 hover:text-gray-300 hover:border-gray-300">
|
|
74
|
+
Profiles
|
|
75
|
+
</button>
|
|
76
|
+
</nav>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<!-- Device Templates Tab Content -->
|
|
81
|
+
<div id="deviceTemplatesContent">
|
|
82
|
+
<!-- Search and Filter Bar for Device Templates -->
|
|
83
|
+
<div class="bg-gray-800 rounded-lg p-4 mb-4 mt-4 shadow-xl">
|
|
84
|
+
<div class="flex gap-4 items-end">
|
|
85
|
+
<!-- Search (48%) -->
|
|
86
|
+
<div style="flex: 0 0 48%;">
|
|
87
|
+
<label for="templateSearchInput" class="block text-sm font-medium text-gray-300 mb-2">Search</label>
|
|
88
|
+
<input type="text" id="templateSearchInput" placeholder="Search by name or description..." class="input input-bordered w-full">
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<!-- Vendor Filter (24%) -->
|
|
92
|
+
<div style="flex: 0 0 24%;">
|
|
93
|
+
<label for="templateVendorFilter" class="block text-sm font-medium text-gray-300 mb-2">Filter by Vendor</label>
|
|
94
|
+
<select id="templateVendorFilter" class="select select-bordered w-full">
|
|
95
|
+
<option value="">All Vendors</option>
|
|
96
|
+
</select>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<!-- Product Filter (24%) -->
|
|
100
|
+
<div style="flex: 0 0 24%;">
|
|
101
|
+
<label for="templateProductFilter" class="block text-sm font-medium text-gray-300 mb-2">Filter by Product</label>
|
|
102
|
+
<select id="templateProductFilter" class="select select-bordered w-full">
|
|
103
|
+
<option value="">All Products</option>
|
|
104
|
+
</select>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<div class="mt-6">
|
|
110
|
+
{% if device_templates %}
|
|
111
|
+
<div id="templatesGridContainer" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-4">
|
|
112
|
+
{% for template in device_templates %}
|
|
113
|
+
<div class="bg-gray-800 rounded-lg shadow-xl overflow-hidden hover:shadow-2xl transition-shadow border border-gray-700"
|
|
114
|
+
data-template-name="{{ template.name|lower }}"
|
|
115
|
+
data-template-description="{{ template.description|lower }}"
|
|
116
|
+
data-template-vendor="{{ template.vendor|default:'Unknown' }}"
|
|
117
|
+
data-template-product="{{ template.product|default:'' }}">
|
|
118
|
+
<!-- Card Header with Logo and Actions -->
|
|
119
|
+
<div class="relative p-4 bg-gradient-to-br from-gray-700 to-gray-800 border-b border-gray-600">
|
|
120
|
+
<!-- 3-dot menu in top-right corner -->
|
|
121
|
+
<div class="absolute top-2 right-2">
|
|
122
|
+
<div class="action-menu relative">
|
|
123
|
+
<button class="action-menu-button p-1 hover:bg-gray-600 rounded transition-colors">
|
|
124
|
+
<svg class="h-5 w-5 text-gray-300" fill="currentColor" viewBox="0 0 20 20">
|
|
125
|
+
<path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" />
|
|
126
|
+
</svg>
|
|
127
|
+
</button>
|
|
128
|
+
|
|
129
|
+
<div class="action-menu-items hidden fixed z-50 w-48 bg-gray-800 rounded-md shadow-lg py-1 border border-gray-700" role="menu">
|
|
130
|
+
<div class="px-1 py-1">
|
|
131
|
+
{% if user.profile.role == 'admin' %}
|
|
132
|
+
<button onclick="cloneTemplate('{{ template.id|default:template.name }}', {{ template.official|lower }})" class="group flex items-center w-full px-4 py-2 text-sm text-blue-400 hover:bg-gray-700 rounded-md" role="menuitem">
|
|
133
|
+
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
134
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
|
|
135
|
+
</svg>
|
|
136
|
+
Clone
|
|
137
|
+
</button>
|
|
138
|
+
<hr class="my-1 border-gray-700">
|
|
139
|
+
{% endif %}
|
|
140
|
+
<button onclick="viewTemplate('{{ template.id|default:template.name }}', {{ template.official|lower }})" class="group flex items-center w-full px-4 py-2 text-sm text-gray-300 hover:bg-gray-700 rounded-md" role="menuitem">
|
|
141
|
+
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
142
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
|
143
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
|
144
|
+
</svg>
|
|
145
|
+
View
|
|
146
|
+
</button>
|
|
147
|
+
{% if not template.official and user.profile.role == 'admin' %}
|
|
148
|
+
<hr class="my-1 border-gray-700">
|
|
149
|
+
<button onclick="editTemplate({{ template.id }})" class="group flex items-center w-full px-4 py-2 text-sm text-gray-300 hover:bg-gray-700 rounded-md" role="menuitem">
|
|
150
|
+
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
151
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
|
|
152
|
+
</svg>
|
|
153
|
+
Edit
|
|
154
|
+
</button>
|
|
155
|
+
<hr class="my-1 border-gray-700">
|
|
156
|
+
<button onclick="deleteTemplate({{ template.id }}, '{{ template.name }}')" class="group flex items-center w-full px-4 py-2 text-sm text-red-400 hover:bg-gray-700 rounded-md" role="menuitem">
|
|
157
|
+
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
158
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
|
159
|
+
</svg>
|
|
160
|
+
Delete
|
|
161
|
+
</button>
|
|
162
|
+
{% endif %}
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<!-- Centered Logo -->
|
|
169
|
+
<div class="flex flex-col items-center">
|
|
170
|
+
<!-- Vendor Logo -->
|
|
171
|
+
<div class="flex-shrink-0 w-20 h-20 bg-white rounded-lg p-2.5 flex items-center justify-center">
|
|
172
|
+
{% if template.vendor|lower == 'cisco' %}
|
|
173
|
+
<img src="{% static 'images/cisco.png' %}" alt="Cisco" class="w-full h-full object-contain">
|
|
174
|
+
{% elif template.vendor|lower == 'dell' %}
|
|
175
|
+
<img src="{% static 'images/dell.png' %}" alt="Dell" class="w-full h-full object-contain">
|
|
176
|
+
{% elif template.vendor|lower == 'brocade' %}
|
|
177
|
+
<img src="{% static 'images/brocade.png' %}" alt="Brocade" class="w-full h-full object-contain">
|
|
178
|
+
{% elif template.vendor|lower == 'hpe' or template.vendor|lower == 'hpe nimble' %}
|
|
179
|
+
<img src="{% static 'images/hpe.png' %}" alt="HPE" class="w-full h-full object-contain">
|
|
180
|
+
{% elif template.vendor|lower == 'epson' %}
|
|
181
|
+
<img src="{% static 'images/epson.png' %}" alt="Epson" class="w-full h-full object-contain">
|
|
182
|
+
{% elif template.vendor|lower == 'ubiquiti' %}
|
|
183
|
+
<img src="{% static 'images/ubiquiti.png' %}" alt="Ubiquiti" class="w-full h-full object-contain">
|
|
184
|
+
{% elif template.vendor|lower == 'hp' %}
|
|
185
|
+
<img src="{% static 'images/hp.png' %}" alt="HP" class="w-full h-full object-contain">
|
|
186
|
+
{% elif template.vendor|lower == 'mellanox' %}
|
|
187
|
+
<img src="{% static 'images/mellanox.png' %}" alt="Mellanox" class="w-full h-full object-contain">
|
|
188
|
+
{% elif template.vendor|lower == 'palo alto' %}
|
|
189
|
+
<img src="{% static 'images/paloalto.png' %}" alt="Palo Alto" class="w-full h-full object-contain">
|
|
190
|
+
{% else %}
|
|
191
|
+
<img src="{% static 'images/unknown.png' %}" alt="Unknown Vendor" class="w-full h-full object-contain">
|
|
192
|
+
{% endif %}
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<!-- Card Body -->
|
|
198
|
+
<div class="p-4">
|
|
199
|
+
<!-- Template Name -->
|
|
200
|
+
<h3 class="text-lg font-semibold text-white mb-2 line-clamp-2 min-h-[3.5rem]" title="{{ template.display_name }}">
|
|
201
|
+
{{ template.display_name }}
|
|
202
|
+
</h3>
|
|
203
|
+
|
|
204
|
+
<!-- Description -->
|
|
205
|
+
<p class="text-sm text-gray-400 mb-3 line-clamp-2 min-h-[2.5rem]" title="{{ template.description }}">
|
|
206
|
+
{{ template.description|default:"No description provided" }}
|
|
207
|
+
</p>
|
|
208
|
+
|
|
209
|
+
<!-- Metadata with Official Badge -->
|
|
210
|
+
<div class="flex items-center gap-2 text-xs mb-3">
|
|
211
|
+
{% if template.official %}
|
|
212
|
+
<div class="flex items-center gap-1 px-2 py-0.5 bg-yellow-500/20 border border-yellow-500/40 rounded-full flex-shrink-0" title="Official Template - Provided by the system and cannot be edited or deleted">
|
|
213
|
+
<svg class="w-3 h-3 text-yellow-400" fill="currentColor" viewBox="0 0 20 20">
|
|
214
|
+
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
|
|
215
|
+
</svg>
|
|
216
|
+
</div>
|
|
217
|
+
{% endif %}
|
|
218
|
+
<svg class="w-4 h-4 text-gray-500 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
219
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
|
|
220
|
+
</svg>
|
|
221
|
+
<span class="text-gray-300 truncate">
|
|
222
|
+
<span class="font-medium">{{ template.vendor|default:"Unknown" }}</span>
|
|
223
|
+
{% if template.product %}
|
|
224
|
+
<span class="text-gray-500">•</span>
|
|
225
|
+
<span class="text-gray-400">{{ template.product }}</span>
|
|
226
|
+
{% endif %}
|
|
227
|
+
</span>
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
<!-- Stats: Profiles, Model, and Devices -->
|
|
231
|
+
<div class="flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs pt-2 border-t border-gray-700">
|
|
232
|
+
<div class="flex items-center gap-1 whitespace-nowrap">
|
|
233
|
+
<svg class="w-3.5 h-3.5 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
234
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
|
235
|
+
</svg>
|
|
236
|
+
<span class="text-gray-400">Profiles:</span>
|
|
237
|
+
<span class="text-white font-medium">{{ template.profile_count|default:0 }}</span>
|
|
238
|
+
</div>
|
|
239
|
+
<div class="flex items-center gap-1 whitespace-nowrap">
|
|
240
|
+
<svg class="w-3.5 h-3.5 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
241
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z" />
|
|
242
|
+
</svg>
|
|
243
|
+
<span class="text-gray-400">Model:</span>
|
|
244
|
+
<span class="text-white font-medium">{{ template.model|default:"-" }}</span>
|
|
245
|
+
</div>
|
|
246
|
+
<div class="flex items-center gap-1 whitespace-nowrap">
|
|
247
|
+
<svg class="w-3.5 h-3.5 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
248
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
|
|
249
|
+
</svg>
|
|
250
|
+
<span class="text-gray-400">Devices:</span>
|
|
251
|
+
<span class="inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full {% if template.device_count > 0 %}bg-blue-600 text-white{% else %}bg-gray-700 text-gray-400{% endif %}">
|
|
252
|
+
{{ template.device_count|default:0 }}
|
|
253
|
+
</span>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
{% endfor %}
|
|
259
|
+
</div>
|
|
260
|
+
{% else %}
|
|
261
|
+
<div class="bg-gray-800 rounded-lg shadow-xl p-12 text-center">
|
|
262
|
+
<svg class="w-16 h-16 text-gray-600 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
263
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
|
264
|
+
</svg>
|
|
265
|
+
<p class="text-gray-400 text-lg">No device templates found. Add your first template to get started!</p>
|
|
266
|
+
</div>
|
|
267
|
+
{% endif %}
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<!-- Profiles Tab Content -->
|
|
272
|
+
<div id="profilesContent" class="hidden">
|
|
273
|
+
<!-- Search and Filter Bar for Profiles -->
|
|
274
|
+
<div class="bg-gray-800 rounded-lg p-4 mb-4 mt-4 shadow-xl">
|
|
275
|
+
<div class="flex gap-4 items-end">
|
|
276
|
+
<!-- Search (48%) -->
|
|
277
|
+
<div style="flex: 0 0 48%;">
|
|
278
|
+
<label for="profileSearchInput" class="block text-sm font-medium text-gray-300 mb-2">Search</label>
|
|
279
|
+
<input type="text" id="profileSearchInput" placeholder="Search by name or description..." class="input input-bordered w-full">
|
|
280
|
+
</div>
|
|
281
|
+
|
|
282
|
+
<!-- Vendor Filter (24%) -->
|
|
283
|
+
<div style="flex: 0 0 24%;">
|
|
284
|
+
<label for="profileVendorFilter" class="block text-sm font-medium text-gray-300 mb-2">Filter by Vendor</label>
|
|
285
|
+
<select id="profileVendorFilter" class="select select-bordered w-full">
|
|
286
|
+
<option value="">All Vendors</option>
|
|
287
|
+
</select>
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
<!-- Product Filter (24%) -->
|
|
291
|
+
<div style="flex: 0 0 24%;">
|
|
292
|
+
<label for="profileProductFilter" class="block text-sm font-medium text-gray-300 mb-2">Filter by Product</label>
|
|
293
|
+
<select id="profileProductFilter" class="select select-bordered w-full">
|
|
294
|
+
<option value="">All Products</option>
|
|
295
|
+
</select>
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
<div class="mt-6">
|
|
301
|
+
{% if profiles %}
|
|
302
|
+
<div id="profilesGridContainer" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-4">
|
|
303
|
+
{% for profile in profiles %}
|
|
304
|
+
<div class="bg-gray-800 rounded-lg shadow-xl overflow-hidden hover:shadow-2xl transition-shadow border border-gray-700"
|
|
305
|
+
data-profile-name="{{ profile.display_name|lower }}"
|
|
306
|
+
data-profile-description="{{ profile.description|lower }}"
|
|
307
|
+
data-profile-vendor="{{ profile.vendor|default:'Unknown' }}"
|
|
308
|
+
data-profile-product="{{ profile.product|default:'' }}">
|
|
309
|
+
<!-- Card Header with Logo and Actions -->
|
|
310
|
+
<div class="relative p-4 bg-gradient-to-br from-gray-700 to-gray-800 border-b border-gray-600">
|
|
311
|
+
<!-- 3-dot menu in top-right corner -->
|
|
312
|
+
<div class="absolute top-2 right-2">
|
|
313
|
+
<div class="action-menu relative">
|
|
314
|
+
<button class="action-menu-button p-1 hover:bg-gray-600 rounded transition-colors">
|
|
315
|
+
<svg class="h-5 w-5 text-gray-300" fill="currentColor" viewBox="0 0 20 20">
|
|
316
|
+
<path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" />
|
|
317
|
+
</svg>
|
|
318
|
+
</button>
|
|
319
|
+
|
|
320
|
+
<div class="action-menu-items hidden fixed z-50 w-48 bg-gray-800 rounded-md shadow-lg py-1 border border-gray-700" role="menu">
|
|
321
|
+
<div class="px-1 py-1">
|
|
322
|
+
{% if user.profile.role == 'admin' %}
|
|
323
|
+
<button onclick="cloneProfile('{{ profile.name }}', {{ profile.is_official|lower }})" class="group flex items-center w-full px-4 py-2 text-sm text-blue-400 hover:bg-gray-700 rounded-md" role="menuitem">
|
|
324
|
+
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
325
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
|
|
326
|
+
</svg>
|
|
327
|
+
Clone
|
|
328
|
+
</button>
|
|
329
|
+
<hr class="my-1 border-gray-700">
|
|
330
|
+
{% endif %}
|
|
331
|
+
<button onclick="viewProfile('{{ profile.name }}', {{ profile.is_official|lower }})" class="group flex items-center w-full px-4 py-2 text-sm text-gray-300 hover:bg-gray-700 rounded-md" role="menuitem">
|
|
332
|
+
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
333
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
|
334
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
|
|
335
|
+
</svg>
|
|
336
|
+
View
|
|
337
|
+
</button>
|
|
338
|
+
{% if not profile.is_official and profile.name != 'system' and profile.name != 'generic_system.json' and user.profile.role == 'admin' %}
|
|
339
|
+
<hr class="my-1 border-gray-700">
|
|
340
|
+
<button onclick="editProfile('{{ profile.name }}')" class="group flex items-center w-full px-4 py-2 text-sm text-gray-300 hover:bg-gray-700 rounded-md" role="menuitem">
|
|
341
|
+
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
342
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
|
|
343
|
+
</svg>
|
|
344
|
+
Edit
|
|
345
|
+
</button>
|
|
346
|
+
<hr class="my-1 border-gray-700">
|
|
347
|
+
<button onclick="deleteProfile('{{ profile.name }}')" class="group flex items-center w-full px-4 py-2 text-sm text-red-400 hover:bg-gray-700 rounded-md" role="menuitem">
|
|
348
|
+
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
349
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
|
350
|
+
</svg>
|
|
351
|
+
Delete
|
|
352
|
+
</button>
|
|
353
|
+
{% endif %}
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
<!-- Centered Logo -->
|
|
360
|
+
<div class="flex flex-col items-center">
|
|
361
|
+
<!-- Vendor Logo -->
|
|
362
|
+
<div class="flex-shrink-0 w-20 h-20 bg-white rounded-lg p-2.5 flex items-center justify-center">
|
|
363
|
+
{% if profile.vendor|lower == 'cisco' %}
|
|
364
|
+
<img src="{% static 'images/cisco.png' %}" alt="Cisco" class="w-full h-full object-contain">
|
|
365
|
+
{% elif profile.vendor|lower == 'dell' %}
|
|
366
|
+
<img src="{% static 'images/dell.png' %}" alt="Dell" class="w-full h-full object-contain">
|
|
367
|
+
{% elif profile.vendor|lower == 'brocade' %}
|
|
368
|
+
<img src="{% static 'images/brocade.png' %}" alt="Brocade" class="w-full h-full object-contain">
|
|
369
|
+
{% elif profile.vendor|lower == 'hpe' or profile.vendor|lower == 'hpe nimble' %}
|
|
370
|
+
<img src="{% static 'images/hpe.png' %}" alt="HPE" class="w-full h-full object-contain">
|
|
371
|
+
{% elif profile.vendor|lower == 'epson' %}
|
|
372
|
+
<img src="{% static 'images/epson.png' %}" alt="Epson" class="w-full h-full object-contain">
|
|
373
|
+
{% elif profile.vendor|lower == 'ubiquiti' %}
|
|
374
|
+
<img src="{% static 'images/ubiquiti.png' %}" alt="Ubiquiti" class="w-full h-full object-contain">
|
|
375
|
+
{% elif profile.vendor|lower == 'hp' %}
|
|
376
|
+
<img src="{% static 'images/hp.png' %}" alt="HP" class="w-full h-full object-contain">
|
|
377
|
+
{% elif profile.vendor|lower == 'mellanox' %}
|
|
378
|
+
<img src="{% static 'images/mellanox.png' %}" alt="Mellanox" class="w-full h-full object-contain">
|
|
379
|
+
{% elif profile.vendor|lower == 'palo alto' %}
|
|
380
|
+
<img src="{% static 'images/paloalto.png' %}" alt="Palo Alto" class="w-full h-full object-contain">
|
|
381
|
+
{% else %}
|
|
382
|
+
<img src="{% static 'images/unknown.png' %}" alt="Unknown Vendor" class="w-full h-full object-contain">
|
|
383
|
+
{% endif %}
|
|
384
|
+
</div>
|
|
385
|
+
</div>
|
|
386
|
+
</div>
|
|
387
|
+
|
|
388
|
+
<!-- Card Body -->
|
|
389
|
+
<div class="p-4">
|
|
390
|
+
<!-- Profile Name -->
|
|
391
|
+
<h3 class="text-lg font-semibold text-white mb-2 line-clamp-2 min-h-[3.5rem]" title="{{ profile.display_name }}">
|
|
392
|
+
{{ profile.display_name }}
|
|
393
|
+
</h3>
|
|
394
|
+
|
|
395
|
+
<!-- Description -->
|
|
396
|
+
<p class="text-sm text-gray-400 mb-3 line-clamp-2 min-h-[2.5rem]" title="{{ profile.description }}">
|
|
397
|
+
{{ profile.description|default:"No description provided" }}
|
|
398
|
+
</p>
|
|
399
|
+
|
|
400
|
+
<!-- Metadata with Official Badge -->
|
|
401
|
+
<div class="flex items-center gap-2 text-xs">
|
|
402
|
+
{% if profile.is_official %}
|
|
403
|
+
<div class="flex items-center gap-1 px-2 py-0.5 bg-yellow-500/20 border border-yellow-500/40 rounded-full flex-shrink-0" title="Official Profile - Provided by the system and cannot be edited or deleted">
|
|
404
|
+
<svg class="w-3 h-3 text-yellow-400" fill="currentColor" viewBox="0 0 20 20">
|
|
405
|
+
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" />
|
|
406
|
+
</svg>
|
|
407
|
+
</div>
|
|
408
|
+
{% endif %}
|
|
409
|
+
<svg class="w-4 h-4 text-gray-500 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
410
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
|
|
411
|
+
</svg>
|
|
412
|
+
<span class="text-gray-300 truncate">
|
|
413
|
+
<span class="font-medium">{{ profile.vendor|default:"Unknown" }}</span>
|
|
414
|
+
{% if profile.product %}
|
|
415
|
+
<span class="text-gray-500">•</span>
|
|
416
|
+
<span class="text-gray-400">{{ profile.product }}</span>
|
|
417
|
+
{% endif %}
|
|
418
|
+
</span>
|
|
419
|
+
</div>
|
|
420
|
+
|
|
421
|
+
<!-- Stats: Get, Tables, and Columns -->
|
|
422
|
+
<div class="flex items-center gap-3 text-xs pt-2 mt-2 border-t border-gray-700">
|
|
423
|
+
<div class="flex items-center gap-1">
|
|
424
|
+
<svg class="w-3.5 h-3.5 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
425
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4" />
|
|
426
|
+
</svg>
|
|
427
|
+
<span class="text-gray-400">Get:</span>
|
|
428
|
+
<span class="text-white font-medium" id="get-count-profiles-{{ forloop.counter }}">-</span>
|
|
429
|
+
</div>
|
|
430
|
+
<div class="flex items-center gap-1">
|
|
431
|
+
<svg class="w-3.5 h-3.5 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
432
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" />
|
|
433
|
+
</svg>
|
|
434
|
+
<span class="text-gray-400">Tables:</span>
|
|
435
|
+
<span class="text-white font-medium" id="table-count-profiles-{{ forloop.counter }}">-</span>
|
|
436
|
+
</div>
|
|
437
|
+
<div class="flex items-center gap-1">
|
|
438
|
+
<svg class="w-3.5 h-3.5 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
439
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7m0 10a2 2 0 002 2h2a2 2 0 002-2V7a2 2 0 00-2-2h-2a2 2 0 00-2 2" />
|
|
440
|
+
</svg>
|
|
441
|
+
<span class="text-gray-400">Columns:</span>
|
|
442
|
+
<span class="text-white font-medium" id="column-count-profiles-{{ forloop.counter }}">-</span>
|
|
443
|
+
</div>
|
|
444
|
+
</div>
|
|
445
|
+
</div>
|
|
446
|
+
</div>
|
|
447
|
+
|
|
448
|
+
<!-- Store profile data for stats calculation -->
|
|
449
|
+
<script>
|
|
450
|
+
(function() {
|
|
451
|
+
try {
|
|
452
|
+
const profileDataStr = {{ profile.profile_data|safe }};
|
|
453
|
+
const profileData = profileDataStr || {};
|
|
454
|
+
const getCount = profileData && profileData.get ? Object.keys(profileData.get).length : 0;
|
|
455
|
+
const tableCount = profileData && profileData.table ? Object.keys(profileData.table).length : 0;
|
|
456
|
+
|
|
457
|
+
// Calculate total columns across all tables
|
|
458
|
+
let columnCount = 0;
|
|
459
|
+
if (profileData && profileData.table) {
|
|
460
|
+
Object.values(profileData.table).forEach(table => {
|
|
461
|
+
if (table.columns) {
|
|
462
|
+
columnCount += Object.keys(table.columns).length;
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
468
|
+
const getEl = document.getElementById('get-count-profiles-{{ forloop.counter }}');
|
|
469
|
+
const tableEl = document.getElementById('table-count-profiles-{{ forloop.counter }}');
|
|
470
|
+
const columnEl = document.getElementById('column-count-profiles-{{ forloop.counter }}');
|
|
471
|
+
if (getEl) getEl.textContent = getCount;
|
|
472
|
+
if (tableEl) tableEl.textContent = tableCount;
|
|
473
|
+
if (columnEl) columnEl.textContent = columnCount;
|
|
474
|
+
});
|
|
475
|
+
} catch(e) {
|
|
476
|
+
console.error('Error parsing profile data:', e);
|
|
477
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
478
|
+
const getEl = document.getElementById('get-count-profiles-{{ forloop.counter }}');
|
|
479
|
+
const tableEl = document.getElementById('table-count-profiles-{{ forloop.counter }}');
|
|
480
|
+
const columnEl = document.getElementById('column-count-profiles-{{ forloop.counter }}');
|
|
481
|
+
if (getEl) getEl.textContent = '0';
|
|
482
|
+
if (tableEl) tableEl.textContent = '0';
|
|
483
|
+
if (columnEl) columnEl.textContent = '0';
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
})();
|
|
487
|
+
</script>
|
|
488
|
+
{% endfor %}
|
|
489
|
+
</div>
|
|
490
|
+
{% else %}
|
|
491
|
+
<div class="bg-gray-800 rounded-lg shadow-xl p-12 text-center">
|
|
492
|
+
<svg class="w-16 h-16 text-gray-600 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
493
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
|
494
|
+
</svg>
|
|
495
|
+
<p class="text-gray-400 text-lg">No profiles found. Add your first custom profile to get started!</p>
|
|
496
|
+
</div>
|
|
497
|
+
{% endif %}
|
|
498
|
+
</div>
|
|
499
|
+
</div>
|
|
500
|
+
|
|
501
|
+
<!-- Device Template Form Modal (for Device Templates tab) -->
|
|
502
|
+
{% include 'components/snmp_device_template_modal.html' %}
|
|
503
|
+
|
|
504
|
+
<!-- Device Template Profile Selector Modal -->
|
|
505
|
+
{% include 'components/device_template_profile_modal.html' %}
|
|
506
|
+
|
|
507
|
+
<!-- Profile Form Modal (for Profiles tab) -->
|
|
508
|
+
{% include 'components/snmp_profile_modal.html' %}
|
|
509
|
+
|
|
510
|
+
<!-- Commit Configuration Modal -->
|
|
511
|
+
{% include 'components/snmp_commit_modal.html' %}
|
|
512
|
+
|
|
513
|
+
<!-- SNMP Diff Modal -->
|
|
514
|
+
{% include 'components/snmp_diff_modal.html' %}
|
|
515
|
+
|
|
516
|
+
<!-- AI Generate Device Template Modal -->
|
|
517
|
+
{% include "components/ai_device_template_modal.html" %}
|
|
518
|
+
|
|
519
|
+
<!-- SNMP Test Modal -->
|
|
520
|
+
{% include "components/snmp_test_modal.html" %}
|
|
521
|
+
|
|
522
|
+
<!-- Popup Modal -->
|
|
523
|
+
{% include 'popup.html' %}
|
|
524
|
+
|
|
525
|
+
</div>
|
|
526
|
+
|
|
527
|
+
<script src="{% static 'js/snmp_device_template_modal.js' %}"></script>
|
|
528
|
+
<script src="{% static 'js/snmp_profile_modal_helpers.js' %}"></script>
|
|
529
|
+
<script src="{% static 'js/snmp_profile_modal.js' %}"></script>
|
|
530
|
+
<script src="{% static 'js/snmp_commit_modal.js' %}"></script>
|
|
531
|
+
<script src="{% static 'js/snmp_diff_modal.js' %}"></script>
|
|
532
|
+
<script src="{% static 'js/snmp_changes_indicator.js' %}"></script>
|
|
533
|
+
<script src="{% static 'js/snmp_test.js' %}"></script>
|
|
534
|
+
<script src="{% static 'js/ai_device_template_modal.js' %}"></script>
|
|
535
|
+
<script>
|
|
536
|
+
// Tab switching functionality
|
|
537
|
+
const deviceTemplatesTab = document.getElementById('deviceTemplatesTab');
|
|
538
|
+
const profilesTab = document.getElementById('profilesTab');
|
|
539
|
+
const deviceTemplatesContent = document.getElementById('deviceTemplatesContent');
|
|
540
|
+
const profilesContent = document.getElementById('profilesContent');
|
|
541
|
+
const addItemBtn = document.getElementById('addItemBtn');
|
|
542
|
+
const addItemBtnText = document.getElementById('addItemBtnText');
|
|
543
|
+
|
|
544
|
+
deviceTemplatesTab.addEventListener('click', () => {
|
|
545
|
+
// Update tab styles
|
|
546
|
+
deviceTemplatesTab.classList.add('active', 'border-primary', 'text-primary');
|
|
547
|
+
deviceTemplatesTab.classList.remove('border-transparent', 'text-gray-400');
|
|
548
|
+
profilesTab.classList.remove('active', 'border-primary', 'text-primary');
|
|
549
|
+
profilesTab.classList.add('border-transparent', 'text-gray-400');
|
|
550
|
+
|
|
551
|
+
// Show/hide content
|
|
552
|
+
deviceTemplatesContent.classList.remove('hidden');
|
|
553
|
+
profilesContent.classList.add('hidden');
|
|
554
|
+
|
|
555
|
+
// Update add button text
|
|
556
|
+
addItemBtnText.textContent = 'Add Device Template';
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
profilesTab.addEventListener('click', () => {
|
|
560
|
+
// Update tab styles
|
|
561
|
+
profilesTab.classList.add('active', 'border-primary', 'text-primary');
|
|
562
|
+
profilesTab.classList.remove('border-transparent', 'text-gray-400');
|
|
563
|
+
deviceTemplatesTab.classList.remove('active', 'border-primary', 'text-primary');
|
|
564
|
+
deviceTemplatesTab.classList.add('border-transparent', 'text-gray-400');
|
|
565
|
+
|
|
566
|
+
// Show/hide content
|
|
567
|
+
profilesContent.classList.remove('hidden');
|
|
568
|
+
deviceTemplatesContent.classList.add('hidden');
|
|
569
|
+
|
|
570
|
+
// Update add button text
|
|
571
|
+
addItemBtnText.textContent = 'Add Profile';
|
|
572
|
+
|
|
573
|
+
// Initialize profile filters if not already done
|
|
574
|
+
if (!window.profileFiltersInitialized) {
|
|
575
|
+
initializeProfileFilters();
|
|
576
|
+
window.profileFiltersInitialized = true;
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
// Add button functionality
|
|
581
|
+
addItemBtn.addEventListener('click', () => {
|
|
582
|
+
if (deviceTemplatesContent.classList.contains('hidden')) {
|
|
583
|
+
// Profiles tab is active
|
|
584
|
+
openProfileModal(null, false, false);
|
|
585
|
+
} else {
|
|
586
|
+
// Device Templates tab is active
|
|
587
|
+
openDeviceTemplateModal();
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
// Handle action menu (3-dot icon) functionality using event delegation
|
|
592
|
+
document.addEventListener('click', function(e) {
|
|
593
|
+
const actionButton = e.target.closest('.action-menu-button');
|
|
594
|
+
|
|
595
|
+
if (actionButton) {
|
|
596
|
+
e.stopPropagation();
|
|
597
|
+
const menu = actionButton.nextElementSibling;
|
|
598
|
+
const isHidden = menu.classList.contains('hidden');
|
|
599
|
+
|
|
600
|
+
// Close all other open menus
|
|
601
|
+
document.querySelectorAll('.action-menu-items').forEach(m => {
|
|
602
|
+
if (m !== menu) m.classList.add('hidden');
|
|
603
|
+
});
|
|
604
|
+
|
|
605
|
+
// Position the menu with smart positioning to avoid going off-screen
|
|
606
|
+
if (isHidden) {
|
|
607
|
+
// First show the menu to get its dimensions
|
|
608
|
+
menu.classList.remove('hidden');
|
|
609
|
+
|
|
610
|
+
const menuRect = menu.getBoundingClientRect();
|
|
611
|
+
const viewportWidth = window.innerWidth;
|
|
612
|
+
const viewportHeight = window.innerHeight;
|
|
613
|
+
|
|
614
|
+
let left = e.clientX;
|
|
615
|
+
let top = e.clientY;
|
|
616
|
+
|
|
617
|
+
// Check if menu would go off the right edge
|
|
618
|
+
if (left + menuRect.width > viewportWidth) {
|
|
619
|
+
left = viewportWidth - menuRect.width - 10; // 10px padding from edge
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// Check if menu would go off the bottom edge
|
|
623
|
+
if (top + menuRect.height > viewportHeight) {
|
|
624
|
+
top = viewportHeight - menuRect.height - 10; // 10px padding from edge
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// Ensure menu doesn't go off the left edge
|
|
628
|
+
if (left < 10) {
|
|
629
|
+
left = 10;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// Ensure menu doesn't go off the top edge
|
|
633
|
+
if (top < 10) {
|
|
634
|
+
top = 10;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
menu.style.left = `${left}px`;
|
|
638
|
+
menu.style.top = `${top}px`;
|
|
639
|
+
} else {
|
|
640
|
+
// Toggle to hidden
|
|
641
|
+
menu.classList.add('hidden');
|
|
642
|
+
}
|
|
643
|
+
} else if (!e.target.closest('.action-menu')) {
|
|
644
|
+
// Close all open action menus when clicking anywhere else
|
|
645
|
+
document.querySelectorAll('.action-menu-items').forEach(menu => {
|
|
646
|
+
menu.classList.add('hidden');
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
// Close menu when scrolling
|
|
652
|
+
window.addEventListener('scroll', function() {
|
|
653
|
+
document.querySelectorAll('.action-menu-items').forEach(menu => {
|
|
654
|
+
menu.classList.add('hidden');
|
|
655
|
+
});
|
|
656
|
+
}, true);
|
|
657
|
+
|
|
658
|
+
// Refresh device templates data without full page reload
|
|
659
|
+
function refreshDeviceTemplatesData() {
|
|
660
|
+
console.log('Refreshing device templates...');
|
|
661
|
+
|
|
662
|
+
fetch('/SNMP/DeviceTemplates/')
|
|
663
|
+
.then(response => response.text())
|
|
664
|
+
.then(html => {
|
|
665
|
+
// Parse the HTML response
|
|
666
|
+
const parser = new DOMParser();
|
|
667
|
+
const doc = parser.parseFromString(html, 'text/html');
|
|
668
|
+
|
|
669
|
+
// Extract the templates grid
|
|
670
|
+
const newGrid = doc.querySelector('#templatesGridContainer');
|
|
671
|
+
const currentGrid = document.querySelector('#templatesGridContainer');
|
|
672
|
+
|
|
673
|
+
if (newGrid && currentGrid) {
|
|
674
|
+
// Replace the grid content
|
|
675
|
+
currentGrid.innerHTML = newGrid.innerHTML;
|
|
676
|
+
console.log('Device templates refreshed successfully');
|
|
677
|
+
} else {
|
|
678
|
+
console.error('Could not find templates grid');
|
|
679
|
+
}
|
|
680
|
+
})
|
|
681
|
+
.catch(error => {
|
|
682
|
+
console.error('Error refreshing templates:', error);
|
|
683
|
+
showToast('Error refreshing templates', 'error');
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
// Refresh profiles data without full page reload
|
|
688
|
+
function refreshProfilesData() {
|
|
689
|
+
console.log('Refreshing profiles...');
|
|
690
|
+
|
|
691
|
+
fetch('/SNMP/DeviceTemplates/')
|
|
692
|
+
.then(response => response.text())
|
|
693
|
+
.then(html => {
|
|
694
|
+
// Parse the HTML response
|
|
695
|
+
const parser = new DOMParser();
|
|
696
|
+
const doc = parser.parseFromString(html, 'text/html');
|
|
697
|
+
|
|
698
|
+
// Extract the profiles grid
|
|
699
|
+
const newGrid = doc.querySelector('#profilesGridContainer');
|
|
700
|
+
const currentGrid = document.querySelector('#profilesGridContainer');
|
|
701
|
+
|
|
702
|
+
if (newGrid && currentGrid) {
|
|
703
|
+
// Replace the grid content
|
|
704
|
+
currentGrid.innerHTML = newGrid.innerHTML;
|
|
705
|
+
console.log('Profiles refreshed successfully');
|
|
706
|
+
} else {
|
|
707
|
+
console.error('Could not find profiles grid');
|
|
708
|
+
}
|
|
709
|
+
})
|
|
710
|
+
.catch(error => {
|
|
711
|
+
console.error('Error refreshing profiles:', error);
|
|
712
|
+
showToast('Error refreshing profiles', 'error');
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
// Device Template action functions
|
|
717
|
+
function cloneTemplate(templateId, isOfficial) {
|
|
718
|
+
// Load template data and open modal with cloned values
|
|
719
|
+
// Note: Official templates are synced to the database, so we can use GetDeviceTemplate for both
|
|
720
|
+
const endpoint = `/SNMP/GetDeviceTemplate/${templateId}/`;
|
|
721
|
+
|
|
722
|
+
fetch(endpoint)
|
|
723
|
+
.then(response => response.json())
|
|
724
|
+
.then(data => {
|
|
725
|
+
console.log('Clone template data received:', data);
|
|
726
|
+
|
|
727
|
+
// Check for error response
|
|
728
|
+
if (data.error) {
|
|
729
|
+
showToast('Error loading template: ' + data.error, 'error');
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// Remove the ID so it creates a new template
|
|
734
|
+
delete data.id;
|
|
735
|
+
delete data.official;
|
|
736
|
+
|
|
737
|
+
// Append " (Copy)" to the name
|
|
738
|
+
if (data.name) {
|
|
739
|
+
data.name = data.name + ' (Copy)';
|
|
740
|
+
} else {
|
|
741
|
+
console.error('Template name is undefined in response:', data);
|
|
742
|
+
showToast('Error: Template name not found', 'error');
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// Profiles should already be in the correct format from GetDeviceTemplate
|
|
747
|
+
// They come as objects with {id, name, display_name}
|
|
748
|
+
|
|
749
|
+
console.log('Opening modal with cloned data:', data);
|
|
750
|
+
// Open modal in add mode with cloned data
|
|
751
|
+
openDeviceTemplateModal(null, false, false, data);
|
|
752
|
+
})
|
|
753
|
+
.catch(error => {
|
|
754
|
+
console.error('Error cloning template:', error);
|
|
755
|
+
showToast('Error loading template: ' + error, 'error');
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
function viewTemplate(templateId, isOfficial) {
|
|
760
|
+
openDeviceTemplateModal(templateId, true, isOfficial);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
function editTemplate(templateId) {
|
|
764
|
+
openDeviceTemplateModal(templateId, false, false);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
async function deleteTemplate(templateId, templateName) {
|
|
768
|
+
const confirmed = await ConfirmationModal.show(
|
|
769
|
+
`Are you sure you want to delete the template "${templateName}"?`,
|
|
770
|
+
'Confirm Delete',
|
|
771
|
+
'OK'
|
|
772
|
+
);
|
|
773
|
+
|
|
774
|
+
if (confirmed) {
|
|
775
|
+
fetch(`/SNMP/DeleteDeviceTemplate/${templateId}/`, {
|
|
776
|
+
method: 'POST',
|
|
777
|
+
headers: {
|
|
778
|
+
'X-CSRFToken': '{{ csrf_token }}'
|
|
779
|
+
}
|
|
780
|
+
})
|
|
781
|
+
.then(response => response.json())
|
|
782
|
+
.then(data => {
|
|
783
|
+
if (data.success) {
|
|
784
|
+
showToast('Device template deleted successfully!', 'success');
|
|
785
|
+
refreshDeviceTemplatesData();
|
|
786
|
+
if (typeof triggerUndeployedChangesCheck === 'function') {
|
|
787
|
+
triggerUndeployedChangesCheck();
|
|
788
|
+
}
|
|
789
|
+
} else {
|
|
790
|
+
showToast(data.message || 'Failed to delete template', 'error');
|
|
791
|
+
}
|
|
792
|
+
})
|
|
793
|
+
.catch(error => {
|
|
794
|
+
showToast('Error deleting template: ' + error, 'error');
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// Profile action functions (from Profiles.html)
|
|
800
|
+
function cloneProfile(profileName, isOfficial) {
|
|
801
|
+
// Load profile data and open modal with cloned values
|
|
802
|
+
const endpoint = isOfficial
|
|
803
|
+
? `/SNMP/GetOfficialProfile/${profileName}/`
|
|
804
|
+
: `/SNMP/GetProfile/${profileName}/`;
|
|
805
|
+
|
|
806
|
+
fetch(endpoint)
|
|
807
|
+
.then(response => response.json())
|
|
808
|
+
.then(data => {
|
|
809
|
+
// Remove any ID-related fields
|
|
810
|
+
delete data.id;
|
|
811
|
+
// Append " (Copy)" to the name
|
|
812
|
+
data.name = data.name + ' (Copy)';
|
|
813
|
+
// Open modal in add mode with cloned data
|
|
814
|
+
openProfileModalWithData(data);
|
|
815
|
+
})
|
|
816
|
+
.catch(error => {
|
|
817
|
+
showToast('Error loading profile: ' + error, 'error');
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
function viewProfile(profileName, isOfficial) {
|
|
822
|
+
openProfileModal(profileName, isOfficial, true); // true = view mode
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
function editProfile(profileName) {
|
|
826
|
+
openProfileModal(profileName, false, false); // false = edit mode
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
async function deleteProfile(profileName) {
|
|
830
|
+
const confirmed = await ConfirmationModal.show(
|
|
831
|
+
`Are you sure you want to delete the profile "${profileName}"?`,
|
|
832
|
+
'Confirm Delete',
|
|
833
|
+
'OK'
|
|
834
|
+
);
|
|
835
|
+
|
|
836
|
+
if (confirmed) {
|
|
837
|
+
fetch(`/SNMP/DeleteProfile/${profileName}/`, {
|
|
838
|
+
method: 'POST',
|
|
839
|
+
headers: {
|
|
840
|
+
'X-CSRFToken': '{{ csrf_token }}'
|
|
841
|
+
}
|
|
842
|
+
})
|
|
843
|
+
.then(response => response.json())
|
|
844
|
+
.then(data => {
|
|
845
|
+
if (data.success) {
|
|
846
|
+
showToast('Profile deleted successfully!', 'success');
|
|
847
|
+
refreshProfilesData();
|
|
848
|
+
if (typeof triggerUndeployedChangesCheck === 'function') {
|
|
849
|
+
triggerUndeployedChangesCheck();
|
|
850
|
+
}
|
|
851
|
+
} else {
|
|
852
|
+
showToast(data.message || 'Failed to delete profile', 'error');
|
|
853
|
+
}
|
|
854
|
+
})
|
|
855
|
+
.catch(error => {
|
|
856
|
+
showToast('Error deleting profile: ' + error, 'error');
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
// Device Template Search and Filter Functionality
|
|
862
|
+
function initializeTemplateFilters() {
|
|
863
|
+
const templateSearchInput = document.getElementById('templateSearchInput');
|
|
864
|
+
const templateVendorFilter = document.getElementById('templateVendorFilter');
|
|
865
|
+
const templateProductFilter = document.getElementById('templateProductFilter');
|
|
866
|
+
|
|
867
|
+
// Get all template cards using data attributes
|
|
868
|
+
const templateCards = document.querySelectorAll('#deviceTemplatesContent [data-template-vendor]');
|
|
869
|
+
|
|
870
|
+
// Extract unique vendors and products from data attributes
|
|
871
|
+
const vendors = new Set();
|
|
872
|
+
const products = new Set();
|
|
873
|
+
|
|
874
|
+
templateCards.forEach(card => {
|
|
875
|
+
const vendor = card.dataset.templateVendor;
|
|
876
|
+
const product = card.dataset.templateProduct;
|
|
877
|
+
|
|
878
|
+
if (vendor && vendor !== 'Unknown') {
|
|
879
|
+
vendors.add(vendor);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
if (product && product.trim() !== '') {
|
|
883
|
+
products.add(product);
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
|
|
887
|
+
// Clear existing options (except "All" option)
|
|
888
|
+
templateVendorFilter.innerHTML = '<option value="">All Vendors</option>';
|
|
889
|
+
templateProductFilter.innerHTML = '<option value="">All Products</option>';
|
|
890
|
+
|
|
891
|
+
// Populate vendor dropdown
|
|
892
|
+
Array.from(vendors).sort().forEach(vendor => {
|
|
893
|
+
const option = document.createElement('option');
|
|
894
|
+
option.value = vendor;
|
|
895
|
+
option.textContent = vendor;
|
|
896
|
+
templateVendorFilter.appendChild(option);
|
|
897
|
+
});
|
|
898
|
+
|
|
899
|
+
// Populate product dropdown
|
|
900
|
+
Array.from(products).sort().forEach(product => {
|
|
901
|
+
const option = document.createElement('option');
|
|
902
|
+
option.value = product;
|
|
903
|
+
option.textContent = product;
|
|
904
|
+
templateProductFilter.appendChild(option);
|
|
905
|
+
});
|
|
906
|
+
|
|
907
|
+
// Filter function
|
|
908
|
+
function filterTemplates() {
|
|
909
|
+
const searchTerm = templateSearchInput.value.toLowerCase();
|
|
910
|
+
const selectedVendor = templateVendorFilter.value;
|
|
911
|
+
const selectedProduct = templateProductFilter.value;
|
|
912
|
+
|
|
913
|
+
templateCards.forEach(card => {
|
|
914
|
+
// Get card data from data attributes
|
|
915
|
+
const name = card.dataset.templateName || '';
|
|
916
|
+
const description = card.dataset.templateDescription || '';
|
|
917
|
+
const vendor = card.dataset.templateVendor || '';
|
|
918
|
+
const product = card.dataset.templateProduct || '';
|
|
919
|
+
|
|
920
|
+
// Check search term
|
|
921
|
+
const matchesSearch = !searchTerm ||
|
|
922
|
+
name.includes(searchTerm) ||
|
|
923
|
+
description.includes(searchTerm) ||
|
|
924
|
+
vendor.toLowerCase().includes(searchTerm) ||
|
|
925
|
+
product.toLowerCase().includes(searchTerm);
|
|
926
|
+
|
|
927
|
+
// Check vendor filter
|
|
928
|
+
const matchesVendor = !selectedVendor || vendor === selectedVendor;
|
|
929
|
+
|
|
930
|
+
// Check product filter
|
|
931
|
+
const matchesProduct = !selectedProduct || product === selectedProduct;
|
|
932
|
+
|
|
933
|
+
// Show/hide card
|
|
934
|
+
if (matchesSearch && matchesVendor && matchesProduct) {
|
|
935
|
+
card.style.display = '';
|
|
936
|
+
} else {
|
|
937
|
+
card.style.display = 'none';
|
|
938
|
+
}
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
// Add event listeners
|
|
943
|
+
if (templateSearchInput) {
|
|
944
|
+
templateSearchInput.addEventListener('input', filterTemplates);
|
|
945
|
+
}
|
|
946
|
+
if (templateVendorFilter) {
|
|
947
|
+
templateVendorFilter.addEventListener('change', filterTemplates);
|
|
948
|
+
}
|
|
949
|
+
if (templateProductFilter) {
|
|
950
|
+
templateProductFilter.addEventListener('change', filterTemplates);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
// Initialize template filters on page load
|
|
955
|
+
initializeTemplateFilters();
|
|
956
|
+
|
|
957
|
+
// Profile Search and Filter Functionality
|
|
958
|
+
function initializeProfileFilters() {
|
|
959
|
+
// Add a small delay to ensure DOM is fully rendered
|
|
960
|
+
setTimeout(() => {
|
|
961
|
+
const profileSearchInput = document.getElementById('profileSearchInput');
|
|
962
|
+
const profileVendorFilter = document.getElementById('profileVendorFilter');
|
|
963
|
+
const profileProductFilter = document.getElementById('profileProductFilter');
|
|
964
|
+
|
|
965
|
+
// Get all profile cards using data attributes
|
|
966
|
+
const profileCards = document.querySelectorAll('#profilesContent [data-profile-vendor]');
|
|
967
|
+
|
|
968
|
+
console.log('Found profile cards:', profileCards.length);
|
|
969
|
+
|
|
970
|
+
// Extract unique vendors and products from data attributes
|
|
971
|
+
const vendors = new Set();
|
|
972
|
+
const products = new Set();
|
|
973
|
+
|
|
974
|
+
profileCards.forEach(card => {
|
|
975
|
+
const vendor = card.dataset.profileVendor;
|
|
976
|
+
const product = card.dataset.profileProduct;
|
|
977
|
+
|
|
978
|
+
if (vendor && vendor !== 'Unknown') {
|
|
979
|
+
vendors.add(vendor);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
if (product && product.trim() !== '') {
|
|
983
|
+
products.add(product);
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
|
|
987
|
+
console.log('Found vendors:', Array.from(vendors));
|
|
988
|
+
console.log('Found products:', Array.from(products));
|
|
989
|
+
|
|
990
|
+
// Clear existing options (except "All" option)
|
|
991
|
+
profileVendorFilter.innerHTML = '<option value="">All Vendors</option>';
|
|
992
|
+
profileProductFilter.innerHTML = '<option value="">All Products</option>';
|
|
993
|
+
|
|
994
|
+
// Populate vendor dropdown
|
|
995
|
+
Array.from(vendors).sort().forEach(vendor => {
|
|
996
|
+
const option = document.createElement('option');
|
|
997
|
+
option.value = vendor;
|
|
998
|
+
option.textContent = vendor;
|
|
999
|
+
profileVendorFilter.appendChild(option);
|
|
1000
|
+
});
|
|
1001
|
+
|
|
1002
|
+
// Populate product dropdown
|
|
1003
|
+
Array.from(products).sort().forEach(product => {
|
|
1004
|
+
const option = document.createElement('option');
|
|
1005
|
+
option.value = product;
|
|
1006
|
+
option.textContent = product;
|
|
1007
|
+
profileProductFilter.appendChild(option);
|
|
1008
|
+
});
|
|
1009
|
+
|
|
1010
|
+
// Filter function
|
|
1011
|
+
function filterProfiles() {
|
|
1012
|
+
const searchTerm = profileSearchInput.value.toLowerCase();
|
|
1013
|
+
const selectedVendor = profileVendorFilter.value;
|
|
1014
|
+
const selectedProduct = profileProductFilter.value;
|
|
1015
|
+
|
|
1016
|
+
profileCards.forEach(card => {
|
|
1017
|
+
// Get card data from data attributes
|
|
1018
|
+
const name = card.dataset.profileName || '';
|
|
1019
|
+
const description = card.dataset.profileDescription || '';
|
|
1020
|
+
const vendor = card.dataset.profileVendor || '';
|
|
1021
|
+
const product = card.dataset.profileProduct || '';
|
|
1022
|
+
|
|
1023
|
+
// Check search term
|
|
1024
|
+
const matchesSearch = !searchTerm ||
|
|
1025
|
+
name.includes(searchTerm) ||
|
|
1026
|
+
description.includes(searchTerm) ||
|
|
1027
|
+
vendor.toLowerCase().includes(searchTerm) ||
|
|
1028
|
+
product.toLowerCase().includes(searchTerm);
|
|
1029
|
+
|
|
1030
|
+
// Check vendor filter
|
|
1031
|
+
const matchesVendor = !selectedVendor || vendor === selectedVendor;
|
|
1032
|
+
|
|
1033
|
+
// Check product filter
|
|
1034
|
+
const matchesProduct = !selectedProduct || product === selectedProduct;
|
|
1035
|
+
|
|
1036
|
+
// Show/hide card
|
|
1037
|
+
if (matchesSearch && matchesVendor && matchesProduct) {
|
|
1038
|
+
card.style.display = '';
|
|
1039
|
+
} else {
|
|
1040
|
+
card.style.display = 'none';
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
// Add event listeners
|
|
1046
|
+
if (profileSearchInput) {
|
|
1047
|
+
profileSearchInput.addEventListener('input', filterProfiles);
|
|
1048
|
+
}
|
|
1049
|
+
if (profileVendorFilter) {
|
|
1050
|
+
profileVendorFilter.addEventListener('change', filterProfiles);
|
|
1051
|
+
}
|
|
1052
|
+
if (profileProductFilter) {
|
|
1053
|
+
profileProductFilter.addEventListener('change', filterProfiles);
|
|
1054
|
+
}
|
|
1055
|
+
}, 100); // 100ms delay
|
|
1056
|
+
}
|
|
1057
|
+
</script>
|
|
1058
|
+
|
|
1059
|
+
{% endblock %}
|