diff --git a/src/views/can-i-root/app.ts b/src/views/can-i-root/app.ts index 1bbc744..ce13046 100644 --- a/src/views/can-i-root/app.ts +++ b/src/views/can-i-root/app.ts @@ -31,7 +31,7 @@ function parseSearchTerm(q?: string): SearchTerm | undefined { interface ExploitMethod { name: string; key: keyof DeviceExploitAvailabilities; - url:string; + url: string; expert?: boolean; } @@ -88,13 +88,17 @@ class App extends Component { const avail = state.availability?.[exploit.key]; const firmware = state.term?.firmware ?? avail?.patched?.version; const patched = (avail?.patched && firmware && firmware >= avail.patched.version) || false; + const mayPatched = !patched && (avail?.latest && firmware && firmware > avail.latest.version) || false; + const bgClass = patched ? 'bg-danger-subtle' : mayPatched ? 'bg-warning-subtle' : 'bg-success-subtle'; + const iconClass = patched ? 'bi-exclamation-octagon-fill' : mayPatched ? + 'bi-question-octagon-fill' : 'bi-hand-thumbs-up-fill'; return avail && html` -
-

${exploit.name}

+
+

${exploit.name}

${avail.latest && html`
Latest known working firmware: ${avail.latest?.version} - + ${mayPatched && state.term?.firmware && html` (you have ${state.term.firmware})`}
`} ${avail.patched && html` diff --git a/src/views/can-i-root/index.hbs b/src/views/can-i-root/index.hbs index 2ae071e..0912470 100644 --- a/src/views/can-i-root/index.hbs +++ b/src/views/can-i-root/index.hbs @@ -3,5 +3,5 @@

CanI.RootMy.TV α

- {{/inline}} +{{/inline}} {{> page title="Can I root my TV?" }} \ No newline at end of file