Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mmui: ui touchups for bot deletion from /mm #3067

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/webserver/jsintl.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const (
idCEXBalances = "CEX_BALANCES"
idCausesSelfMatch = "CAUSES_SELF_MATCH"
idCexNotConnected = "CEX_NOT_CONNECTED"
idRemovingBotConfig = "REMOVING_BOT_CONFIG"
idDeleteBot = "DELETE_BOT"
)

var enUS = map[string]*intl.Translation{
Expand Down Expand Up @@ -436,7 +436,7 @@ var enUS = map[string]*intl.Translation{
idCEXBalances: {T: "{{ cexName }} Balances"},
idCausesSelfMatch: {T: "This order would cause a self-match"},
idCexNotConnected: {T: "{{ cexName }} not connected"},
idRemovingBotConfig: {T: "Are you sure you want to remove the config for the {{ baseSymbol }}-{{ quoteSymbol }} market on {{ host }}?"},
idDeleteBot: {T: "Are you sure you want to delete this bot for the {{ baseTicker }}-{{ quoteTicker }} market on {{ host }}?"},
}

var ptBR = map[string]*intl.Translation{
Expand Down
2 changes: 1 addition & 1 deletion client/webserver/locales/en-us.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,5 +678,5 @@ var EnUS = map[string]*intl.Translation{
"Priority": {T: "Priority"},
"Wallet Balances": {T: "Wallet Balances"},
"Placements": {T: "Placements"},
"removing_bot_config": {T: "Removing Bot Config"},
"delete_bot": {T: "Delete Bot"},
}
21 changes: 10 additions & 11 deletions client/webserver/site/src/html/mm.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@
<button data-tmpl="reconfigureBttn">
<span class="ico-settings fs17"></span>
</button>
<button class="ms-1 danger" data-tmpl="removeBttn">
<span class="ico-cross fs17"></span>
</button>
</div>
</div>
<span data-tmpl="offError" class="fs16 px-3 text-center text-warning d-hide"></span>
Expand Down Expand Up @@ -410,6 +407,12 @@
</div>
<div data-tmpl="placementsChart" class="flex-grow-1 border-start position-relative"></div>
</div>
<div class="py-1 px-3 d-flex justify-content-start grey border-top">
<span data-tmpl="removeBttn" class="pointer hoverbg flex-center">
<span class="ico-cross fs11 me-1"></span>
delete this bot
</span>
</div>
</div>

{{- /* NO FIAT RATES */ -}}
Expand Down Expand Up @@ -616,14 +619,10 @@

<form class="position-relative mw-425 d-hide" id="confirmRemoveForm" autocomplete="off">
<div class="form-closer"><span class="ico-cross"></span></div>
<div>
<header>[[[removing_bot_config]]]</header>
<div>
<span id="confirmRemoveCfgMsg"></span>
</div>
<button id="confirmRemoveConfigBttn" type="button" class="feature mt-2">Confirm</button>
<div id="removeCfgErr" class="fs15 text-center d-hide text-danger text-break"></div>
</div>
<header>[[[delete_bot]]]</header>
<div id="confirmRemoveCfgMsg"></div>
<button id="confirmRemoveConfigBttn" type="button" class="feature mt-2 mx-2">Confirm</button>
<div id="removeCfgErr" class="fs15 text-center d-hide text-danger text-break"></div>
</form>
</div> {{- /* END FORMS */ -}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/webserver/site/src/js/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export const ID_ORDER_REPORT_TITLE = 'ORDER_REPORT_TITLE'
export const ID_CEX_BALANCES = 'CEX_BALANCES'
export const ID_CAUSES_SELF_MATCH = 'CAUSES_SELF_MATCH'
export const ID_CEX_NOT_CONNECTED = 'CEX_NOT_CONNECTED'
export const ID_REMOVING_BOT_CONFIG = 'REMOVING_BOT_CONFIG'
export const ID_DELETE_BOT = 'DELETE_BOT'

let locale: Locale

Expand Down
8 changes: 3 additions & 5 deletions client/webserver/site/src/js/mm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,9 @@ export default class MarketMakerPage extends BasePage {
const page = this.page
this.removingCfg = mwh
Doc.hide(page.removeCfgErr)
const baseAsset = app().assets[mwh.baseID]
const quoteAsset = app().assets[mwh.quoteID]
const baseSymbol = baseAsset.symbol.toUpperCase()
const quoteSymbol = quoteAsset.symbol.toUpperCase()
page.confirmRemoveCfgMsg.textContent = intl.prep(intl.ID_REMOVING_BOT_CONFIG, { host: mwh.host, baseSymbol, quoteSymbol })
const { unitInfo: { conventional: { unit: baseTicker } } } = app().assets[mwh.baseID]
const { unitInfo: { conventional: { unit: quoteTicker } } } = app().assets[mwh.quoteID]
page.confirmRemoveCfgMsg.textContent = intl.prep(intl.ID_DELETE_BOT, { host: mwh.host, baseTicker, quoteTicker })
this.forms.show(this.page.confirmRemoveForm)
}

Expand Down
Loading