Skip to content

Commit 2b3140c

Browse files
committed
21_added_coin/g_stable_v
1 parent a150dfe commit 2b3140c

3 files changed

Lines changed: 33 additions & 12 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ bash .\scripts\env_api.sh
4545
It create an .env fil with text, u need to put your apis keys to that file after "="
4646

4747
```
48-
BYBIT_API_KEY =oleg
49-
BYBIT_API_SECRET =andrii
50-
BYBIT_API_KEY_TEST =serhii
51-
BYBIT_API_SECRET_TEST =sasha
52-
BINANCE_API_KEY =vladik
53-
BINANCE_API_SECRET =vasya
54-
BINANCE_API_KEY_TEST =tolik
55-
BINANCE_API_SECRET_TEST =nikita
48+
BYBIT_API_KEY =your api
49+
BYBIT_API_SECRET =your api
50+
BYBIT_API_KEY_TEST =your api
51+
BYBIT_API_SECRET_TEST =your api
52+
BINANCE_API_KEY =your api
53+
BINANCE_API_SECRET =your api
54+
BINANCE_API_KEY_TEST =your api
55+
BINANCE_API_SECRET_TEST =your api
5656
```
5757

5858
Run code by pressing "F5"

gui.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,26 @@ def create_tab_ui(self, layout, session, testnet, exchange, settings=None):
324324
funding_web_view = QWebEngineView()
325325
page = QWebEnginePage(profile, funding_web_view) # Створюємо сторінку з профілем
326326
funding_web_view.setPage(page) # Призначаємо сторінку з профілем до QWebEngineView
327-
funding_web_view.setMinimumHeight(300) # Залишаємо висоту
328-
layout.addWidget(funding_web_view)
327+
funding_web_view.setMinimumHeight(150) # Зменшуємо висоту
329328
tab_data["funding_web_view"] = funding_web_view
330329
tab_data["web_profile"] = profile # Зберігаємо профіль у tab_data для подальшого використання
331330
self.update_tab_funding_web_view(tab_data)
331+
#
332+
# Додаємо Coinglass view
333+
coinglass_profile = QWebEngineProfile(f"CoinglassProfile_{self.tab_count}", self)
334+
coinglass_cache_path = os.path.join(os.getcwd(), "webcache", f"coinglass_tab_{self.tab_count}")
335+
os.makedirs(coinglass_cache_path, exist_ok=True)
336+
coinglass_profile.setCachePath(coinglass_cache_path)
337+
coinglass_profile.setPersistentStoragePath(coinglass_cache_path)
338+
coinglass_profile.setPersistentCookiesPolicy(QWebEngineProfile.PersistentCookiesPolicy.AllowPersistentCookies)
339+
340+
coinglass_view = QWebEngineView()
341+
coinglass_page = QWebEnginePage(coinglass_profile, coinglass_view)
342+
coinglass_view.setPage(coinglass_page)
343+
coinglass_view.setMinimumHeight(150)
344+
coinglass_view.setUrl(QUrl("https://www.coinglass.com/FundingRate"))
345+
tab_data["coinglass_view"] = coinglass_view
346+
tab_data["coinglass_profile"] = coinglass_profile
332347
#
333348
price_label = QLabel(self.translations[self.language]["price_label"])
334349
balance_label = QLabel(self.translations[self.language]["balance_label"])
@@ -381,7 +396,12 @@ def create_tab_ui(self, layout, session, testnet, exchange, settings=None):
381396

382397
hbox = QHBoxLayout()
383398
hbox.addLayout(left_layout, 1)
384-
hbox.addWidget(funding_web_view, 1)
399+
400+
right_layout = QVBoxLayout()
401+
right_layout.addWidget(funding_web_view)
402+
right_layout.addWidget(coinglass_view)
403+
404+
hbox.addLayout(right_layout, 1)
385405

386406
layout.addLayout(hbox)
387407
tab_data.update({
@@ -952,7 +972,8 @@ def update_tab_funding_web_view(self, tab_data):
952972
tab_data["funding_web_view"].setUrl(QUrl(url))
953973
tab_data["funding_web_view"].setVisible(True)
954974
else:
955-
tab_data["funding_web_view"].setVisible(False) # Ховаємо для Binance
975+
tab_data["funding_web_view"].setVisible(False)
976+
tab_data["coinglass_view"].setVisible(True) # Завжди показувати Coinglass
956977
#
957978
def closeEvent(self, event):
958979
for tab_data in self.tab_data_list:

images/Screenshot.png

42.7 KB
Loading

0 commit comments

Comments
 (0)