mirror of https://github.com/rancher/dashboard.git
Drop server-url step in setup
This commit is contained in:
parent
4154752707
commit
8380e78cea
|
|
@ -32,14 +32,6 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
serverSubmitDisabled() {
|
|
||||||
if ( !this.serverUrl ) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
githubSubmitDisabled() {
|
githubSubmitDisabled() {
|
||||||
if ( !this.clientId || !this.clientSecret ) {
|
if ( !this.clientId || !this.clientSecret ) {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -64,12 +56,6 @@ export default {
|
||||||
async asyncData({ route, req, store }) {
|
async asyncData({ route, req, store }) {
|
||||||
const current = route.query[SETUP] || '';
|
const current = route.query[SETUP] || '';
|
||||||
const password = randomStr();
|
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', {
|
const telemetrySetting = await store.dispatch('rancher/find', {
|
||||||
type: RANCHER.SETTING,
|
type: RANCHER.SETTING,
|
||||||
id: 'telemetry-opt',
|
id: 'telemetry-opt',
|
||||||
|
|
@ -89,17 +75,12 @@ export default {
|
||||||
opt: { url: '/v3/principals' }
|
opt: { url: '/v3/principals' }
|
||||||
});
|
});
|
||||||
|
|
||||||
let origin;
|
let serverUrl;
|
||||||
let serverUrl = serverUrlSetting.value;
|
|
||||||
|
|
||||||
if ( process.server ) {
|
if ( process.server ) {
|
||||||
origin = req.headers.host;
|
serverUrl = req.headers.host;
|
||||||
} else {
|
} else {
|
||||||
origin = window.location.origin;
|
serverUrl = window.location.origin;
|
||||||
}
|
|
||||||
|
|
||||||
if ( !serverUrl ) {
|
|
||||||
serverUrl = origin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const telemetry = telemetrySetting.value !== 'out';
|
const telemetry = telemetrySetting.value !== 'out';
|
||||||
|
|
@ -125,7 +106,6 @@ export default {
|
||||||
confirm: '',
|
confirm: '',
|
||||||
|
|
||||||
serverUrl,
|
serverUrl,
|
||||||
serverUrlSetting,
|
|
||||||
|
|
||||||
telemetry,
|
telemetry,
|
||||||
telemetrySetting,
|
telemetrySetting,
|
||||||
|
|
@ -145,6 +125,9 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
async finishPassword(buttonCb) {
|
async finishPassword(buttonCb) {
|
||||||
try {
|
try {
|
||||||
|
this.telemetrySetting.value = this.telemetry ? 'in' : 'out';
|
||||||
|
await this.telemetrySetting.save();
|
||||||
|
|
||||||
await this.$store.dispatch('rancher/request', {
|
await this.$store.dispatch('rancher/request', {
|
||||||
url: '/v3/users?action=changepassword',
|
url: '/v3/users?action=changepassword',
|
||||||
method: 'post',
|
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) {
|
async testGithub(buttonCb) {
|
||||||
try {
|
try {
|
||||||
this.githubError = null;
|
this.githubError = null;
|
||||||
|
|
@ -271,7 +237,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
buttonCb(true);
|
buttonCb(true);
|
||||||
this.step = 4;
|
this.step = 3;
|
||||||
this.$router.applyQuery({ [STEP]: this.step });
|
this.$router.applyQuery({ [STEP]: this.step });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
buttonCb(false);
|
buttonCb(false);
|
||||||
|
|
@ -376,6 +342,24 @@ export default {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox mt-20">
|
||||||
|
<label>
|
||||||
|
<input v-model="telemetry" type="checkbox" />
|
||||||
|
Allow collection of anonymous statistics to help us improve Rio
|
||||||
|
</label>
|
||||||
|
<v-popover placement="right">
|
||||||
|
<i class="icon icon-info" />
|
||||||
|
<span slot="popover">
|
||||||
|
Rancher Labs would like to collect a bit of anonymized information<br />
|
||||||
|
about the configuration of your installation to help make Rio better.<br /><br />
|
||||||
|
Your data will not be shared with anyone else, and no information about<br />
|
||||||
|
what specific resources or endpoints you are deploying is included.<br />
|
||||||
|
Once enabled you can view exactly what data will be sent at <code>/v1-telemetry</code>.<br /><br />
|
||||||
|
<a href="https://rancher.com/docs/rancher/v2.x/en/faq/telemetry/" target="_blank">More Info</a>
|
||||||
|
</span>
|
||||||
|
</v-popover>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="mt-20">
|
<div class="mt-20">
|
||||||
<AsyncButton key="passwordSubmit" type="submit" mode="continue" :disabled="passwordSubmitDisabled" @click="finishPassword" />
|
<AsyncButton key="passwordSubmit" type="submit" mode="continue" :disabled="passwordSubmitDisabled" @click="finishPassword" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -387,50 +371,6 @@ export default {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="step === 2">
|
<div v-if="step === 2">
|
||||||
<div class="row">
|
|
||||||
<div class="col span-6">
|
|
||||||
<h1>Server Configuration</h1>
|
|
||||||
<LabeledInput
|
|
||||||
v-model.trim="serverUrl"
|
|
||||||
type="url"
|
|
||||||
label="Server URL"
|
|
||||||
class="mt-20"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="mt-20">
|
|
||||||
<div>
|
|
||||||
<div class="checkbox">
|
|
||||||
<label>
|
|
||||||
<input v-model="telemetry" type="checkbox" />
|
|
||||||
Allow collection of anonymous statistics to help us improve Rio
|
|
||||||
</label>
|
|
||||||
<v-popover placement="right">
|
|
||||||
<i class="icon icon-info" />
|
|
||||||
<span slot="popover">
|
|
||||||
Rancher Labs would like to collect a bit of anonymized information<br />
|
|
||||||
about the configuration of your installation to help make Rio better.<br /><br />
|
|
||||||
Your data will not be shared with anyone else, and no information about<br />
|
|
||||||
what specific resources or endpoints you are deploying is included.<br />
|
|
||||||
Once enabled you can view exactly what data will be sent at <code>/v1-telemetry</code>.<br /><br />
|
|
||||||
<a href="https://rancher.com/docs/rancher/v2.x/en/faq/telemetry/" target="_blank">More Info</a>
|
|
||||||
</span>
|
|
||||||
</v-popover>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mt-20">
|
|
||||||
<AsyncButton key="serverSubmit" type="submit" mode="continue" :disabled="serverSubmitDisabled" @click="finishServerSettings" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col span-6">
|
|
||||||
<img src="~/assets/images/setup-step-one.svg" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="step === 3">
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col span-6">
|
<div class="col span-6">
|
||||||
<h1 class="mb-20">
|
<h1 class="mb-20">
|
||||||
|
|
@ -521,7 +461,7 @@ export default {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="step === 4">
|
<div v-if="step === 3">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col span-6">
|
<div class="col span-6">
|
||||||
<h1>GitHub Integration, Part Deux</h1>
|
<h1>GitHub Integration, Part Deux</h1>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue