From 28a9fd48e2e7907bdd7660bd6ed3b38c6e4351a5 Mon Sep 17 00:00:00 2001 From: SKANKHUNTER <31552675+MrBurrBurr@users.noreply.github.com> Date: Thu, 30 Jul 2020 00:27:15 +0200 Subject: [PATCH 1/8] Initial commit --- src/components/BotCard.vue | 10 +++++ src/i18n/locale/default.json | 3 ++ src/models/Bot.js | 1 + src/router/routes.js | 9 ++++ src/store/modules/asf.js | 4 ++ src/utils/getUserInputType.js | 14 ++++++ src/views/modals/Bot.vue | 14 +++++- src/views/modals/BotInput.vue | 81 +++++++++++++++++++++++++++++++++++ 8 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 src/utils/getUserInputType.js create mode 100644 src/views/modals/BotInput.vue diff --git a/src/components/BotCard.vue b/src/components/BotCard.vue index 22063efa1..086181013 100644 --- a/src/components/BotCard.vue +++ b/src/components/BotCard.vue @@ -27,6 +27,7 @@ + + From 5631a25bed5f3a912bc850273a5c4abf73693ffa Mon Sep 17 00:00:00 2001 From: SKANKHUNTER <31552675+MrBurrBurr@users.noreply.github.com> Date: Thu, 30 Jul 2020 23:00:13 +0200 Subject: [PATCH 2/8] Handle all input types --- src/components/BotCard.vue | 7 +++-- src/i18n/locale/default.json | 13 ++++++++-- src/plugins/icons.js | 4 +-- src/router/routes.js | 2 +- src/views/modals/Bot.vue | 5 ++-- src/views/modals/BotInput.vue | 49 ++++++++++++++++++++++++++--------- 6 files changed, 56 insertions(+), 24 deletions(-) diff --git a/src/components/BotCard.vue b/src/components/BotCard.vue index 086181013..be8addf36 100644 --- a/src/components/BotCard.vue +++ b/src/components/BotCard.vue @@ -80,12 +80,11 @@ try { const inputType = getUserInputType(this.bot.requiredInput); - // todo: check for other input types - if (headless && inputType === 'TwoFactorAuthentication') { - this.$router.push({ name: 'bot-input', params: { bot: this.bot.name } }); + if (this.headless && inputType !== 'None') { + this.$router.push({ name: 'bot-input', params: { bot: this.bot.name, type: inputType } }); return; } - + await this.$http.botAction(this.bot.name, 'start'); await this.$store.dispatch('bots/updateBot', { name: this.bot.name, active: true }); } catch (err) { diff --git a/src/i18n/locale/default.json b/src/i18n/locale/default.json index bb2311a13..c0e9127bb 100644 --- a/src/i18n/locale/default.json +++ b/src/i18n/locale/default.json @@ -79,9 +79,18 @@ "global-config": "Global Config", "info": "Info", "input-all-selected": "All values selected", - "input-info": "This account is currently using a Steam authenticator app.", - "input-label": "Please enter your 2FA code from your Steam authenticator app:", + "input-info-login": "You have not set a login name for this account.", + "input-info-password": "You have not set a password for this account.", + "input-info-steamguard": "FIX ME: Missing steamguard text", + "input-info-steamparentalcode": "FIX ME: Need steam parental code", + "input-info-twofactorauthentication": "This account is currently using a Steam authenticator app.", + "input-label-login": "Please enter your Steam login name:", + "input-label-password": "Please enter your Steam password:", + "input-label-steamguard": "FIX ME: Please enter your steamguard code from your mail", + "input-label-steamparentalcode": "FIX ME: Please enter your steam parental code", + "input-label-twofactorauthentication": "Please enter your 2FA code from your Steam authenticator app:", "input-submit": "Submit", + "input-switch-visibility": "Switch input field visibility", "input-unknown-type": "Unknown field type", "keep-unchanged": "", "keys-copied": "Copied keys to clipboard!", diff --git a/src/plugins/icons.js b/src/plugins/icons.js index 857733c4c..2ad337ef5 100644 --- a/src/plugins/icons.js +++ b/src/plugins/icons.js @@ -6,7 +6,7 @@ import { faTimesCircle, faCheckCircle, faEdit, faTimes, faSquare, faMoon, faPalette, faPlay, faQuestion, faPlus, faSpinner, faKey, faTrash, faCloudDownloadAlt, faSignOutAlt, faAngleDown, faLanguage, faGamepad, faClone, faCalendarCheck, faLock, faBookOpen, faExclamation, faCodeBranch, faHourglassEnd, faHourglassHalf, faHourglassStart, - faRedoAlt, faClipboard, faPuzzlePiece, faUndoAlt, + faRedoAlt, faClipboard, faPuzzlePiece, faUndoAlt, faEye, faEyeSlash, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon, FontAwesomeLayers } from '@fortawesome/vue-fontawesome'; @@ -15,7 +15,7 @@ library.add(faWrench, faBars, faLaptop, faUsers, faFileAlt, faTachometerAlt, faP faClock, faTimesCircle, faCheckCircle, faEdit, faTimes, faSquare, faMoon, faPalette, faPlay, faQuestion, faPlus, faSpinner, faKey, faTrash, faCloudDownloadAlt, faSignOutAlt, faAngleDown, faLanguage, faGamepad, faClone, faCalendarCheck, faLock, faGithub, faBookOpen, faExclamation, faCodeBranch, faHourglassEnd, faHourglassHalf, - faHourglassStart, faRedoAlt, faClipboard, faPuzzlePiece, faUndoAlt); + faHourglassStart, faRedoAlt, faClipboard, faPuzzlePiece, faUndoAlt, faEye, faEyeSlash); export default { install(Vue) { diff --git a/src/router/routes.js b/src/router/routes.js index 924f02bff..ec6b44874 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -102,7 +102,7 @@ export default [ meta: { modal: true } }, { - path: '/page/bot/:bot/input', + path: '/page/bot/:bot/input/:type', name: 'bot-input', components: { default: () => import('../views/Bots.vue'), diff --git a/src/views/modals/Bot.vue b/src/views/modals/Bot.vue index 397c503e9..2982bd964 100644 --- a/src/views/modals/Bot.vue +++ b/src/views/modals/Bot.vue @@ -106,9 +106,8 @@ async start() { const inputType = getUserInputType(this.bot.requiredInput); - // todo: check for other input types - if (headless && inputType === 'TwoFactorAuthentication') { - this.$router.push({ name: 'bot-input', params: { bot: this.bot.name } }); + if (this.headless && inputType !== 'None') { + this.$router.push({ name: 'bot-input', params: { bot: this.bot.name, type: inputType } }); return; } diff --git a/src/views/modals/BotInput.vue b/src/views/modals/BotInput.vue index e9aecc27c..fc9d6bc3a 100644 --- a/src/views/modals/BotInput.vue +++ b/src/views/modals/BotInput.vue @@ -4,10 +4,18 @@

{{ bot.name }}

-
{{ $t('input-info') }}
+
{{ $t(`input-info-${inputType}`) }}
- - +
+ + +
+
+ +