diff --git a/content/admin/configuration/configuring-code-scanning-for-your-appliance.md b/content/admin/configuration/configuring-code-scanning-for-your-appliance.md index 8dad550cab..7b579bfe1d 100644 --- a/content/admin/configuration/configuring-code-scanning-for-your-appliance.md +++ b/content/admin/configuration/configuring-code-scanning-for-your-appliance.md @@ -42,7 +42,6 @@ For the users of {% data variables.product.product_location %} to be able to ena ![Checkbox to enable or disable {% data variables.product.prodname_code_scanning %}](/assets/images/enterprise/management-console/enable-code-scanning-checkbox.png) {% data reusables.enterprise_management_console.save-settings %} - ### Running {% data variables.product.prodname_code_scanning %} using {% data variables.product.prodname_actions %} #### Setting up a self-hosted runner @@ -89,3 +88,25 @@ The {% data variables.product.prodname_codeql_runner %} is a command-line tool t 1. Under "{% data variables.product.prodname_advanced_security %}", unselect **{% data variables.product.prodname_code_scanning_capc %}**. ![Checkbox to enable or disable {% data variables.product.prodname_code_scanning %}](/assets/images/enterprise/management-console/code-scanning-disable.png) {% data reusables.enterprise_management_console.save-settings %} + +### Enabling or disabling {% data variables.product.prodname_code_scanning %} via the administrative shell (SSH) + +You can enable or disable {% data variables.product.prodname_code_scanning %} programmatically on {% data variables.product.product_location %}. For example, you can enable {% data variables.product.prodname_code_scanning %} with your infrastructure-as-code tooling when you deploy an instance for staging or disaster recovery. + +For more information about the administrative shell and command-line utilities for {% data variables.product.prodname_ghe_server %}, see "[Accessing the administrative shell (SSH)](/admin/configuration/accessing-the-administrative-shell-ssh)" and "[Command-line utilities](/admin/configuration/command-line-utilities#ghe-config)." + +1. SSH into {% data variables.product.product_location %}. +1. Enable {% data variables.product.prodname_code_scanning %}. + ```shell + ghe-config app.minio.enabled true + ghe-config app.code-scanning.enabled true + ``` +2. Optionally, disable {% data variables.product.prodname_code_scanning %}. + ```shell + ghe-config app.minio.enabled false + ghe-config app.code-scanning.enabled false + ``` +3. Apply the configuration. + ```shell + ghe-config-apply + ``` diff --git a/includes/scroll-button.html b/includes/scroll-button.html new file mode 100644 index 0000000000..e6d5d14b70 --- /dev/null +++ b/includes/scroll-button.html @@ -0,0 +1,3 @@ + diff --git a/javascripts/index.js b/javascripts/index.js index 7cc42b0042..0cf22b13a9 100644 --- a/javascripts/index.js +++ b/javascripts/index.js @@ -2,6 +2,7 @@ import '../stylesheets/index.scss' import displayPlatformSpecificContent from './display-platform-specific-content' import explorer from './explorer' +import scrollUp from './scroll-up' import search from './search' import nav from './nav' import browserDateFormatter from 'browser-date-formatter' @@ -23,6 +24,7 @@ import airgapLinks from './airgap-links' document.addEventListener('DOMContentLoaded', async () => { displayPlatformSpecificContent() explorer() + scrollUp() search() nav() browserDateFormatter() diff --git a/javascripts/scroll-up.js b/javascripts/scroll-up.js new file mode 100644 index 0000000000..3a28db997c --- /dev/null +++ b/javascripts/scroll-up.js @@ -0,0 +1,22 @@ +export default function () { + // function to scroll up to page top + const PageTopBtn = document.getElementById('js-scroll-top') + if (!PageTopBtn) return + + PageTopBtn.addEventListener('click', (e) => { + window.scrollTo({ + top: 0, + behavior: 'smooth' + }) + }) + + // show scroll button only when display is scroll down + window.addEventListener('scroll', function () { + const y = document.documentElement.scrollTop // get the height from page top + if (y < 100) { + PageTopBtn.classList.remove('show') + } else if (y >= 100) { + PageTopBtn.classList.add('show') + } + }) +} diff --git a/layouts/default.html b/layouts/default.html index c90330af86..c409dae945 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -15,6 +15,7 @@ {% endif %} {% include support-section %} {% include small-footer %} + {% include scroll-button %} diff --git a/stylesheets/index.scss b/stylesheets/index.scss index 8b868c3487..5408f708c9 100644 --- a/stylesheets/index.scss +++ b/stylesheets/index.scss @@ -47,6 +47,7 @@ $marketing-font-path: "/dist/fonts/"; @import "search.scss"; @import "overrides.scss"; @import "sidebar.scss"; +@import "scroll-button.scss"; @import "explorer.scss"; // from https://unpkg.com/highlight.js@9.15.8/styles/github.css @import "syntax-highlighting.scss"; diff --git a/stylesheets/scroll-button.scss b/stylesheets/scroll-button.scss new file mode 100644 index 0000000000..d59a2d30bf --- /dev/null +++ b/stylesheets/scroll-button.scss @@ -0,0 +1,18 @@ +button.arrow-for-scrolling-top { + opacity: 0; + transition: 1s; + background-color: #0367d6; + color: #fff; + position: fixed; + bottom: 10px; + right: 10px; + display: block; + width: 40px; + height: 40px; + border-radius: 50%; + &.show { + opacity: 1; + border: none; + transition: 1s; + } +}