Skip to content
Merged

Android #1002

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 android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "com.remoteit"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 286
versionName "3.40.2"
versionCode 287
versionName "3.41.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.12.1'
classpath 'com.android.tools.build:gradle:8.13.0'
classpath 'com.google.gms:google-services:4.4.0'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
4 changes: 2 additions & 2 deletions electron/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remoteit",
"version": "3.40.2",
"version": "3.41.0",
"private": true,
"main": "build/index.js",
"description": "Remote.It cross platform desktop application for creating and hosting connections",
Expand Down Expand Up @@ -169,4 +169,4 @@
"build/**/*"
]
}
}
}
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remoteit-desktop-frontend",
"version": "3.40.2",
"version": "3.41.0",
"private": true,
"type": "module",
"scripts": {
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/components/AvatarMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ export const AvatarMenu: React.FC = () => {
to="/account"
badge={licenseIndicator}
onClick={handleClose}
>
{browser.isAndroid && <Icon name="launch" size="sm" color="grayDark" inlineLeft fixedWidth />}
</ListItemLocation>
/>
<ListItemLink
title="Support"
icon="life-ring"
Expand Down
12 changes: 7 additions & 5 deletions frontend/src/components/EventList/EventList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { List, Box, Button, Typography } from '@mui/material'
import { fontSizes, spacing } from '../../styling'
import { humanizeDays, limitDays } from '../../models/plans'
import { EventItem } from './EventItem'
import { MobileUI } from '../MobileUI'
import { Notice } from '../Notice'
import browser from '../../services/browser'

export interface LogListProps {
device?: IDevice
Expand All @@ -28,7 +28,7 @@ export const EventList: React.FC<LogListProps> = ({ device }) => {
await dispatch.logs.fetch({ allowedDays, deviceId: device?.id })
}

const showPlanUpgradeNotice = Boolean(planUpgrade && !fetching && !fetchingMore && !browser.isAndroid)
const showPlanUpgradeNotice = Boolean(planUpgrade && !fetching && !fetchingMore)

return (
<>
Expand All @@ -41,9 +41,11 @@ export const EventList: React.FC<LogListProps> = ({ device }) => {
<Notice
severity="warning"
button={
<Button to="/account/plans" variant="contained" color="warning" size="small" component={Link}>
Upgrade
</Button>
<MobileUI android hide>
<Button to="/account/plans" variant="contained" color="warning" size="small" component={Link}>
Upgrade
</Button>
</MobileUI>
}
>
Plan upgrade required to view logs past {humanizeDays(logLimit?.value)}.
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/components/SidebarNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ export const SidebarNav: React.FC = () => {
icon="scripting"
match={['/script', '/scripts', '/runs']}
dense
>
<Chip size="small" label="BETA" sx={{ fontSize: 9 }} />
</ListItemLocation>
/>
<ListItemLocation title="Organization" to="/organization" icon="industry-alt" dense />
<ListItemLocation title="Logs" to="/logs" icon="rectangle-history" dense exactMatch />
<ListItemButton onClick={() => setMore(!more)} sx={{ marginTop: 2 }}>
Expand Down
39 changes: 5 additions & 34 deletions frontend/src/models/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,6 @@ import { RootModel } from '.'

const DAY_MS = 24 * 60 * 60 * 1000

const toTimestamp = (value?: Date | string) => (value ? new Date(value).getTime() : undefined)

const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max)

const evaluateRetention = ({
items,
minDate,
hasMore,
allowedDays,
}: {
items: IEvent[]
minDate?: Date
hasMore?: boolean
allowedDays: number
}) => {
const minDateMs = toTimestamp(minDate)
const oldestMs = toTimestamp(items[items.length - 1]?.timestamp)
const boundaryReady = Boolean(items.length && !hasMore && minDateMs !== undefined && oldestMs !== undefined)
if (!boundaryReady) return { reached: false, near: false }

const reached = oldestMs! <= minDateMs!
const thresholdDays = clamp(allowedDays > 0 ? allowedDays * 0.1 : 1, 0.25, 1)
const near = !reached && oldestMs! - minDateMs! <= thresholdDays * DAY_MS

return { reached, near }
}

type ILogState = {
size: number
after?: string
Expand Down Expand Up @@ -93,18 +66,16 @@ export default createModel<RootModel>()({
items: mergedItems,
}

const { reached, near } = evaluateRetention({
items: mergedItems,
minDate,
hasMore: nextEvents.hasMore,
allowedDays,
})
const hasReachedLimit = !nextEvents.hasMore && allowedDays > 0
const firstLogMs = state.user.created?.getTime() || 0
const logLimitMs = Date.now() - allowedDays * DAY_MS
const planUpgrade = hasReachedLimit && firstLogMs < logLimitMs

set({
events: nextEvents,
fetching: false,
fetchingMore: false,
planUpgrade: reached || near,
planUpgrade,
})
},

Expand Down
15 changes: 9 additions & 6 deletions frontend/src/pages/AccountPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { List, Typography, Tooltip, ButtonBase } from '@mui/material'
import { ListItemLocation } from '../components/ListItemLocation'
import { windowOpen } from '../services/browser'
import { Container } from '../components/Container'
import { MobileUI } from '../components/MobileUI'
import { Logo } from '@common/brand/Logo'
import { Icon } from '../components/Icon'

Expand Down Expand Up @@ -33,12 +34,14 @@ export const AccountPage: React.FC = () => {
dense
/>
<ListItemLocation title="Security" to="/account/security" icon="lock" dense />
<ListItemLocation title="Subscription" to="/account/plans" icon="shopping-cart" dense>
{!browser.hasBilling && <Icon name="launch" size="sm" color="grayDark" inlineLeft fixedWidth />}
</ListItemLocation>
<ListItemLocation title="Billing" to="/account/billing" icon="credit-card-front" dense>
{!browser.hasBilling && <Icon name="launch" size="sm" color="grayDark" inlineLeft fixedWidth />}
</ListItemLocation>
<MobileUI android hide>
<ListItemLocation title="Subscription" to="/account/plans" icon="shopping-cart" dense>
{!browser.hasBilling && <Icon name="launch" size="sm" color="grayDark" inlineLeft fixedWidth />}
</ListItemLocation>
<ListItemLocation title="Billing" to="/account/billing" icon="credit-card-front" dense>
{!browser.hasBilling && <Icon name="launch" size="sm" color="grayDark" inlineLeft fixedWidth />}
</ListItemLocation>
</MobileUI>
<ListItemLocation title="License" to="/account/license" icon="id-badge" dense />
<ListItemLocation title="Access Keys" to="/account/accessKey" icon="key" dense />
</List>
Expand Down
64 changes: 31 additions & 33 deletions frontend/src/routers/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,39 +346,37 @@ export const Router: React.FC<{ layout: ILayout }> = ({ layout }) => {
</Route>
{/* Account */}
<Route path="/account">
<RedirectOffsite to={browser.isAndroid ? 'https://link.remote.it/portal/account' : undefined}>
<DynamicPanel
primary={<AccountPage />}
secondary={
<Switch>
<Route path="/account/security">
<SecurityPage />
</Route>
<Route path="/account/plans">
<RedirectOffsite to={browser.hasBilling ? undefined : 'https://link.remote.it/account/subscriptions'}>
<PlansPage />
</RedirectOffsite>
</Route>
<Route path="/account/billing">
<RedirectOffsite to={browser.hasBilling ? undefined : 'https://link.remote.it/account/billing'}>
<BillingPage />
</RedirectOffsite>
</Route>
<Route path="/account/license">
<LicensingPage />
</Route>
<Route path="/account/accessKey">
<AccessKeyPage />
</Route>
<Route path={['/account', '/account/overview']}>
<ProfilePage />
</Route>
</Switch>
}
layout={layout}
root="/account"
/>
</RedirectOffsite>
<DynamicPanel
primary={<AccountPage />}
secondary={
<Switch>
<Route path="/account/security">
<SecurityPage />
</Route>
<Route path="/account/plans">
<RedirectOffsite to={browser.hasBilling ? undefined : 'https://link.remote.it/account/subscriptions'}>
<PlansPage />
</RedirectOffsite>
</Route>
<Route path="/account/billing">
<RedirectOffsite to={browser.hasBilling ? undefined : 'https://link.remote.it/account/billing'}>
<BillingPage />
</RedirectOffsite>
</Route>
<Route path="/account/license">
<LicensingPage />
</Route>
<Route path="/account/accessKey">
<AccessKeyPage />
</Route>
<Route path={['/account', '/account/overview']}>
<ProfilePage />
</Route>
</Switch>
}
layout={layout}
root="/account"
/>
</Route>
{/* Not found */}
<Redirect from="*" to={{ pathname: '/devices', state: { isRedirect: true } }} exact />
Expand Down
8 changes: 4 additions & 4 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,15 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 139;
CURRENT_PROJECT_VERSION = 140;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NR6A6NQAYW;
INFOPLIST_FILE = App/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Remote.It;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.40.2;
MARKETING_VERSION = 3.41.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.remoteit.mobile.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -381,15 +381,15 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 139;
CURRENT_PROJECT_VERSION = 140;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NR6A6NQAYW;
INFOPLIST_FILE = App/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Remote.It;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.40.2;
MARKETING_VERSION = 3.41.0;
PRODUCT_BUNDLE_IDENTIFIER = com.remoteit.mobile.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remoteit-capacitor",
"version": "3.40.2",
"version": "3.41.0",
"private": true,
"description": "Remote.It cross platform desktop application for creating and hosting connections",
"workspaces": [
Expand Down
Loading