diff --git a/package-lock.json b/package-lock.json
index b30a3d6..3cd4581 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7810,6 +7810,11 @@
"integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
"dev": true
},
+ "vuejs-datepicker": {
+ "version": "1.6.2",
+ "resolved": "https://registry.npmjs.org/vuejs-datepicker/-/vuejs-datepicker-1.6.2.tgz",
+ "integrity": "sha512-PkC4vxzFBo7i6FSCUAJfnaWOx6VkKbOqxijSGHHlWxh8FIUKEZVtFychkonVWtK3iwWfhmYtqHcwsmgxefLpLQ=="
+ },
"vuelidate": {
"version": "0.7.5",
"resolved": "https://registry.npmjs.org/vuelidate/-/vuelidate-0.7.5.tgz",
diff --git a/package.json b/package.json
index 140efbc..d4060ee 100644
--- a/package.json
+++ b/package.json
@@ -26,6 +26,7 @@
"vue-select": "^3.10.7",
"vue-snotify": "^3.2.1",
"vue-spinner": "^1.0.4",
+ "vuejs-datepicker": "^1.6.2",
"vuelidate": "^0.7.5",
"vuex": "^3.1.1"
},
diff --git a/src/_components/modals/AddSshKey.vue b/src/_components/modals/AddSshKey.vue
new file mode 100644
index 0000000..88a5f4d
--- /dev/null
+++ b/src/_components/modals/AddSshKey.vue
@@ -0,0 +1,200 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/_components/modals/AdvancedSettings.vue b/src/_components/modals/AdvancedSettings.vue
index 6886d9e..5d49534 100644
--- a/src/_components/modals/AdvancedSettings.vue
+++ b/src/_components/modals/AdvancedSettings.vue
@@ -95,14 +95,29 @@
-
+
SSH Key: {{ option.name }}
+
+ {{ option.name }}
+ (
+ {{
+ messages.date_format_ssh_key_expiration.parseDateMessage(
+ option.expiration,
+ messages
+ )
+ }}
+ {{ messages.message_ssh_key_no_expiration }}
+ )
+
+
@@ -165,11 +181,14 @@ import { util } from '~/_helpers';
import { Button, Input, Checkbox } from '../shared';
+import AddSSHKeyModal from './AddSshKey';
+
export default {
components: {
Button,
Input,
Checkbox,
+ AddSSHKeyModal,
},
data: () => ({
@@ -199,6 +218,7 @@ export default {
...mapState('domains', ['domains']),
...mapState('networks', ['nearestRegions']),
...mapState('footprints', ['footprints']),
+ ...mapState('users', ['sshKeys']),
timezoneObjects: function() {
const tz_objects = [];
@@ -237,6 +257,7 @@ export default {
...mapActions('domains', ['getAllDomains']),
...mapActions('networks', ['getNearestRegions']),
...mapActions('footprints', ['getAllFootprints']),
+ ...mapActions('users', ['listSshKeysByUserId']),
show() {
this.$modal.show('advanced-settings');
@@ -245,6 +266,10 @@ export default {
this.$modal.hide('advanced-settings');
},
+ addSSHKey() {
+ this.$refs.sshKeyModal.show();
+ },
+
initDefaults() {
const currentUser = util.currentUser();
@@ -263,6 +288,7 @@ export default {
messages: this.messages,
errors: this.errors,
});
+ this.onUpdateSSH();
},
findRegion(uuid) {
@@ -300,11 +326,19 @@ export default {
this.messages['tz_description_' + tz]
);
},
+
+ onUpdateSSH() {
+ const currentUser = util.currentUser();
+ this.listSshKeysByUserId({
+ userId: currentUser.uuid,
+ messages: this.messages,
+ errors: this.errors,
+ });
+ },
},
mounted() {
this.initDefaults();
- this.show();
},
watch: {
@@ -352,9 +386,7 @@ export default {
}
}
},
- },
- watch: {
domains(doms) {
if (doms && doms[0]) {
if (this.accountPlan.domain == null || this.accountPlan.domain === '')
diff --git a/src/_components/shared/Button.vue b/src/_components/shared/Button.vue
index 6b771f5..460af33 100644
--- a/src/_components/shared/Button.vue
+++ b/src/_components/shared/Button.vue
@@ -12,7 +12,9 @@
}"
:disabled="disabled"
:style="cssVars"
+ @click="onClick"
class="app-btn"
+ type="button"
>
@@ -148,5 +150,11 @@ export default {
};
},
},
+
+ methods: {
+ onClick(e) {
+ this.$emit('click', e);
+ },
+ },
};
diff --git a/src/_components/shared/Input.vue b/src/_components/shared/Input.vue
index 673eb8d..574613b 100644
--- a/src/_components/shared/Input.vue
+++ b/src/_components/shared/Input.vue
@@ -18,6 +18,11 @@ export default {
content: this.value,
};
},
+ watch: {
+ value(v) {
+ this.content = v;
+ }
+ },
methods: {
handleInput(e) {
this.$emit('input', this.content);
diff --git a/src/_pages/auth/ForgotPassword.vue b/src/_pages/auth/ForgotPassword.vue
index f577207..2d2397d 100644
--- a/src/_pages/auth/ForgotPassword.vue
+++ b/src/_pages/auth/ForgotPassword.vue
@@ -31,6 +31,7 @@