From efdad4a9fc62797d89eb0d57af5fbd0b226948d4 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Thu, 1 Sep 2022 21:35:34 +0300 Subject: [PATCH 1/4] Add option to turn on and off automatic log scrolling (#1149) * Add option to turn on and off log automatic scrolling * Use vueuse storage helper --- web/components.d.ts | 5 +++- web/package.json | 1 + web/src/assets/locales/en.json | 4 ++- web/src/assets/locales/lv.json | 4 ++- web/src/components/atomic/Icon.vue | 8 ++++-- .../build-feed/BuildFeedSidebar.vue | 2 +- web/src/components/repo/build/BuildLog.vue | 24 ++++++++++++++--- web/yarn.lock | 27 +++++++++++++++++++ 8 files changed, 66 insertions(+), 9 deletions(-) diff --git a/web/components.d.ts b/web/components.d.ts index 3ade0da58a..594922cbac 100644 --- a/web/components.d.ts +++ b/web/components.d.ts @@ -37,7 +37,10 @@ declare module '@vue/runtime-core' { IGgTrash: typeof import('~icons/gg/trash')['default'] IIcBaselineDarkMode: typeof import('~icons/ic/baseline-dark-mode')['default'] IIcBaselineDownload: typeof import('~icons/ic/baseline-download')['default'] + IIcBaselineDownloadForOffline: typeof import('~icons/ic/baseline-download-for-offline')['default'] IIcBaselineEdit: typeof import('~icons/ic/baseline-edit')['default'] + IIcBaselineFileDownload: typeof import('~icons/ic/baseline-file-download')['default'] + IIcBaselineFileDownloadOff: typeof import('~icons/ic/baseline-file-download-off')['default'] IIcBaselineHealing: typeof import('~icons/ic/baseline-healing')['default'] IIconoirArrowLeft: typeof import('~icons/iconoir/arrow-left')['default'] IIconParkOutlineAlarmClock: typeof import('~icons/icon-park-outline/alarm-clock')['default'] @@ -50,10 +53,10 @@ declare module '@vue/runtime-core' { IMdiFormatListBulleted: typeof import('~icons/mdi/format-list-bulleted')['default'] IMdiGithub: typeof import('~icons/mdi/github')['default'] IMdiLoading: typeof import('~icons/mdi/loading')['default'] + IMdiSync: typeof import('~icons/mdi/sync')['default'] IMdiSourceBranch: typeof import('~icons/mdi/source-branch')['default'] IMdisourceCommit: typeof import('~icons/mdi/source-commit')['default'] IMdiSourcePull: typeof import('~icons/mdi/source-pull')['default'] - IMdiSync: typeof import('~icons/mdi/sync')['default'] IMdiTagOutline: typeof import('~icons/mdi/tag-outline')['default'] InputField: typeof import('./src/components/form/InputField.vue')['default'] IOcticonSkip24: typeof import('~icons/octicon/skip24')['default'] diff --git a/web/package.json b/web/package.json index 3d2d1f20b8..c62a2e44f3 100644 --- a/web/package.json +++ b/web/package.json @@ -20,6 +20,7 @@ "@intlify/vite-plugin-vue-i18n": "^6.0.0", "@kyvg/vue3-notification": "^2.3.6", "@meforma/vue-toaster": "^1.3.0", + "@vueuse/core": "^9.1.1", "ansi_up": "^5.1.0", "dayjs": "^1.11.4", "floating-vue": "^2.0.0-beta.19", diff --git a/web/src/assets/locales/en.json b/web/src/assets/locales/en.json index e76b58d4f1..67e23587a1 100644 --- a/web/src/assets/locales/en.json +++ b/web/src/assets/locales/en.json @@ -190,7 +190,9 @@ "canceled": "This step has been canceled.", "cancel_success": "Pipeline canceled", "restart_success": "Pipeline restarted", - "log_download": "Download" + "log_download": "Download", + "log_auto_scroll": "Automatically scroll down", + "log_auto_scroll_off": "Turn off automatic scrolling" }, "protected": { "awaits": "This pipeline is awaiting approval by some maintainer!", diff --git a/web/src/assets/locales/lv.json b/web/src/assets/locales/lv.json index c86da1e92b..3340b41a96 100644 --- a/web/src/assets/locales/lv.json +++ b/web/src/assets/locales/lv.json @@ -165,7 +165,9 @@ "canceled": "Šis solis tika atcelts.", "cancel_success": "Konvejerdarbs atcelts", "restart_success": "Konvejerdarbs pārstartēts", - "log_download": "Lejupielādēt" + "log_download": "Lejupielādēt", + "log_auto_scroll": "Automātiski ritināt", + "log_auto_scroll_off": "Atslēgt automātisko ritināšanu" }, "protected": { "awaits": "Šim konvejerdarbam ir nepieciešams apstiprinājums no atbildīgajām personām!", diff --git a/web/src/components/atomic/Icon.vue b/web/src/components/atomic/Icon.vue index 68ab566591..fcbb970820 100644 --- a/web/src/components/atomic/Icon.vue +++ b/web/src/components/atomic/Icon.vue @@ -36,8 +36,10 @@ - + + +
@@ -84,7 +86,9 @@ export type IconNames = | 'close' | 'edit' | 'stopwatch' - | 'download'; + | 'download' + | 'auto-scroll' + | 'auto-scroll-off'; export default defineComponent({ name: 'Icon', diff --git a/web/src/components/build-feed/BuildFeedSidebar.vue b/web/src/components/build-feed/BuildFeedSidebar.vue index 290dbf34f5..b11d93cd61 100644 --- a/web/src/components/build-feed/BuildFeedSidebar.vue +++ b/web/src/components/build-feed/BuildFeedSidebar.vue @@ -1,7 +1,7 @@