Skip to content

Commit

Permalink
Merge pull request #4735 from Franz-Kafka/main
Browse files Browse the repository at this point in the history
Add SHA-512 button to link
  • Loading branch information
szarnyasg authored Feb 11, 2025
2 parents fd72c58 + b4aded5 commit 0d8b553
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 19 deletions.
7 changes: 7 additions & 0 deletions _includes/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ <h3>

</div>
</div>

<div class="sha512 output">
<h3></h3>
<div class="result">

</div>
</div>

<div class="installation output">
<h3>
Expand Down
22 changes: 22 additions & 0 deletions css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,28 @@ body.installation{
}
}
}
.sha512_btn{
border-radius: 40px;
border: 1px solid var(--doc-codebox-border-color, #E6E6E6);
background: var(--main-codebox-sub-background-color, rgba(230, 230, 230, 0.60));
cursor: pointer;
font-family: $fontMono;
padding: 1px 6px;
font-weight: 600;
font-size: 11px;
vertical-align: bottom;
margin-left: 5px;
&.active{
color: var(--doc-menu-info-deprecated-border-color, #A899FF);
}
}
.sha512.output{
padding-top: 0;
display: none;
.result{
word-break: break-all;
}
}
.note.output{
padding-top: 0px;
.result{
Expand Down
29 changes: 14 additions & 15 deletions data/installation-data-1.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
platform: Windows
download_method: Package manager
architecture: universal
has_sha_512_hash: 'no'
installation_code: winget install DuckDB.cli
note: >-
Each DuckDB client is installed without relying on any other DuckDB clients.
Expand All @@ -12,13 +11,13 @@
client.
Therefore, they need to be updated separately.
usage_example: duckdb
usage_example: duckdb.exe
- variant: stable
environment: Command line
platform: Windows
download_method: Direct download
architecture: x86_64
has_sha_512_hash: 'yes'
sha_512: 89d85ff968a89abcfa37d3dad0a10179ce1570f626e21a78d7e8e0c734e4f60a30a596c6ed6b2deb855ece20ef9f09ef2366c35364dca7ed7e52c4122731c8c9
link: https://github.com/duckdb/duckdb/releases/download/v1.2.0/duckdb_cli-windows-amd64.zip
note: >-
Each DuckDB client is installed without relying on any other DuckDB clients.
Expand All @@ -27,13 +26,13 @@
client.
Therefore, they need to be updated separately.
usage_example: ./duckdb
usage_example: duckdb.exe
- variant: stable
environment: Command line
platform: Windows
download_method: Direct download
architecture: arm64
has_sha_512_hash: 'yes'
sha_512: 780253cd359bf0252e342ce3a84d03a00782615f810436e1e92668c56884ed08f0416dfc38e1f35e235219f23ca4940347307b2dd06a67ba6068cf74596574f6
link: https://github.com/duckdb/duckdb/releases/download/v1.2.0/duckdb_cli-windows-arm64.zip
note: >-
Each DuckDB client is installed without relying on any other DuckDB clients.
Expand All @@ -42,13 +41,12 @@
client.
Therefore, they need to be updated separately.
usage_example: ./duckdb
usage_example: duckdb.exe
- variant: stable
environment: Command line
platform: macOS
download_method: Package manager
architecture: universal
has_sha_512_hash: 'no'
installation_code: brew install duckdb
note: >-
Each DuckDB client is installed without relying on any other DuckDB clients.
Expand All @@ -63,7 +61,7 @@
platform: macOS
download_method: Direct download
architecture: universal
has_sha_512_hash: 'yes'
sha_512: 3aaa20ddc68a33b61aa6d823011641f4bf565a0180e1c32c501fc303f19f702eca99ce256280cb6ce5bcd53876f2836eb3226fdc312b9d1e1fa6413e5664f04e
link: https://github.com/duckdb/duckdb/releases/download/v1.2.0/duckdb_cli-osx-universal.zip
installation_code: >-
curl --fail --location --progress-bar --output duckdb_cli-osx-universal.zip https://github.com/duckdb/duckdb/releases/download/v1.2.0/duckdb_cli-osx-universal.zip &&
Expand All @@ -74,7 +72,7 @@
platform: Linux
download_method: Direct download
architecture: x86_64
has_sha_512_hash: 'yes'
sha_512: d94b4497338b628dd9de64d242f4977058aa1a84a2fba2436e84adf4a8fd0716b3ab60eba53525dc16d3aa28c443271f1a12984637301ed51377dad8ea867843
link: https://github.com/duckdb/duckdb/releases/download/v1.2.0/duckdb_cli-linux-amd64.zip
installation_code: >-
curl --fail --location --progress-bar --output duckdb_cli-linux-amd64.zip https://github.com/duckdb/duckdb/releases/download/v1.2.0/duckdb_cli-linux-amd64.zip &&
Expand All @@ -85,7 +83,7 @@
platform: Linux
download_method: Direct download
architecture: arm64
has_sha_512_hash: 'yes'
sha_512: 64d84b5d468ae544251d567cadd8504472f5f2a6df1f6fa390bf1ed96b9d00d6f31a007729de92f1799520161235de5d7da44c0e18800da38fbd026d9c439973
link: https://github.com/duckdb/duckdb/releases/download/v1.2.0/duckdb_cli-linux-aarch64.zip
installation_code: >-
curl --fail --location --progress-bar --output duckdb_cli-linux-aarch64.zip https://github.com/duckdb/duckdb/releases/download/v1.2.0/duckdb_cli-linux-aarch64.zip &&
Expand All @@ -96,7 +94,6 @@
platform: all
download_method: Package manager
architecture: universal
has_sha_512_hash: 'no'
installation_code: pip install duckdb --upgrade
note: >-
The DuckDB Python package requires the <a href="https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170">Microsoft Visual C++ Redistributable</a>.
Expand All @@ -105,7 +102,6 @@
platform: all
download_method: Package manager
architecture: universal
has_sha_512_hash: 'no'
installation_code: install.packages("duckdb")
note: >-
On aarch64, if the DuckDB R package does not successfully compile, you
Expand All @@ -115,7 +111,6 @@
platform: all
download_method: Package manager
architecture: universal
has_sha_512_hash: 'no'
installation_code: >-
<dependency>
<groupId>org.duckdb</groupId>
Expand All @@ -127,7 +122,6 @@
platform: all
download_method: Direct download
architecture: universal
has_sha_512_hash: 'yes'
link: https://repo1.maven.org/maven2/org/duckdb/duckdb_jdbc/1.1.3/duckdb_jdbc-1.1.3.jar
- variant: stable
environment: Node.js
Expand All @@ -153,30 +147,35 @@
download_method: Direct download
architecture: x86_64
link: https://github.com/duckdb/duckdb/releases/download/v1.2.0/libduckdb-windows-amd64.zip
sha_512: 51adb4f540147bd5c6bc9d719d4469363fbe17029ea1fe9b42cdf956e84dab0eb5a0a2821a29d7ac8d3cb64ddf010e5486cd9be0737ef3a4275b5e96de6d9cce
- variant: stable
environment: C/C++
platform: Windows
download_method: Direct download
architecture: arm64
link: https://github.com/duckdb/duckdb/releases/download/v1.2.0/libduckdb-windows-arm64.zip
sha_512: 3e45110f1abd80a22f797d21966c49559d45fe8cd996cffec217741a600d33827b04af698a55e840d47764039b73935274d6814aae0d2e0726b67f1aa79e4532
- variant: stable
environment: C/C++
platform: macOS
download_method: Direct download
architecture: universal
link: https://github.com/duckdb/duckdb/releases/download/v1.2.0/libduckdb-osx-universal.zip
sha_512: 4f6c9e593c0b5c579a829dbe1e669610be6db3039a627d1c2c5747568e2d673bf9841548d38bcaf42eb4c827047c16161eeb52351467f46bf16e80c876ef2877
- variant: stable
environment: C/C++
platform: Linux
download_method: Direct download
architecture: x86_64
link: https://github.com/duckdb/duckdb/releases/download/v1.2.0/libduckdb-linux-amd64.zip
sha_512: e04714201918bc198f7c6e08326eb51e5a700e7baa630229995f44707a82f193647aa537a7f54db602588725aad272a49db701bc5e4343b3083332751b756fc9
- variant: stable
environment: C/C++
platform: Linux
download_method: Direct download
architecture: arm64
link: https://github.com/duckdb/duckdb/releases/download/v1.2.0/libduckdb-linux-aarch64.zip
sha_512: f150ef87e7a56ec86e8983f5f1e0600a7c258c6a4596122c55572a338bc1c2baabce4c469d8b5dbc703073a3efc0e7a039d605898f436005f48ada8ee6646588
- variant: stable
environment: ODBC
platform: Windows
Expand Down Expand Up @@ -214,7 +213,7 @@
client.
Therefore, they need to be updated separately.
usage_example: ./duckdb
usage_example: duckdb.exe
- variant: nightly
environment: Command line
platform: macOS
Expand Down
34 changes: 30 additions & 4 deletions js/installation.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ $(document).ready(function(){

hideSections( sectionsToHide.join(',') );

// Check if SHA512 is available
function sha512Exists(config) {
return config.sha_512;
}

// If platform.select has .hide class, then show .info in it, otherwise hide .info
if ( $( '.yourselection .platform.select.hide').length > 0 ) {
Expand All @@ -258,11 +262,21 @@ $(document).ready(function(){
$( '.example.output' ).hide();
}

if ( configurables[0].link ) {
$( '.link.output' ).show()
$( '.link.output .result' ).html( '<a href="' + configurables[0].link + '">' + configurables[0].link + '</a>' );
if (configurables[0].link) {
$('.link.output').show();
let linkHtml = '<a href="' + configurables[0].link + '">' + configurables[0].link + '</a>';
if (sha512Exists(configurables[0])) {
linkHtml += ' <span class="sha512_btn">SHA-512</span>';
}
$('.link.output .result').html(linkHtml);
} else {
$('.link.output').hide();
}

if (sha512Exists(configurables[0])) {
$('.sha512.output .result').html(configurables[0].sha_512);
} else {
$( '.link.output' ).hide();
$('.sha512.output').hide();
}

if ( configurables[0].note ) {
Expand All @@ -271,6 +285,8 @@ $(document).ready(function(){
} else {
$( '.note.output' ).hide();
}


}

evaluation();
Expand Down Expand Up @@ -337,4 +353,14 @@ $(document).ready(function(){
evaluation();
}, 100);

});

$(document).on('click', '.sha512_btn', function(e) {
e.preventDefault();
$(this).toggleClass('active');
if ($(this).hasClass('active')) {
$('.sha512.output').css('display', 'flex');
} else {
$('.sha512.output').hide();
}
});

0 comments on commit 0d8b553

Please sign in to comment.