mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-27 05:25:17 +00:00
Add bot name input
This commit is contained in:
parent
a330a39fe0
commit
f346f49e60
|
@ -1,6 +1,15 @@
|
|||
<template>
|
||||
<div>
|
||||
<form ref="form" novalidate @submit.stop.prevent="handleSubmit" @reset="handleReset">
|
||||
<b-form-group label="Bot Name" label-for="name-input">
|
||||
<b-form-input
|
||||
id="name-input"
|
||||
v-model="auth.botName"
|
||||
required
|
||||
placeholder="Bot Name"
|
||||
@keydown.enter.native="handleOk"
|
||||
></b-form-input>
|
||||
</b-form-group>
|
||||
<b-form-group
|
||||
:state="urlState"
|
||||
label="API Url"
|
||||
|
@ -26,6 +35,7 @@
|
|||
v-model="auth.username"
|
||||
:state="nameState"
|
||||
required
|
||||
placeholder="Freqtrader"
|
||||
@keydown.enter.native="handleOk"
|
||||
></b-form-input>
|
||||
</b-form-group>
|
||||
|
@ -84,6 +94,7 @@ export default class Login extends Vue {
|
|||
};
|
||||
|
||||
auth: AuthPayload = {
|
||||
botName: '',
|
||||
url: defaultURL,
|
||||
username: '',
|
||||
password: '',
|
||||
|
|
|
@ -56,6 +56,7 @@ export class UserService {
|
|||
return info[this.botId];
|
||||
}
|
||||
return {
|
||||
botName: '',
|
||||
apiUrl: '',
|
||||
refreshToken: '',
|
||||
accessToken: '',
|
||||
|
@ -100,6 +101,7 @@ export class UserService {
|
|||
);
|
||||
if (result.data.access_token && result.data.refresh_token) {
|
||||
const obj: AuthStorage = {
|
||||
botName: auth.botName,
|
||||
apiUrl: auth.url,
|
||||
accessToken: result.data.access_token || '',
|
||||
refreshToken: result.data.refresh_token || '',
|
||||
|
@ -169,6 +171,7 @@ export class UserService {
|
|||
typeof accessToken === 'string'
|
||||
) {
|
||||
const loginInfo: AuthStorage = {
|
||||
botName: '',
|
||||
apiUrl,
|
||||
refreshToken,
|
||||
accessToken,
|
||||
|
|
|
@ -31,7 +31,7 @@ export default function createBotStore(store) {
|
|||
},
|
||||
[MultiBotStoreGetters.nextBotId](state: FTMultiBotState): string {
|
||||
let botCount = state.availableBots.length;
|
||||
while (`ftbot.${botCount}` in state.availableBots) {
|
||||
while (state.availableBots.includes(`ftbot.${botCount}`)) {
|
||||
botCount += 1;
|
||||
}
|
||||
return `ftbot.${botCount}`;
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
export interface AuthPayload {
|
||||
botName: string;
|
||||
url: string;
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface AuthStorage {
|
||||
botName: string;
|
||||
apiUrl: string;
|
||||
refreshToken: string;
|
||||
accessToken: string;
|
||||
|
|
Loading…
Reference in New Issue
Block a user