From 8380e78cea68c11b4d079109cb36c36d8586314d Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Sun, 17 Nov 2019 00:39:06 -0700 Subject: [PATCH] Drop server-url step in setup --- pages/auth/setup.vue | 112 ++++++++++--------------------------------- 1 file changed, 26 insertions(+), 86 deletions(-) diff --git a/pages/auth/setup.vue b/pages/auth/setup.vue index 258602ba88..b8f91e64a6 100644 --- a/pages/auth/setup.vue +++ b/pages/auth/setup.vue @@ -32,14 +32,6 @@ export default { return false; }, - serverSubmitDisabled() { - if ( !this.serverUrl ) { - return true; - } - - return false; - }, - githubSubmitDisabled() { if ( !this.clientId || !this.clientSecret ) { return true; @@ -64,12 +56,6 @@ export default { async asyncData({ route, req, store }) { const current = route.query[SETUP] || ''; const password = randomStr(); - const serverUrlSetting = await store.dispatch('rancher/find', { - type: RANCHER.SETTING, - id: 'server-url', - opt: { url: '/v3/settings/server-url' } - }); - const telemetrySetting = await store.dispatch('rancher/find', { type: RANCHER.SETTING, id: 'telemetry-opt', @@ -89,17 +75,12 @@ export default { opt: { url: '/v3/principals' } }); - let origin; - let serverUrl = serverUrlSetting.value; + let serverUrl; if ( process.server ) { - origin = req.headers.host; + serverUrl = req.headers.host; } else { - origin = window.location.origin; - } - - if ( !serverUrl ) { - serverUrl = origin; + serverUrl = window.location.origin; } const telemetry = telemetrySetting.value !== 'out'; @@ -125,7 +106,6 @@ export default { confirm: '', serverUrl, - serverUrlSetting, telemetry, telemetrySetting, @@ -145,6 +125,9 @@ export default { methods: { async finishPassword(buttonCb) { try { + this.telemetrySetting.value = this.telemetry ? 'in' : 'out'; + await this.telemetrySetting.save(); + await this.$store.dispatch('rancher/request', { url: '/v3/users?action=changepassword', method: 'post', @@ -175,23 +158,6 @@ export default { }); }, - async finishServerSettings(buttonCb) { - try { - this.serverUrlSetting.value = this.serverUrl; - await this.serverUrlSetting.save(); - - this.telemetrySetting.value = this.telemetry ? 'in' : 'out'; - await this.telemetrySetting.save(); - - buttonCb(true); - this.step = 3; - this.$router.applyQuery({ [STEP]: this.step }); - } catch (err) { - console.log(err); - buttonCb(false); - } - }, - async testGithub(buttonCb) { try { this.githubError = null; @@ -271,7 +237,7 @@ export default { }); buttonCb(true); - this.step = 4; + this.step = 3; this.$router.applyQuery({ [STEP]: this.step }); } catch (e) { buttonCb(false); @@ -376,6 +342,24 @@ export default { +
+ + + + + Rancher Labs would like to collect a bit of anonymized information
+ about the configuration of your installation to help make Rio better.

+ Your data will not be shared with anyone else, and no information about
+ what specific resources or endpoints you are deploying is included.
+ Once enabled you can view exactly what data will be sent at /v1-telemetry.

+ More Info +
+
+
+
@@ -387,50 +371,6 @@ export default {
-
-
-

Server Configuration

- - -
-
-
- - - - - Rancher Labs would like to collect a bit of anonymized information
- about the configuration of your installation to help make Rio better.

- Your data will not be shared with anyone else, and no information about
- what specific resources or endpoints you are deploying is included.
- Once enabled you can view exactly what data will be sent at /v1-telemetry.

- More Info -
-
-
-
-
- -
- -
-
- -
- -
-
-
- -

@@ -521,7 +461,7 @@ export default {

-
+

GitHub Integration, Part Deux