From 050e950df5af23afb22e372ffc8ff91872efbfb9 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 9 Mar 2023 22:57:28 +0100 Subject: [PATCH] Add clickable API URL to API keys page --- application/views/api/help.php | 1 + application/views/interface_assets/footer.php | 10 ++++++++++ assets/css/general.css | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/application/views/api/help.php b/application/views/api/help.php index 5ec2aa9e..c1caf1c8 100644 --- a/application/views/api/help.php +++ b/application/views/api/help.php @@ -16,6 +16,7 @@

The Cloudlog API (Application Programming Interface) lets third party systems access Cloudlog in a controlled way. Access to the API is managed via API keys.

You will need to generate an API key for each tool you wish to use (e.g. CloudlogCAT). Generate a read-write key if the application needs to send data to Cloudlog. Generate a read-only key if the application only needs to obtain data from Cloudlog.

+

API URL The API URL for this Cloudlog instance is:

Info It's good practice to delete a key if you are no longer using the associated application.

num_rows() > 0) { ?> diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index c66bc8ad..ad2126cb 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -158,6 +158,16 @@ function copyApiKey(apiKey) { }); } +function copyApiUrl() { + var apiUrlField = $('#apiUrl'); + navigator.clipboard.writeText("").then(function() { + }); + apiUrlField.addClass('flash-copy') + .delay('1000').queue(function() { + apiUrlField.removeClass('flash-copy').dequeue(); + }); +} + $(function () { $('[data-toggle="tooltip"]').tooltip({'delay': { show: 500, hide: 0 }, 'placement': 'right'}); }); diff --git a/assets/css/general.css b/assets/css/general.css index 6d5b732c..ffdeabb7 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -405,6 +405,10 @@ div#station_logbooks_linked_table_paginate { } } +.api-url { + font-family: Monospace; +} + .api-key { font-family: Monospace; } @@ -415,4 +419,4 @@ div#station_logbooks_linked_table_paginate { .qso_panel .dxccsummary { margin-bottom: 10px; -} \ No newline at end of file +}