From bf31e54d9198ae097090a23c95faad93bf8e9b83 Mon Sep 17 00:00:00 2001 From: AaronDewes Date: Wed, 1 Jun 2022 08:55:26 +0000 Subject: [PATCH 01/10] Fix some type errors in Settings --- src/views/Settings.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 0e1ae93..9d3ef12 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -186,7 +186,6 @@ :success="isCorrectOtp" :error="isIncorrectOtp" @otp-token="setTotpToken" - @keyup="hideOtpError" />
@@ -202,7 +201,7 @@ Incorrect password -
+
Incorrect code
@@ -637,6 +636,8 @@ export default defineComponent({ showDmesg: boolean; authenticatorToken: string; pollUpdateStatus?: number; + isCorrectOtp: boolean; + isIncorrectOtp: boolean; }; }, computed: { @@ -652,9 +653,11 @@ export default defineComponent({ if (typeof this.systemStore.debugStatus === 'string') { return 'Error loading data!'; } - return this.showDmesg - ? this.systemStore.debugStatus.dmesg - : this.systemStore.debugStatus.debug; + return ( + this.showDmesg + ? this.systemStore.debugStatus.dmesg + : this.systemStore.debugStatus.debug + ) as string; }, debugFilename(): string { const type: string = this.showDmesg ? 'dmesg' : 'debug'; @@ -696,7 +699,7 @@ export default defineComponent({ } }, methods: { - setTotpToken(totpToken) { + setTotpToken(totpToken: string) { this.totpToken = totpToken; }, async enableTwoFactorAuth() { @@ -766,7 +769,7 @@ export default defineComponent({ async changePassword() { this.isChangingPassword = true; this.isIncorrectPassword = false; - this.isIncorrectTotp = false; + this.isIncorrectOtp = false; try { await this.sdkStore.citadel.manager.auth.changePassword( @@ -786,7 +789,7 @@ export default defineComponent({ const isIncorrectTotp = errorString.includes('Incorrect 2FA code'); this.isIncorrectPassword = isIncorrectPassword; - this.isIncorrectTotp = isIncorrectTotp; + this.isIncorrectOtp = isIncorrectTotp; this.isChangingPassword = false; return; From 286f6e71ecd6546fd9a61b88a2ef36dd0003b3c0 Mon Sep 17 00:00:00 2001 From: AaronDewes Date: Wed, 1 Jun 2022 15:09:14 +0000 Subject: [PATCH 02/10] UI to select update channel --- src/components/CardWidget.vue | 5 + src/components/ChannelSelector.vue | 189 +++++++++++++++++++++++++++++ src/global-styles/custom.scss | 11 ++ src/views/Settings.vue | 32 +++++ 4 files changed, 237 insertions(+) create mode 100644 src/components/ChannelSelector.vue diff --git a/src/components/CardWidget.vue b/src/components/CardWidget.vue index b622128..710ef71 100644 --- a/src/components/CardWidget.vue +++ b/src/components/CardWidget.vue @@ -4,6 +4,7 @@ footer-tag="footer" no-body class="mb-4 card-custom" + :class="highlighted ? 'highlight' : ''" >
@@ -92,6 +93,10 @@ const props = defineProps({ type: String, default: '', }, + highlighted: { + type: Boolean, + default: false, + }, status: { type: Object as PropType< | { diff --git a/src/components/ChannelSelector.vue b/src/components/ChannelSelector.vue new file mode 100644 index 0000000..d26d3df --- /dev/null +++ b/src/components/ChannelSelector.vue @@ -0,0 +1,189 @@ + + + + diff --git a/src/global-styles/custom.scss b/src/global-styles/custom.scss index 178759b..2963eca 100644 --- a/src/global-styles/custom.scss +++ b/src/global-styles/custom.scss @@ -229,6 +229,12 @@ button { &:hover { box-shadow: var(--card-shadow-hover); } + &.highlight { + box-shadow: var(--card-shadow), 0 0 0 3px var(--bs-primary); + &:hover { + box-shadow: var(--card-shadow-hover), 0 0 0 3px var(--bs-primary); + } + } border: none !important; outline: 0 !important; // Loading bar safari bug https://gist.github.com/ayamflow/b602ab436ac9f05660d9c15190f4fd7b @@ -910,3 +916,8 @@ html[data-theme='dark'] { .btn svg { width: 24px; } + +.card-grid { + display: grid; + grid-column-gap: 1rem; +} diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 9d3ef12..6ea6cf6 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -497,6 +497,28 @@
+
+
+
+ Features + Manage features you want +
+ Manage + +
+
Citadel Version @@ -579,6 +601,7 @@ import useSystemStore from '../store/system'; import useUserStore from '../store/user'; import {defineComponent, DefineComponent} from 'vue'; import useToast from '../utils/toast'; +import ChannelSelector from '../components/ChannelSelector.vue'; export default defineComponent({ components: { @@ -596,6 +619,7 @@ export default defineComponent({ BIconCheckCircleFill, BellIcon: BellIcon as DefineComponent, RefreshIcon: RefreshIcon as DefineComponent, + ChannelSelector, }, setup() { const sdkStore = useSdkStore(); @@ -619,6 +643,7 @@ export default defineComponent({ loadingDebug: false, debugFailed: false, showDmesg: false, + showChannelSelectorModal: false, authenticatorToken: '', } as { currentPassword: string; @@ -638,6 +663,7 @@ export default defineComponent({ pollUpdateStatus?: number; isCorrectOtp: boolean; isIncorrectOtp: boolean; + showChannelSelectorModal: boolean; }; }, computed: { @@ -839,6 +865,12 @@ export default defineComponent({ this.loadingDebug = false; (this.$refs['debug-modal'] as {hide: () => void}).hide(); }, + async openChannelModal() { + this.showChannelSelectorModal = true; + }, + closeChannelModal() { + this.showChannelSelectorModal = false; + }, downloadTextFile(contents: string, fileName: string) { const blob = new Blob([contents], { type: 'text/plain;charset=utf-8;', From 8395fd7ce01064fc3d93abc3f66be71284280956 Mon Sep 17 00:00:00 2001 From: AaronDewes Date: Wed, 8 Jun 2022 06:18:21 +0000 Subject: [PATCH 03/10] CSS fix --- src/components/ChannelSelector.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/ChannelSelector.vue b/src/components/ChannelSelector.vue index d26d3df..f9666f4 100644 --- a/src/components/ChannelSelector.vue +++ b/src/components/ChannelSelector.vue @@ -161,6 +161,10 @@ onUpdated(() => { });