feat(route-optimizer): add configurable download and upload weights for bandwidth scoring in AI settings
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m34s

This commit is contained in:
2026-03-05 11:00:46 +07:00
parent 2f4b1f6671
commit aab9ed0601
2 changed files with 58 additions and 2 deletions
+44
View File
@@ -125,6 +125,8 @@ export default function SettingsPage() {
const [aiLatencyWeight, setAiLatencyWeight] = useState('0.55');
const [aiBandwidthWeight, setAiBandwidthWeight] = useState('0.35');
const [aiFreshnessWeight, setAiFreshnessWeight] = useState('0.10');
const [aiDownloadWeight, setAiDownloadWeight] = useState('0.5');
const [aiUploadWeight, setAiUploadWeight] = useState('0.5');
const [aiHomeToJhWeight, setAiHomeToJhWeight] = useState('0.45');
const [aiJhToExitWeight, setAiJhToExitWeight] = useState('0.55');
const [aiProbabilityScale, setAiProbabilityScale] = useState('5');
@@ -529,6 +531,12 @@ export default function SettingsPage() {
setAiFreshnessWeight(
ai?.freshnessWeight != null ? String(ai.freshnessWeight) : '0.10'
);
setAiDownloadWeight(
ai?.downloadWeight != null ? String(ai.downloadWeight) : '0.5'
);
setAiUploadWeight(
ai?.uploadWeight != null ? String(ai.uploadWeight) : '0.5'
);
setAiHomeToJhWeight(
ai?.combineHomeToJumphostWeight != null
? String(ai.combineHomeToJumphostWeight)
@@ -773,6 +781,14 @@ export default function SettingsPage() {
latencyWeight: Math.max(0, parseFloat(aiLatencyWeight) || 0.55),
bandwidthWeight: Math.max(0, parseFloat(aiBandwidthWeight) || 0.35),
freshnessWeight: Math.max(0, parseFloat(aiFreshnessWeight) || 0.1),
downloadWeight: Math.max(
0,
Number.isFinite(parseFloat(aiDownloadWeight)) ? parseFloat(aiDownloadWeight) : 0.5
),
uploadWeight: Math.max(
0,
Number.isFinite(parseFloat(aiUploadWeight)) ? parseFloat(aiUploadWeight) : 0.5
),
combineHomeToJumphostWeight: Math.max(
0,
parseFloat(aiHomeToJhWeight) || 0.45
@@ -1585,6 +1601,34 @@ export default function SettingsPage() {
/>
</div>
<div className="col-12 mt-1"><h4 className="subheader">Баланс bandwidth (DL/UL)</h4></div>
<div className="col-12 col-md-6">
<FormField
label="Вес Download (DL)"
name="aiDownloadWeight"
type="number"
value={aiDownloadWeight}
onChange={setAiDownloadWeight}
helpText="Внутренний вес DL в bandwidth score сегмента."
disabled={saving}
min={0}
step="0.01"
/>
</div>
<div className="col-12 col-md-6">
<FormField
label="Вес Upload (UL)"
name="aiUploadWeight"
type="number"
value={aiUploadWeight}
onChange={setAiUploadWeight}
helpText="Внутренний вес UL в bandwidth score сегмента."
disabled={saving}
min={0}
step="0.01"
/>
</div>
<div className="col-12 mt-2"><h4 className="subheader">Сборка полного маршрута</h4></div>
<div className="col-12 col-md-6">
<FormField