mirror of
https://github.com/ankitects/anki.git
synced 2026-01-12 21:44:01 -05:00
"Help me pick" button
This commit is contained in:
parent
5406b6bd5c
commit
78d206b5d5
2 changed files with 25 additions and 38 deletions
|
|
@ -299,6 +299,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
}
|
}
|
||||||
|
|
||||||
let simulatorModal: Modal;
|
let simulatorModal: Modal;
|
||||||
|
let workloadModal: Modal;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<SpinBoxFloatRow
|
<SpinBoxFloatRow
|
||||||
|
|
@ -314,6 +315,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</SettingTitle>
|
</SettingTitle>
|
||||||
</SpinBoxFloatRow>
|
</SpinBoxFloatRow>
|
||||||
|
|
||||||
|
<button class="btn btn-primary" on:click={() => workloadModal?.show()}>
|
||||||
|
{"Help Me Pick"}
|
||||||
|
</button>
|
||||||
|
|
||||||
<Warning warning={desiredRetentionChangeInfo} className={"alert-info two-line"} />
|
<Warning warning={desiredRetentionChangeInfo} className={"alert-info two-line"} />
|
||||||
<Warning warning={desiredRetentionWarning} className={retentionWarningClass} />
|
<Warning warning={desiredRetentionWarning} className={retentionWarningClass} />
|
||||||
|
|
||||||
|
|
@ -409,6 +414,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
{onPresetChange}
|
{onPresetChange}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<SimulatorModal
|
||||||
|
bind:modal={workloadModal}
|
||||||
|
workload
|
||||||
|
{state}
|
||||||
|
{simulateFsrsRequest}
|
||||||
|
{computing}
|
||||||
|
{openHelpModal}
|
||||||
|
{onPresetChange}
|
||||||
|
/>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.btn {
|
.btn {
|
||||||
margin-bottom: 0.375rem;
|
margin-bottom: 0.375rem;
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
export let computing: boolean;
|
export let computing: boolean;
|
||||||
export let openHelpModal: (key: string) => void;
|
export let openHelpModal: (key: string) => void;
|
||||||
export let onPresetChange: () => void;
|
export let onPresetChange: () => void;
|
||||||
|
/** Do not modify this once set */
|
||||||
|
export let workload: boolean = false;
|
||||||
|
|
||||||
const config = state.currentConfig;
|
const config = state.currentConfig;
|
||||||
let simulateSubgraph: SimulateSubgraph = SimulateSubgraph.count;
|
let simulateSubgraph: SimulateSubgraph = SimulateSubgraph.count;
|
||||||
let simulateWorkloadSubgraph: SimulateWorkloadSubgraph =
|
let simulateWorkloadSubgraph: SimulateWorkloadSubgraph =
|
||||||
SimulateWorkloadSubgraph.ratio;
|
SimulateWorkloadSubgraph.ratio;
|
||||||
let workload: boolean = false;
|
|
||||||
let tableData: TableDatum[] = [];
|
let tableData: TableDatum[] = [];
|
||||||
let simulating: boolean = false;
|
let simulating: boolean = false;
|
||||||
const fsrs = state.fsrs;
|
const fsrs = state.fsrs;
|
||||||
|
|
@ -163,8 +164,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
} finally {
|
} finally {
|
||||||
simulating = false;
|
simulating = false;
|
||||||
if (resp) {
|
if (resp) {
|
||||||
// Clear the graph if transitioning from workload to simulation
|
|
||||||
|
|
||||||
simulationNumber += 1;
|
simulationNumber += 1;
|
||||||
const dailyTotalCount = addArrays(
|
const dailyTotalCount = addArrays(
|
||||||
resp.dailyReviewCount,
|
resp.dailyReviewCount,
|
||||||
|
|
@ -259,12 +258,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchModes() {
|
|
||||||
points = [];
|
|
||||||
simulationNumber = 0;
|
|
||||||
workload = !workload;
|
|
||||||
}
|
|
||||||
|
|
||||||
$: if (svg) {
|
$: if (svg) {
|
||||||
let pointsToRender = points;
|
let pointsToRender = points;
|
||||||
if (smooth) {
|
if (smooth) {
|
||||||
|
|
@ -331,7 +324,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<div class="modal-dialog modal-xl">
|
<div class="modal-dialog modal-xl">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title">{tr.deckConfigFsrsSimulatorExperimental()}</h5>
|
<h5 class="modal-title">
|
||||||
|
{#if workload}
|
||||||
|
Desired Retention Simulation Graph
|
||||||
|
{:else}
|
||||||
|
{tr.deckConfigFsrsSimulatorExperimental()}
|
||||||
|
{/if}
|
||||||
|
</h5>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="btn-close"
|
class="btn-close"
|
||||||
|
|
@ -522,7 +521,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="button-row">
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="btn {computing ? 'btn-warning' : 'btn-primary'}"
|
class="btn {computing ? 'btn-warning' : 'btn-primary'}"
|
||||||
|
|
@ -548,23 +547,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
{tr.deckConfigSaveOptionsToPreset()}
|
{tr.deckConfigSaveOptionsToPreset()}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
|
||||||
{#if workload}
|
|
||||||
Desired Retention Mode
|
|
||||||
{:else}
|
|
||||||
Simulation Mode
|
|
||||||
{/if}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div class="mode-switch">
|
|
||||||
<button
|
|
||||||
disabled={computing}
|
|
||||||
class="btn {computing ? 'btn-warning' : 'btn-primary'}"
|
|
||||||
on:click={switchModes}
|
|
||||||
>
|
|
||||||
Switch to {workload ? "Simulation" : "Desired Retention"} Mode
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if processing}
|
{#if processing}
|
||||||
|
|
@ -696,14 +678,4 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
summary {
|
summary {
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-row {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr auto 1fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mode-switch {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row-reverse;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue