Skip to content

Commit 54affa7

Browse files
authored
Merge pull request #1360 from Drakkar-Software/dev
Dev merge
2 parents ed19e5e + 72b8563 commit 54affa7

File tree

31 files changed

+652
-97
lines changed

31 files changed

+652
-97
lines changed

.github/workflows/cron.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

Services/Interfaces/web_interface/api/config.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# License along with this library.
1616
import flask
1717

18+
import octobot_commons.authentication
19+
import octobot.community.errors
1820
import octobot_services.interfaces.util as interfaces_util
1921
import tentacles.Services.Interfaces.web_interface.login as login
2022
import tentacles.Services.Interfaces.web_interface.models as models
@@ -109,3 +111,25 @@ def trading_strategies_tentacles_details(backtestable_only):
109111
"strategies": strategy_config[models.STRATEGIES_KEY],
110112
"evaluators": evaluators,
111113
})
114+
115+
116+
@blueprint.route('/tradingview_confirm_email_content', methods=["GET"])
117+
@login.login_required_when_activated
118+
def tradingview_confirm_email_content():
119+
try:
120+
return util.get_rest_reply(
121+
flask.jsonify(models.get_last_email_address_confirm_code_email_content()), 200
122+
)
123+
except octobot_commons.authentication.AuthenticationRequired:
124+
return util.get_rest_reply(flask.jsonify("authentication required"), 401)
125+
126+
127+
@blueprint.route('/trigger_wait_for_email_address_confirm_code_email', methods=["POST"])
128+
@login.login_required_when_activated
129+
def trigger_wait_for_email_address_confirm_code_email():
130+
try:
131+
models.wait_for_email_address_confirm_code_email()
132+
return util.get_rest_reply(flask.jsonify(""), 200)
133+
except octobot.community.errors.ExtensionRequiredError as err:
134+
return util.get_rest_reply(flask.jsonify(str(err)), 401)
135+

Services/Interfaces/web_interface/controllers/community.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,13 @@ def extensions():
8888
auto_refresh_packages=refresh_packages and loop == "true",
8989
has_owned_packages_to_install=models.has_owned_packages_to_install(),
9090
)
91+
92+
@blueprint.route("/tradingview_email_config")
93+
@login.login_required_when_activated
94+
def tradingview_email_config():
95+
models.wait_for_login_if_processing()
96+
return flask.render_template(
97+
'tradingview_email_config.html',
98+
is_community_authenticated=authentication.Authenticator.instance().is_logged_in(),
99+
tradingview_email_address=models.get_tradingview_email_address(),
100+
)

Services/Interfaces/web_interface/models/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@
6565
has_open_source_package,
6666
update_owned_packages,
6767
get_checkout_url,
68+
get_tradingview_email_address,
69+
get_last_email_address_confirm_code_email_content,
70+
wait_for_email_address_confirm_code_email,
6871
get_cloud_strategies,
6972
get_cloud_strategy,
7073
get_preview_tentacles_packages,
@@ -296,6 +299,9 @@
296299
"has_open_source_package",
297300
"update_owned_packages",
298301
"get_checkout_url",
302+
"get_tradingview_email_address",
303+
"get_last_email_address_confirm_code_email_content",
304+
"wait_for_email_address_confirm_code_email",
299305
"get_cloud_strategies",
300306
"get_cloud_strategy",
301307
"get_preview_tentacles_packages",

Services/Interfaces/web_interface/models/community.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# You should have received a copy of the GNU Lesser General Public
1515
# License along with this library.
1616
import asyncio
17+
import typing
1718

1819
import octobot_services.interfaces.util as interfaces_util
1920
import octobot.community as octobot_community
@@ -61,6 +62,20 @@ def get_checkout_url(payment_method, redirect_url) -> (bool, str):
6162
return False, "error when fetching checkout url"
6263

6364

65+
def get_tradingview_email_address() -> str:
66+
return authentication.Authenticator.instance().get_saved_tradingview_email()
67+
68+
69+
def get_last_email_address_confirm_code_email_content() -> typing.Optional[str]:
70+
return authentication.Authenticator.instance().get_last_email_address_confirm_code_email_content()
71+
72+
73+
def wait_for_email_address_confirm_code_email():
74+
return interfaces_util.run_in_bot_main_loop(
75+
authentication.Authenticator.instance().trigger_wait_for_email_address_confirm_code_email()
76+
)
77+
78+
6479
def get_cloud_strategies(authenticator) -> list[octobot_community.StrategyData]:
6580
return interfaces_util.run_in_bot_main_loop(authenticator.get_strategies())
6681

Services/Interfaces/web_interface/static/css/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,10 @@ a:hover.badge {
666666
height: auto;
667667
}
668668

669+
.pointer-cursor {
670+
cursor: pointer;
671+
}
672+
669673
/* tables */
670674
table.dataTable thead th,
671675
table.dataTable tfoot th {

Services/Interfaces/web_interface/static/img/svg/octobot.svg

Lines changed: 52 additions & 1 deletion
Loading
20.2 KB
Loading
39.2 KB
Loading
18.9 KB
Loading

0 commit comments

Comments
 (0)