Skip to content
Closed
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
<string name="invert_list">Invert list</string>
<string name="menu_actions">Actions</string>
<string name="menu_data">Data</string>
<string name="menu_utils">Utils</string>
<string name="menu_item_analytics">Analytics</string>
<string name="menu_item_crashReporter">Crashes</string>
<string name="menu_item_adb_commands">ADB Commands</string>
<string name="menu_item_dashboard">Dashboard</string>
<string name="menu_item_database">Database</string>
<string name="menu_item_deeplinks">Deeplinks</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import io.github.openflocon.flocondesktop.app.ui.view.topbar.MainScreenTopBar
import io.github.openflocon.flocondesktop.app.version.VersionCheckerView
import io.github.openflocon.flocondesktop.common.ui.feedback.FeedbackDisplayerView
import io.github.openflocon.flocondesktop.features.analytics.analyticsRoutes
import io.github.openflocon.flocondesktop.features.command.adbCommandRoutes
import io.github.openflocon.flocondesktop.features.crashreporter.crashReporterRoutes
import io.github.openflocon.flocondesktop.features.dashboard.dashboardRoutes
import io.github.openflocon.flocondesktop.features.database.databaseRoutes
Expand Down Expand Up @@ -100,5 +101,6 @@ private fun Content(
tableRoutes()
settingsRoutes()
crashReporterRoutes()
adbCommandRoutes()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import io.github.openflocon.flocondesktop.app.ui.model.leftpanel.buildMenu
import io.github.openflocon.flocondesktop.app.ui.settings.SettingsRoutes
import io.github.openflocon.flocondesktop.common.utils.stateInWhileSubscribed
import io.github.openflocon.flocondesktop.features.analytics.AnalyticsRoutes
import io.github.openflocon.flocondesktop.features.command.AdbCommandRoutes
import io.github.openflocon.flocondesktop.features.crashreporter.CrashReporterRoutes
import io.github.openflocon.flocondesktop.features.dashboard.DashboardRoutes
import io.github.openflocon.flocondesktop.features.database.DatabaseRoutes
Expand Down Expand Up @@ -130,6 +131,7 @@ internal class AppViewModel(
SubScreen.SharedPreferences -> SharedPreferencesRoutes.Main
SubScreen.Tables -> TableRoutes.Main
SubScreen.CrashReporter -> CrashReporterRoutes.Main
SubScreen.Commands -> AdbCommandRoutes.Main
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ sealed interface SubScreen {

data object Deeplinks : SubScreen
data object CrashReporter : SubScreen

data object Commands : SubScreen
}

val SubScreen.id: String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package io.github.openflocon.flocondesktop.app.ui.model.leftpanel

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Commit
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.runtime.Immutable
import flocondesktop.composeapp.generated.resources.Res
import flocondesktop.composeapp.generated.resources.menu_actions
import flocondesktop.composeapp.generated.resources.menu_data
import flocondesktop.composeapp.generated.resources.menu_network
import flocondesktop.composeapp.generated.resources.menu_storage
import flocondesktop.composeapp.generated.resources.menu_utils
import io.github.openflocon.flocondesktop.app.ui.model.SubScreen
import io.github.openflocon.flocondesktop.app.ui.view.displayName
import io.github.openflocon.flocondesktop.app.ui.view.icon
import org.jetbrains.compose.resources.getString

@Immutable
data class MenuState(
Expand Down Expand Up @@ -83,6 +83,16 @@ fun previewMenuState() = MenuState(
),
),
),
MenuSection(
title = Res.string.menu_utils,
items = listOf(
MenuItem(
screen = SubScreen.Commands,
icon = Icons.Outlined.Commit,
isEnabled = true,
)
),
)
),
)

Expand Down Expand Up @@ -121,6 +131,12 @@ internal fun buildMenu() = MenuState(
item(SubScreen.Deeplinks)
),
),
MenuSection(
title = Res.string.menu_utils,
items = listOf(
item(SubScreen.Commands)
),
)
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Link
import androidx.compose.material.icons.filled.NetworkWifi
import androidx.compose.material.icons.outlined.BugReport
import androidx.compose.material.icons.outlined.Commit
import androidx.compose.material.icons.outlined.Dashboard
import androidx.compose.material.icons.outlined.DatasetLinked
import androidx.compose.material.icons.outlined.Folder
Expand All @@ -12,9 +13,9 @@ import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material.icons.outlined.StackedBarChart
import androidx.compose.material.icons.outlined.Storage
import androidx.compose.material.icons.outlined.TableView
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.vector.ImageVector
import flocondesktop.composeapp.generated.resources.Res
import flocondesktop.composeapp.generated.resources.menu_item_adb_commands
import flocondesktop.composeapp.generated.resources.menu_item_analytics
import flocondesktop.composeapp.generated.resources.menu_item_crashReporter
import flocondesktop.composeapp.generated.resources.menu_item_dashboard
Expand All @@ -28,8 +29,6 @@ import flocondesktop.composeapp.generated.resources.menu_item_sharedPreferences
import flocondesktop.composeapp.generated.resources.menu_item_tables
import io.github.openflocon.flocondesktop.app.ui.model.SubScreen
import org.jetbrains.compose.resources.StringResource
import org.jetbrains.compose.resources.getString
import org.jetbrains.compose.resources.stringResource

// Extension function to get the display name for each SubScreen
fun SubScreen.displayName(): StringResource = when (this) {
Expand All @@ -44,6 +43,7 @@ fun SubScreen.displayName(): StringResource = when (this) {
SubScreen.Settings -> Res.string.menu_item_settings
SubScreen.Deeplinks -> Res.string.menu_item_deeplinks
SubScreen.CrashReporter -> Res.string.menu_item_crashReporter
SubScreen.Commands -> Res.string.menu_item_adb_commands
}

// Extension function to get the icon for each SubScreen
Expand All @@ -59,4 +59,5 @@ fun SubScreen.icon(): ImageVector = when (this) {
SubScreen.Dashboard -> Icons.Outlined.Dashboard
SubScreen.Deeplinks -> Icons.Filled.Link
SubScreen.CrashReporter -> Icons.Outlined.BugReport
SubScreen.Commands -> Icons.Outlined.Commit
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.openflocon.flocondesktop.common.db

import androidx.room.AutoMigration
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
Expand All @@ -8,19 +9,21 @@ import io.github.openflocon.data.local.adb.dao.AdbDevicesDao
import io.github.openflocon.data.local.adb.model.DeviceWithSerialEntity
import io.github.openflocon.data.local.analytics.dao.FloconAnalyticsDao
import io.github.openflocon.data.local.analytics.models.AnalyticsItemEntity
import io.github.openflocon.data.local.commands.dao.AdbCommandDao
import io.github.openflocon.data.local.commands.model.AdbCommandEntity
import io.github.openflocon.data.local.crashreporter.dao.CrashReportDao
import io.github.openflocon.data.local.crashreporter.models.CrashReportEntity
import io.github.openflocon.data.local.dashboard.dao.FloconDashboardDao
import io.github.openflocon.data.local.dashboard.models.DashboardContainerEntity
import io.github.openflocon.data.local.dashboard.models.DashboardElementEntity
import io.github.openflocon.data.local.dashboard.models.DashboardEntity
import io.github.openflocon.data.local.database.dao.DatabaseQueryLogDao
import io.github.openflocon.data.local.database.dao.QueryDao
import io.github.openflocon.data.local.database.dao.TablesDao
import io.github.openflocon.data.local.database.models.DatabaseQueryLogEntity
import io.github.openflocon.data.local.database.models.DatabaseTableEntity
import io.github.openflocon.data.local.database.models.FavoriteQueryEntity
import io.github.openflocon.data.local.database.models.SuccessQueryEntity
import io.github.openflocon.data.local.database.dao.DatabaseQueryLogDao
import io.github.openflocon.data.local.database.models.DatabaseQueryLogEntity
import io.github.openflocon.data.local.deeplink.dao.FloconDeeplinkDao
import io.github.openflocon.data.local.deeplink.models.DeeplinkEntity
import io.github.openflocon.data.local.device.datasource.dao.DevicesDao
Expand Down Expand Up @@ -50,7 +53,7 @@ import io.github.openflocon.flocondesktop.common.db.converters.MapStringsConvert
import kotlinx.coroutines.Dispatchers

@Database(
version = 78,
version = 79,
entities = [
FloconNetworkCallEntity::class,
FileEntity::class,
Expand All @@ -75,7 +78,11 @@ import kotlinx.coroutines.Dispatchers
DatabaseTableEntity::class,
CrashReportEntity::class,
DatabaseQueryLogEntity::class,
AdbCommandEntity::class
],
autoMigrations = [
AutoMigration(from = 78, to = 79),
]
)
@TypeConverters(
DashboardConverters::class,
Expand All @@ -95,6 +102,7 @@ abstract class AppDatabase : RoomDatabase() {
abstract val networkFilterDao: NetworkFilterDao
abstract val networkMocksDao: NetworkMocksDao
abstract val adbDevicesDao: AdbDevicesDao
abstract val adbCommandDao: AdbCommandDao
abstract val networkBadQualityConfigDao: NetworkBadQualityConfigDao
abstract val devicesDao: DevicesDao
abstract val tablesDao: TablesDao
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ val roomModule =
single {
get<AppDatabase>().databaseQueryLogDao
}
single {
get<AppDatabase>().adbCommandDao
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.github.openflocon.flocondesktop.features

import io.github.openflocon.flocondesktop.app.ui.settings.settingsModule
import io.github.openflocon.flocondesktop.features.analytics.analyticsModule
import io.github.openflocon.flocondesktop.features.command.adbCommandModule
import io.github.openflocon.flocondesktop.features.crashreporter.crashReporterModule
import io.github.openflocon.flocondesktop.features.dashboard.dashboardModule
import io.github.openflocon.flocondesktop.features.database.databaseModule
Expand All @@ -28,5 +29,6 @@ val featuresModule = module {
deeplinkModule,
settingsModule,
crashReporterModule,
adbCommandModule
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package io.github.openflocon.flocondesktop.features.command

sealed interface AdbCommandAction {

data class Create(val command: String) : AdbCommandAction

data class Execute(val command: AdbCommandUi) : AdbCommandAction

data class Delete(val command: AdbCommandUi) : AdbCommandAction
}
Loading