Skip to content

Commit 2fdddc4

Browse files
committed
Login dialog progress
1 parent 9cd94c0 commit 2fdddc4

File tree

5 files changed

+54
-22
lines changed

5 files changed

+54
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@
5151
"browserslist": [
5252
"last 1 version, not dead, ie >= 11"
5353
]
54-
}
54+
}

src/components/CommandDialog.vue

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@
4747
<q-btn
4848
v-for="object in currentCommandMaster.login"
4949
:key="object.name"
50-
:label="object.name"
50+
:label="$t(onlineCredentials.name ? 'loginDone' : 'loginRequired', { name: object.name })"
5151
:icon="onlineCredentials.name ? 'mdi-account-check' : 'mdi-login-variant'"
5252
:color="onlineCredentials.name ? 'green' : 'red'"
5353
@click="showLoginCommand(object)"
54+
class="full-width q-my-sm"
5455
no-wrap
5556
no-caps
56-
></q-btn>
57+
/>
5758
</div>
5859
<!-- Workflows only - Previous command parameters -->
5960
<q-expansion-item
@@ -243,14 +244,39 @@ export default {
243244
}
244245
},
245246
showLoginCommand (object) {
246-
// TODO: Finish login command dialog
247247
this.$q.dialog({
248248
title: object.name,
249-
message: `
250-
${object.description}
251-
`,
252-
html: true,
253-
color: 'primary'
249+
message: object.description,
250+
color: 'primary',
251+
ok: this.$t('login'),
252+
cancel: true
253+
}).onOk(() => {
254+
// Should open external window with login object
255+
this.$pwsh.shell.addCommand(object.commandBlock)
256+
this.$pwsh.shell.invoke().then(o => {
257+
console.log(`Login command for ${object.name} executed succesfully.`)
258+
this.$q.notify({
259+
timeout: 2000,
260+
icon: 'info',
261+
multiLine: false,
262+
message: this.$t('loginSuccesful'),
263+
actions: [
264+
{ label: this.$t('dismiss'), color: 'primary' }
265+
]
266+
})
267+
}).catch(e => {
268+
console.error(`Attempt to login to ${object.name} failed with error: ${e}`)
269+
this.$q.notify({
270+
timeout: 5000,
271+
multiLine: false,
272+
type: 'negative',
273+
icon: 'error',
274+
message: this.$t('failedToLogin'),
275+
actions: [
276+
{ label: this.$t('dismiss'), color: 'white' }
277+
]
278+
})
279+
})
254280
})
255281
},
256282
showParameterHelp (param) {

src/i18n/cs-cz/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
usernameRequired: 'Zadejte přihlašovací jméno!', // Used in: LoginPage.vue
66
password: 'Heslo', // Used in: LoginPage.vue
77
passwordRequired: 'Zadejte přihlašovací heslo!', // Used in: LoginPage.vue
8-
login: 'Přihlásit', // Used in: LoginPage.vue
8+
login: 'Přihlásit', // Used in: LoginPage.vue, ScriptsPage.vue
99
loginSkip: 'Přeskočit', // Used in: LoginPage.vue
1010
language: 'Jazyk', // Used in: LoginPage.vue
1111
changeUser: 'Jiný uživatel', // Used in: LoginPage.vue
@@ -15,7 +15,7 @@ export default {
1515
pwshMissing: 'Nelze nalézt PowerShell Core. Používá se záložní Windows PowerShell.', // Used in: LoginPage.vue
1616
wrongUsernameOrPassword: 'Špatné přihlašovací jméno nebo heslo.', // Used in: LoginPage.vue
1717
foundsavedCredential: 'Nalezeny přihlašovací údaje pro uživatele {usr}.', // Used in: LoginPage.vue
18-
failedToLogin: 'Nepodařilo se přihlásení s neznámou chybou.', // Used in: LoginPage.vue
18+
failedToLogin: 'Nepodařilo se přihlášení.', // Used in: LoginPage.vue, ScriptsPage.vue
1919
search: 'Vyhledat', // Used in: FullLayout.vue
2020
history: 'Historie', // Used in: FullLayout.vue
2121
visibleGroups: 'Zobrazované příkazy', // Used in: FullLayout.vue
@@ -61,6 +61,9 @@ export default {
6161
type: 'Typ', // Used in: ScriptsPage.vue
6262
none: 'Není', // Used in: ScriptsPage.vue
6363
format: 'Formát', // Used in: ScriptsPage.vue
64+
loginRequired: 'Přihlásit se k: {name}', // Used in: ScriptsPage.vue
65+
loginDone: 'Znovu se přihlásit k: {name}', // Used in: ScriptsPage.vue
66+
loginSuccesful: 'Příkaz přihlášení úspěšně dokončen.', // Used in: ScriptsPage.vue
6467
updateFound: 'Stahování nejnovější verze aplikace Lazy Admin.', // Used in: FullLayout.vue
6568
updateError: 'Nepodařilo se stáhnout aktualizaci aplikace Lazy Admin.', // Used in: FullLayout.vue
6669
definitionsError: 'Chyba aktualizace definic.', // Used in: AboutPage.vue

src/i18n/en-us/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
usernameRequired: 'Login username is required!', // Used in: LoginPage.vue
66
password: 'Password', // Used in: LoginPage.vue
77
passwordRequired: 'Login password is required!', // Used in: LoginPage.vue
8-
login: 'Login', // Used in: LoginPage.vue
8+
login: 'Login', // Used in: LoginPage.vue, ScriptsPage.vue
99
loginSkip: 'Skip', // Used in: LoginPage.vue
1010
language: 'Language', // Used in: LoginPage.vue
1111
changeUser: 'Change User', // Used in: LoginPage.vue
@@ -15,7 +15,7 @@ export default {
1515
pwshMissing: 'Couldn\'t find PowerShell Core, default. Using fallback Windows PowerShell.', // Used in: LoginPage.vue
1616
wrongUsernameOrPassword: 'Wrong username or password.', // Used in: LoginPage.vue
1717
foundsavedCredential: 'Found stored credentials for user {usr}.', // Used in: LoginPage.vue
18-
failedToLogin: 'Login failed with unknown error.', // Used in: LoginPage.vue
18+
failedToLogin: 'Login failed.', // Used in: LoginPage.vue, ScriptsPage.vue
1919
search: 'Search', // Used in: FullLayout.vue
2020
history: 'History', // Used in: FullLayout.vue
2121
visibleGroups: 'Shown commands', // Used in: FullLayout.vue
@@ -61,6 +61,9 @@ export default {
6161
type: 'Type', // Used in: ScriptsPage.vue
6262
none: 'None', // Used in: ScriptsPage.vue
6363
format: 'Format', // Used in: ScriptsPage.vue
64+
loginRequired: 'Login to: {name}', // Used in: ScriptsPage.vue
65+
loginDone: 'Login again to: {name}', // Used in: ScriptsPage.vue
66+
loginSuccesful: 'Login command executed successfully.', // Used in: ScriptsPage.vue
6467
updateFound: 'Downloading the latest version of Lazy Admin.', // Used in: FullLayout.vue
6568
updateError: 'Could not download update for Lazy Admin application.', // Used in: FullLayout.vue
6669
definitionsError: 'Definitions update error.', // Used in: AboutPage.vue

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4042,9 +4042,9 @@ [email protected]:
40424042
mime "^2.4.6"
40434043

40444044
electron-to-chromium@^1.3.523:
4045-
version "1.3.544"
4046-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.544.tgz#ac1f7d319f6060f3d6d122261d542ec77eb1427e"
4047-
integrity sha512-jx6H7M1db76Q/dI3MadZC4qwNTvpiq8tdYEJswxexrIm5bH+LKRdg+VAteMF1tJJbBLrcuogE9N3nxT3Dp1gag==
4045+
version "1.3.545"
4046+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.545.tgz#d9add694c78554b8c00bc6e6fc929d5ccd7d1b99"
4047+
integrity sha512-+0R/i17u5E1cwF3g0W8Niq3UUKTUMyyT4kLkutZUHG8mDNvFsAckK3HIanzGVtixe3b6rknD8k7gHiR6nKFkgg==
40484048

40494049
electron-updater@^4.3.1:
40504050
version "4.3.4"
@@ -4060,9 +4060,9 @@ electron-updater@^4.3.1:
40604060
semver "^7.3.2"
40614061

40624062
electron@^7.0.0:
4063-
version "7.3.2"
4064-
resolved "https://registry.yarnpkg.com/electron/-/electron-7.3.2.tgz#184b69fe9089693e179b3b34effa975dfc8e505d"
4065-
integrity sha512-5uSWVfCJogiPiU0G+RKi4ECnNs0gPNjAwYVE9KR7RXaOJYcpNIC5RFejaaUnuRoBssJ5B1n/5WU6wDUxvPajWQ==
4063+
version "7.3.3"
4064+
resolved "https://registry.yarnpkg.com/electron/-/electron-7.3.3.tgz#f61502a3d42d85adfecd8e37f98da449b591f8af"
4065+
integrity sha512-PrJEsuRiaAhTDHtbH3EM+RIne+nZ6ifGChUadmtmPqHUQ+rIhf4jSi2ZN768IgBDw4SidMJiCrvQRiuDha9+Ew==
40664066
dependencies:
40674067
"@electron/get" "^1.0.1"
40684068
"@types/node" "^12.0.12"
@@ -4429,9 +4429,9 @@ etag@~1.8.1:
44294429
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
44304430

44314431
eventemitter3@^4.0.0:
4432-
version "4.0.5"
4433-
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.5.tgz#51d81e4f1ccc8311a04f0c20121ea824377ea6d9"
4434-
integrity sha512-QR0rh0YiPuxuDQ6+T9GAO/xWTExXpxIes1Nl9RykNGTnE1HJmkuEfxJH9cubjIOQZ/GH4qNBR4u8VSHaKiWs4g==
4432+
version "4.0.6"
4433+
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.6.tgz#1258f6fa51b4908aadc2cd624fcd6e64f99f49d6"
4434+
integrity sha512-s3GJL04SQoM+gn2c14oyqxvZ3Pcq7cduSDqy3sBFXx6UPSUmgVYwQM9zwkTn9je0lrfg0gHEwR42pF3Q2dCQkQ==
44354435

44364436
events@^3.0.0:
44374437
version "3.2.0"

0 commit comments

Comments
 (0)