Skip to content

Commit

Permalink
Merge branch 'main' into fix/keyring_fe
Browse files Browse the repository at this point in the history
  • Loading branch information
shanimal08 authored Feb 26, 2025
2 parents 84a2346 + a3ce88d commit 2a57019
Show file tree
Hide file tree
Showing 22 changed files with 85 additions and 20 deletions.
1 change: 1 addition & 0 deletions public/locales/af/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "Tari Universe sal outomaties herbegin sodra jou beursie ingevoer is",
"invalid-seed-words": "Voer 24 woorde in, geskei deur spasies",
"invalid-stats-server-port": "Ongeldige statistieke bedienerpoort",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "Uitnodigingskode",
"is-on-orphan-chain": "Dit lyk of jy aan \"n vurk gekoppel is, en nie die hoofketting nie. Enige blokke wat jy wen, mag ongeldig verklaar word.",
"last-block-added-time": "Tyd toe laaste blok by ketting gevoeg was",
Expand Down
1 change: 1 addition & 0 deletions public/locales/cn/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "钱包导入后,Tari Universe 将自动重启",
"invalid-seed-words": "输入24个用空格分隔的单词",
"invalid-stats-server-port": "无效的统计服务器端口",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "邀请代码",
"is-on-orphan-chain": "您似乎连接到了一个分叉,而不是主链。您赢得的任何区块可能会被作废。",
"last-block-added-time": "最后添加到链的块时间",
Expand Down
1 change: 1 addition & 0 deletions public/locales/de/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "Tari Universe wird automatisch neu starten, sobald dein Wallet importiert wurde",
"invalid-seed-words": "Geben Sie 24 Wörter ein, getrennt durch Leerzeichen",
"invalid-stats-server-port": "Ungültiger Statistik-Server-Port",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "Einladungscode",
"is-on-orphan-chain": "Sie scheinen mit einem Fork verbunden zu sein und nicht mit der Hauptkette. Alle gewonnenen Blöcke könnten ungültig werden.",
"last-block-added-time": "Letzte Blockzeit, die zur Kette hinzugefügt wurde",
Expand Down
1 change: 1 addition & 0 deletions public/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "Tari Universe will restart automatically once your wallet has been imported",
"invalid-seed-words": "Enter 24 words separated by spaces",
"invalid-stats-server-port": "Invalid stats server port",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "Invite Code",
"is-on-orphan-chain": "You seem to be connected to a fork, and not the main chain. Any blocks you win might be invalidated.",
"last-block-added-time": "Last block added to chain time",
Expand Down
1 change: 1 addition & 0 deletions public/locales/fr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "Tari Universe redémarrera automatiquement une fois que votre portefeuille aura été importé",
"invalid-seed-words": "Entrez 24 mots séparés par des espaces",
"invalid-stats-server-port": "Port du serveur de statistiques invalide",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "Code d\"invitation",
"is-on-orphan-chain": "Vous semblez être connecté à une branche secondaire, et non à la chaîne principale. Tout bloc que vous gagnez pourrait être invalidé.",
"last-block-added-time": "Heure du dernier bloc ajouté à la chaîne",
Expand Down
1 change: 1 addition & 0 deletions public/locales/hi/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "एक बार आपका वॉलेट आयात हो जाने पर Tari Universe स्वचालित रूप से पुनः आरंभ होगा",
"invalid-seed-words": "24 शब्दों को स्पेस से अलग करके दर्ज करें",
"invalid-stats-server-port": "अमान्य सांख्यिकी सर्वर पोर्ट",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "आमंत्रण कोड",
"is-on-orphan-chain": "आप एक फोर्क से जुड़े हुए प्रतीत होते हैं, और मुख्य चेन से नहीं। आपके द्वारा जीते गए किसी भी ब्लॉक को अमान्य किया जा सकता है।",
"last-block-added-time": "श्रृंखला में जोड़ा गया अंतिम ब्लॉक समय",
Expand Down
1 change: 1 addition & 0 deletions public/locales/id/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "Tari Universe akan memulai ulang secara otomatis setelah dompet Anda diimpor",
"invalid-seed-words": "Masukkan 24 kata yang dipisahkan oleh spasi",
"invalid-stats-server-port": "Port server statistik tidak valid",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "Kode Undangan",
"is-on-orphan-chain": "Anda tampaknya terhubung ke cabang, bukan rantai utama. Blok yang Anda menangkan mungkin akan dibatalkan.",
"last-block-added-time": "Waktu blok terakhir ditambahkan ke rantai",
Expand Down
1 change: 1 addition & 0 deletions public/locales/ja/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "ウォレットがインポートされると、Tari Universe は自動的に再起動します",
"invalid-seed-words": "スペースで区切って24の単語を入力してください",
"invalid-stats-server-port": "無効な統計サーバーポート",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "招待コード",
"is-on-orphan-chain": "フォークに接続されているようです。メインチェーンではありません。獲得したブロックは無効になる可能性があります。",
"last-block-added-time": "最後のブロックがチェーンに追加された時間",
Expand Down
1 change: 1 addition & 0 deletions public/locales/ko/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "지갑이 가져오면 Tari Universe가 자동으로 재시작됩니다",
"invalid-seed-words": "공백으로 구분된 24개의 단어를 입력하세요",
"invalid-stats-server-port": "잘못된 통계 서버 포트",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "초대 코드",
"is-on-orphan-chain": "당신은 포크에 연결된 것 같으며, 메인 체인이 아닙니다. 당신이 획득한 블록은 무효화될 수 있습니다.",
"last-block-added-time": "마지막 블록 체인 추가 시간",
Expand Down
1 change: 1 addition & 0 deletions public/locales/pl/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"importing-wallet-copy": "Tari Universe uruchomi się ponownie automatycznie po zaimportowaniu portfela",
"invalid-seed-words": "Wprowadź 24 słowa oddzielone spacjami",
"invalid-stats-server-port": "Nieprawidłowy port serwera statystyk",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "Kod Zaproszenia",
"is-on-orphan-chain": "Wygląda na to, że jesteś połączony z rozwidleniem, a nie z głównym łańcuchem. Wszelkie wygrane bloki mogą zostać unieważnione.",
"last-block-added-time": "Czas dodania ostatniego bloku do łańcucha",
Expand Down
1 change: 1 addition & 0 deletions public/locales/ru/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "Tari Universe будет автоматически перезапущен, когда Ваш кошелек будет импортирован",
"invalid-seed-words": "Введите 24 слова, разделенные пробелами",
"invalid-stats-server-port": "Неверный порт сервера статистики",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "Код приглашения",
"is-on-orphan-chain": "Похоже, что Вы подключены к форку, а не к основной цепочке. Любые выигранные Вами блоки могут быть аннулированы.",
"last-block-added-time": "Время добавления последнего блока в цепь",
Expand Down
1 change: 1 addition & 0 deletions public/locales/tr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"importing-wallet-copy": "Cüzdanınız içe aktarıldığında Tari Universe otomatik olarak yeniden başlayacak",
"invalid-seed-words": "Boşluklarla ayrılmış 24 kelime girin",
"invalid-stats-server-port": "Geçersiz istatistik sunucu portu",
"invalid-stats-server-port-empty": "Stats server port cannot be empty",
"inviteCode": "Davet Kodu",
"is-on-orphan-chain": "Bir çatal ile bağlantılı görünüyorsunuz, ana zincirle değil. Kazandığınız bloklar geçersiz kılınabilir.",
"last-block-added-time": "Zincir zamanına eklenen son blok",
Expand Down
7 changes: 6 additions & 1 deletion src-tauri/src/internal_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ impl InternalWallet {
Some(p) => p.clone(),
None => return Err(anyhow!("No config path found")),
};
let passphrase = CredentialManager::default_with_dir(path)

let path_parent = path
.parent()
.ok_or_else(|| anyhow!("Failed to get parent directory of wallet config file"))?;

let passphrase = CredentialManager::default_with_dir(path_parent.to_path_buf())
.get_credentials()?
.tari_seed_passphrase;

Expand Down
2 changes: 2 additions & 0 deletions src/components/elements/buttons/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const BaseIconButton = styled.button<StyleProps>`
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
height: 34px;
width: 34px;
border-radius: 100%;
Expand All @@ -22,6 +23,7 @@ const BaseIconButton = styled.button<StyleProps>`
}
&:disabled {
opacity: 0.3;
pointer-events: none;
}
${({ $size }) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ import styled from 'styled-components';

export const StyledInput = styled(Input)<{ hasError?: boolean }>(({ theme, hasError }) => ({
borderColor: hasError ? theme.palette.error.main : theme.colorsAlpha.darkAlpha[10],
boxSizing: 'border-box',
}));

export const NodesSettingsContainer = styled.div`
display: flex;
flex-direction: column;
width: 100%;
position: relative;
border-top: 1px solid ${({ theme }) => theme.palette.divider};
padding-top: 20px;
margin-top: 10px;
margin-top: 20px;
&:before {
content: 'Monerod Nodes URLs';
position: absolute;
Expand All @@ -26,3 +28,14 @@ export const NodesSettingsContainer = styled.div`
letter-spacing: -0.1px;
padding-right: 12px;
`;

export const AddButtonContainer = styled.div`
position: absolute;
background-color: ${({ theme }) => theme.palette.background.paper};
top: -18px;
right: 0;
width: 42px;
display: flex;
align-items: center;
justify-content: flex-end;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Button } from '@app/components/elements/buttons/Button.tsx';

import { Controller, useFieldArray, useForm } from 'react-hook-form';
import { IconButton } from '@app/components/elements/buttons/IconButton';
import { NodesSettingsContainer, StyledInput } from './MonerodMarkup.styles';
import { AddButtonContainer, NodesSettingsContainer, StyledInput } from './MonerodMarkup.styles';

import {
SettingsGroup,
Expand Down Expand Up @@ -89,9 +89,13 @@ const MonerodMarkup = () => {
)}
</SettingsGroupAction>
</SettingsGroup>

{!form_use_monero_fail ? (
<NodesSettingsContainer>
<AddButtonContainer>
<IconButton onClick={() => append('')}>
<IoAddCircleOutline color="green" size={20} />
</IconButton>
</AddButtonContainer>
{fields.map((field, index) => (
<Stack key={field.id} direction="row" alignItems="center" style={{ margin: '4px 0' }}>
<Controller
Expand All @@ -115,16 +119,11 @@ const MonerodMarkup = () => {
);
}}
/>
{fields.length > 1 && (
<IconButton onClick={() => remove(index)}>
<IoRemoveCircleOutline color="red" size={20} />
</IconButton>
)}
<IconButton onClick={() => remove(index)} disabled={fields.length <= 1}>
<IoRemoveCircleOutline color="red" size={20} />
</IconButton>
</Stack>
))}
<IconButton onClick={() => append('')}>
<IoAddCircleOutline color="green" size={20} />
</IconButton>
</NodesSettingsContainer>
) : null}
</SettingsGroupWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const P2poolMarkup = () => {
const [editedCustomStatsServerPort, setEditedCustomStatsServerPort] = useState(customStatsServerPort);
const [isRandomStatsServerPort, setIsRandomStatsServerPort] = useState(!customStatsServerPort);
const [currentStatsServerPort, setCurrentStatsServerPort] = useState(customStatsServerPort);

useEffect(() => {
invoke('get_used_p2pool_stats_server_port').then(setCurrentStatsServerPort).catch(console.error);
}, []);
Expand Down Expand Up @@ -76,6 +75,11 @@ const P2poolMarkup = () => {
[currentStatsServerPort, editedCustomStatsServerPort, isRandomStatsServerPort]
);

const emptyContext = currentStatsServerInputPort ? '' : 'empty';
const errorMessage = hasStatsServerPortError(currentStatsServerInputPort)
? t('invalid-stats-server-port', { context: emptyContext })
: null;

return (
<>
<SettingsGroupWrapper>
Expand All @@ -88,7 +92,7 @@ const P2poolMarkup = () => {
</Typography>
</SettingsGroupTitle>
</SettingsGroupContent>
<SettingsGroupAction style={{ alignItems: 'center' }}>
<SettingsGroupAction style={{ alignItems: 'center', minHeight: 50 }}>
{isSaveButtonVisible && <Button onClick={onSave}>{t('save')}</Button>}
</SettingsGroupAction>
</SettingsGroup>
Expand All @@ -108,9 +112,7 @@ const P2poolMarkup = () => {
setEditedCustomStatsServerPort(Number(target.value.trim()));
}}
/>
<ErrorTypography variant="p">
{hasStatsServerPortError(currentStatsServerInputPort) && t('invalid-stats-server-port')}
</ErrorTypography>
<ErrorTypography variant="p">{!isRandomStatsServerPort && errorMessage}</ErrorTypography>
</SettingsGroupContent>
<SettingsGroupAction>
<ToggleSwitch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
import styled from 'styled-components';
import { Typography } from '@app/components/elements/Typography.tsx';

export const BlockTimeContainer = styled.div`
export const BlockTimeContainer = styled.div<{ $visualModeOn?: boolean }>`
display: flex;
flex-direction: column;
font-weight: 500;
position: relative;
align-items: flex-end;
padding-right: 10px;
z-index: 1;
&:after {
content: '';
position: absolute;
background: ${({ theme }) => `linear-gradient(150deg, transparent 50%, ${theme.palette.background.main} 90%);`};
right: 0;
bottom: 0;
width: 130px;
height: 120px;
z-index: 0;
display: ${({ $visualModeOn }) => ($visualModeOn ? 'flex' : 'none')};
}
`;

export const TitleTypography = styled(Typography)`
font-size: 13px;
color: ${({ theme }) => theme.palette.text.secondary};
z-index: 1;
`;

export const TimerTypography = styled.div`
Expand All @@ -24,6 +38,7 @@ export const TimerTypography = styled.div`
gap: 2px;
display: flex;
text-transform: uppercase;
z-index: 1;
`;

export const SpacedNum = styled('span')`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import { useBlockchainVisualisationStore } from '@app/store/useBlockchainVisuali
import { BlockTimeContainer, SpacedNum, TimerTypography, TitleTypography } from './BlockTime.styles';
import { useMiningMetricsStore } from '@app/store/useMiningMetricsStore.ts';

import { useAppConfigStore } from '@app/store/useAppConfigStore.ts';

function BlockTime() {
const { t } = useTranslation('mining-view', { useSuspense: false });
const isCPUMining = useMiningMetricsStore((s) => s.cpu_mining_status.is_mining);
const isGPUMining = useMiningMetricsStore((s) => s.gpu_mining_status.is_mining);
const displayBlockTime = useBlockchainVisualisationStore((s) => s.displayBlockTime);
const isConnectedToTari = useMiningMetricsStore((s) => s.isNodeConnected);
const visualMode = useAppConfigStore((s) => s.visual_mode);
const isMining = isCPUMining || isGPUMining;

const { daysString, hoursString, minutes, seconds } = displayBlockTime || {};
Expand All @@ -22,7 +25,7 @@ function BlockTime() {
) : null;

return displayBlockTime && isMining && isConnectedToTari ? (
<BlockTimeContainer>
<BlockTimeContainer $visualModeOn={visualMode}>
<TimerTypography>
{daysMarkup}
{hourMarkup}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as m from 'motion/react-m';
import { convertHexToRGBA } from '@app/utils/convertHex.ts';

export const Wrapper = styled.div`
overflow: hidden;
top: 40px;
width: 60vw;
display: flex;
Expand Down
1 change: 1 addition & 0 deletions src/i18initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ i18n.use(HttpBackend)
Language.DE,
],
saveMissingTo: 'all',
contextSeparator: '-',
});
14 changes: 14 additions & 0 deletions src/theme/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ export const DashboardContainer = styled.div<{ $visualModeOff?: boolean }>`
padding: 20px;
height: 100%;
&:after {
content: '';
position: absolute;
background: ${({ theme }) =>
`radial-gradient(140% 90% at 35% 20%, transparent 93%, ${theme.palette.background.main} 98%)`};
right: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: 0;
display: ${({ $visualModeOff }) => ($visualModeOff ? 'none' : 'flex')};
}
${({ $visualModeOff, theme }) =>
$visualModeOff &&
css`
Expand Down

0 comments on commit 2a57019

Please sign in to comment.