From 8dbb686cfc8374050dc3223e0dddc7c3a30c173c Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Fri, 10 Jan 2020 18:42:46 -0500 Subject: [PATCH] add ssh key to NewNetworkPage --- src/account/NewNetworkPage.vue | 140 +++++++++++++++++++++++---------- 1 file changed, 97 insertions(+), 43 deletions(-) diff --git a/src/account/NewNetworkPage.vue b/src/account/NewNetworkPage.vue index 462a1b7..ebb26a0 100644 --- a/src/account/NewNetworkPage.vue +++ b/src/account/NewNetworkPage.vue @@ -37,10 +37,32 @@
{{ errors.first('name') }}
+ +
+ + +
{{ errors.first('plan') }}
+ +
+
+ {{messages.field_label_plan}}: + {{messages['plan_name_'+defaults.plan]}} + + +
+
+ {{messages['plan_description_'+accountPlan.plan]}} +
+
+
- +
{{ errors.first('domain') }}
@@ -52,10 +74,37 @@
+
+ + +
+
+ +
+ + +
+ + +
{{ errors.first('region') }}
+ +
+
+ {{messages.field_label_region}}: + {{defaults.region.name}} (~{{parseInt(defaults.region.distance/1000)}} {{messages.msg_km_distance_away}}) + + +
+
+
- +
{{ errors.first('locale') }}
@@ -82,45 +131,12 @@

- -
- - -
{{ errors.first('plan') }}
- -
-
- {{messages.field_label_plan}}: - {{messages['plan_name_'+defaults.plan]}} - - -
-
- {{messages['plan_description_'+accountPlan.plan]}} -
-
- - -
- - -
{{ errors.first('region') }}
- -
-
- {{messages.field_label_region}}: - {{defaults.region.name}} (~{{parseInt(defaults.region.distance/1000)}} {{messages.msg_km_distance_away}}) - - -
-
-
- +
{{ errors.first('footprint') }}
@@ -135,6 +151,29 @@
+ +
+ + +
{{ errors.first('sshPublicKey') }}
+ + {{messages.link_label_account_ssh_keys}} +
+
+ {{messages.field_label_network_ssh_key}}: + {{messages.message_network_ssh_key_do_not_install}} + +
+
{{messages.field_description_network_ssh_key}}
+
+ + +
+ +
+
@@ -185,6 +224,7 @@ data() { return { user: util.currentUser(), + showAdvanced: false, accountPlan: { name: '', domain: '', @@ -196,7 +236,8 @@ uuid: null, paymentMethodType: null, paymentInfo: null - } + }, + sshKey: '' }, cloudRegionUuid: null, regions: [], @@ -206,7 +247,8 @@ timezone: false, plan: false, footprint: false, - region: false + region: false, + sshKey: false }, defaults: { domain: '', @@ -214,7 +256,8 @@ timezone: '', plan: 'bubble', footprint: 'Worldwide', - region: '' + region: '', + sshKey: '' }, submitted: false, status: { @@ -236,7 +279,7 @@ ...mapState('networks', { error: state => state.error }), - ...mapState('users', ['policy']), + ...mapState('users', ['policy', 'sshKeys']), ...mapState('account', ['actionStatus']), isComplete() { return (this.accountPlan.name !== '') @@ -283,10 +326,20 @@ } } return fp_array; + }, + sshKeyObjects: function () { + if (this.sshKeys) { + const keyObjects = []; + keyObjects.push({name: this.messages.message_network_ssh_key_do_not_install, value: ''}); + for (let i=0; i