readd: double column on server page

This commit is contained in:
lollipopkit
2024-03-06 11:35:24 +08:00
parent 44a431c19f
commit 5baf683278
16 changed files with 49 additions and 17 deletions

View File

@@ -514,6 +514,12 @@ abstract class S {
/// **'Double column mode'** /// **'Double column mode'**
String get doubleColumnMode; String get doubleColumnMode;
/// No description provided for @doubleColumnTip.
///
/// In en, this message translates to:
/// **'This option only enables the feature, whether it can actually be enabled depends on the width of the device'**
String get doubleColumnTip;
/// No description provided for @download. /// No description provided for @download.
/// ///
/// In en, this message translates to: /// In en, this message translates to:

View File

@@ -221,6 +221,9 @@ class SDe extends S {
@override @override
String get doubleColumnMode => 'Doppelspaltiger Modus'; String get doubleColumnMode => 'Doppelspaltiger Modus';
@override
String get doubleColumnTip => 'Diese Option aktiviert nur die Funktion, ob sie tatsächlich aktiviert werden kann, hängt auch von der Breite des Geräts ab';
@override @override
String get download => 'Download'; String get download => 'Download';

View File

@@ -221,6 +221,9 @@ class SEn extends S {
@override @override
String get doubleColumnMode => 'Double column mode'; String get doubleColumnMode => 'Double column mode';
@override
String get doubleColumnTip => 'This option only enables the feature, whether it can actually be enabled depends on the width of the device';
@override @override
String get download => 'Download'; String get download => 'Download';

View File

@@ -221,6 +221,9 @@ class SFr extends S {
@override @override
String get doubleColumnMode => 'Mode double colonne'; String get doubleColumnMode => 'Mode double colonne';
@override
String get doubleColumnTip => 'Cette option ne fait que activer la fonction, sa réalisation dépend également de la largeur de l\'appareil.';
@override @override
String get download => 'Télécharger'; String get download => 'Télécharger';

View File

@@ -221,6 +221,9 @@ class SId extends S {
@override @override
String get doubleColumnMode => 'Mode kolom ganda'; String get doubleColumnMode => 'Mode kolom ganda';
@override
String get doubleColumnTip => 'Opsi ini hanya mengaktifkan fitur, apakah itu benar-benar dapat diaktifkan tergantung pada lebar perangkat';
@override @override
String get download => 'Unduh'; String get download => 'Unduh';

View File

@@ -221,6 +221,9 @@ class SZh extends S {
@override @override
String get doubleColumnMode => '双列模式'; String get doubleColumnMode => '双列模式';
@override
String get doubleColumnTip => '此选项仅开启功能,实际是否能开启还取决于设备的宽度';
@override @override
String get download => '下载'; String get download => '下载';
@@ -1108,6 +1111,9 @@ class SZhTw extends SZh {
@override @override
String get doubleColumnMode => '雙列模式'; String get doubleColumnMode => '雙列模式';
@override
String get doubleColumnTip => '此選項僅開啟功能,實際是否能開啟還取決於設備的寬度';
@override @override
String get download => '下載'; String get download => '下載';

View File

@@ -43,12 +43,6 @@ class SettingStore extends PersistentStore {
late final diskIgnorePath = late final diskIgnorePath =
property('diskIgnorePath', Defaults.diskIgnorePath); property('diskIgnorePath', Defaults.diskIgnorePath);
/// Use double column servers page on Desktop
late final doubleColumnServersPage = property(
'doubleColumnServersPage',
isDesktop,
);
/// Disk view: amount / IO /// Disk view: amount / IO
late final serverTabPreferDiskAmount = property( late final serverTabPreferDiskAmount = property(
'serverTabPreferDiskAmount', 'serverTabPreferDiskAmount',
@@ -245,6 +239,12 @@ class SettingStore extends PersistentStore {
/// Result: use x86pkg_temp's temperature as the temperature /// Result: use x86pkg_temp's temperature as the temperature
late final preferTemperatureDevs = late final preferTemperatureDevs =
listProperty('preferTemperatureDevs', <String>[]); listProperty('preferTemperatureDevs', <String>[]);
/// Use double column servers page on Desktop
late final doubleColumnServersPage = property(
'doubleColumnServersPage',
true,
);
// Never show these settings for users // Never show these settings for users
// //

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount} aktiv, {stoppedCount} container gestoppt.", "dockerStatusRunningAndStoppedFmt": "{runningCount} aktiv, {stoppedCount} container gestoppt.",
"dockerStatusRunningFmt": "{count} Container aktiv", "dockerStatusRunningFmt": "{count} Container aktiv",
"doubleColumnMode": "Doppelspaltiger Modus", "doubleColumnMode": "Doppelspaltiger Modus",
"doubleColumnTip": "Diese Option aktiviert nur die Funktion, ob sie tatsächlich aktiviert werden kann, hängt auch von der Breite des Geräts ab",
"download": "Download", "download": "Download",
"edit": "Bearbeiten", "edit": "Bearbeiten",
"editVirtKeys": "Virtuelle Tasten bearbeiten", "editVirtKeys": "Virtuelle Tasten bearbeiten",

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount} running, {stoppedCount} container stopped.", "dockerStatusRunningAndStoppedFmt": "{runningCount} running, {stoppedCount} container stopped.",
"dockerStatusRunningFmt": "{count} container running.", "dockerStatusRunningFmt": "{count} container running.",
"doubleColumnMode": "Double column mode", "doubleColumnMode": "Double column mode",
"doubleColumnTip": "This option only enables the feature, whether it can actually be enabled depends on the width of the device",
"download": "Download", "download": "Download",
"edit": "Edit", "edit": "Edit",
"editVirtKeys": "Edit virtual keys", "editVirtKeys": "Edit virtual keys",

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount} en cours d'exécution, {stoppedCount} conteneurs arrêtés.", "dockerStatusRunningAndStoppedFmt": "{runningCount} en cours d'exécution, {stoppedCount} conteneurs arrêtés.",
"dockerStatusRunningFmt": "{count} conteneurs en cours d'exécution.", "dockerStatusRunningFmt": "{count} conteneurs en cours d'exécution.",
"doubleColumnMode": "Mode double colonne", "doubleColumnMode": "Mode double colonne",
"doubleColumnTip": "Cette option ne fait que activer la fonction, sa réalisation dépend également de la largeur de l'appareil.",
"download": "Télécharger", "download": "Télécharger",
"edit": "Modifier", "edit": "Modifier",
"editVirtKeys": "Modifier les touches virtuelles", "editVirtKeys": "Modifier les touches virtuelles",

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount} running, {stoppedCount} container stopped.", "dockerStatusRunningAndStoppedFmt": "{runningCount} running, {stoppedCount} container stopped.",
"dockerStatusRunningFmt": "{count} wadah berjalan.", "dockerStatusRunningFmt": "{count} wadah berjalan.",
"doubleColumnMode": "Mode kolom ganda", "doubleColumnMode": "Mode kolom ganda",
"doubleColumnTip": "Opsi ini hanya mengaktifkan fitur, apakah itu benar-benar dapat diaktifkan tergantung pada lebar perangkat",
"download": "Unduh", "download": "Unduh",
"edit": "Edit", "edit": "Edit",
"editVirtKeys": "Edit kunci virtual", "editVirtKeys": "Edit kunci virtual",

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount}个正在运行, {stoppedCount}个已停止", "dockerStatusRunningAndStoppedFmt": "{runningCount}个正在运行, {stoppedCount}个已停止",
"dockerStatusRunningFmt": "{count}个容器正在运行", "dockerStatusRunningFmt": "{count}个容器正在运行",
"doubleColumnMode": "双列模式", "doubleColumnMode": "双列模式",
"doubleColumnTip": "此选项仅开启功能,实际是否能开启还取决于设备的宽度",
"download": "下载", "download": "下载",
"edit": "编辑", "edit": "编辑",
"editVirtKeys": "编辑虚拟按键", "editVirtKeys": "编辑虚拟按键",

View File

@@ -69,6 +69,7 @@
"dockerStatusRunningAndStoppedFmt": "{runningCount}個正在運行, {stoppedCount}個已停止", "dockerStatusRunningAndStoppedFmt": "{runningCount}個正在運行, {stoppedCount}個已停止",
"dockerStatusRunningFmt": "{count}個容器正在運行", "dockerStatusRunningFmt": "{count}個容器正在運行",
"doubleColumnMode": "雙列模式", "doubleColumnMode": "雙列模式",
"doubleColumnTip": "此選項僅開啟功能,實際是否能開啟還取決於設備的寬度",
"download": "下載", "download": "下載",
"edit": "編輯", "edit": "編輯",
"editVirtKeys": "編輯虛擬按鍵", "editVirtKeys": "編輯虛擬按鍵",

View File

@@ -52,7 +52,8 @@ class _ServerPageState extends State<ServerPage>
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
_media = MediaQuery.of(context); _media = MediaQuery.of(context);
_useDoubleColumn = _media.useDoubleColumn; _useDoubleColumn = _media.useDoubleColumn &&
Stores.setting.doubleColumnServersPage.fetch();
} }
@override @override

View File

@@ -191,7 +191,7 @@ class _SettingPageState extends State<SettingPage> {
_buildDeleteServers(), _buildDeleteServers(),
_buildTextScaler(), _buildTextScaler(),
_buildPreferTemperatureDeviceList(), _buildPreferTemperatureDeviceList(),
//if (isDesktop) _buildDoubleColumnServersPage(), _buildDoubleColumnServersPage(),
].map((e) => CardX(child: e)).toList(), ].map((e) => CardX(child: e)).toList(),
); );
} }
@@ -1082,12 +1082,13 @@ class _SettingPageState extends State<SettingPage> {
); );
} }
// Widget _buildDoubleColumnServersPage() { Widget _buildDoubleColumnServersPage() {
// return ListTile( return ListTile(
// title: Text(l10n.doubleColumnMode), title: Text(l10n.doubleColumnMode),
// trailing: StoreSwitch(prop: _setting.doubleColumnServersPage), subtitle: Text(l10n.doubleColumnTip, style: UIs.textGrey),
// ); trailing: StoreSwitch(prop: _setting.doubleColumnServersPage),
// } );
}
Widget _buildPlatformSetting() { Widget _buildPlatformSetting() {
return ListTile( return ListTile(

View File

@@ -162,13 +162,13 @@ Future<void> flutterBuildAndroid() async {
Future<void> flutterBuildLinux() async { Future<void> flutterBuildLinux() async {
await flutterBuild('linux'); await flutterBuild('linux');
const appDirName = '$appName.AppDir'; const appDirName = 'linux.AppDir';
// mkdir appName.AppDir // mkdir appName.AppDir
await Process.run('mkdir', [appDirName]); await Process.run('mkdir', [appDirName]);
// cp -r build/linux/x64/release/bundle/* appName.AppDir // cp -r build/linux/x64/release/bundle/* appName.AppDir
await Process.run('cp', [ await Process.run('cp', [
'-r', '-r',
'./build/linux/x64/release/bundle/*', 'build/linux/x64/release/bundle/*',
appDirName, appDirName,
]); ]);
// cp -r assets/app_icon.png ServerBox.AppDir // cp -r assets/app_icon.png ServerBox.AppDir
@@ -196,7 +196,7 @@ Icon=app_icon
Type=Application Type=Application
Categories=Utility; Categories=Utility;
'''; ''';
await File('$appDirName/$appName.desktop').writeAsString(desktop); await File('$appDirName/default.desktop').writeAsString(desktop);
// Run appimagetool // Run appimagetool
await Process.run('sh', ['-c', 'ARCH=x86_64 appimagetool $appDirName']); await Process.run('sh', ['-c', 'ARCH=x86_64 appimagetool $appDirName']);