Bug fixes, small improvements, updated marketing assets

This commit is contained in:
JHubi1 2024-05-28 20:43:30 +02:00
parent bb98b097b3
commit 0e9c5f036c
No known key found for this signature in database
GPG Key ID: 7BF82570CBBBD050
13 changed files with 89 additions and 152 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

@ -1,73 +1,3 @@
{ {
"@@locale": "de", "@@locale": "de"
"appTitle": "Ollama",
"@appTitle": {
"description": "Title of the application",
"context": "Visible in the side bar"
},
"optionSettings": "Einstellungen",
"@optionSettings": {
"description": "Text displayed for settings option",
"context": "Visible in the side bar"
},
"optionNewChat": "Neuer Chat",
"@optionNewChat": {
"description": "Text displayed for new chat option",
"context": "Visible in the side bar"
},
"takeImage": "Bild Aufnehmen",
"@takeImage": {
"description": "Text displayed for take image button",
"context": "Visible in attachment menu"
},
"uploadImage": "Bild Hochladen",
"@uploadImage": {
"description": "Text displayed for image upload button",
"context": "Visible in attachment menu"
},
"messageInputPlaceholder": "Nachricht",
"@messageInputPlaceholder": {
"description": "Placeholder text for message input",
"context": "Visible in the chat view"
},
"noModelSelected": "Kein Modell ausgewählt",
"@noModelSelected": {
"description": "Text displayed when no model is selected",
"context": "Visible in the chat view"
},
"hostDialogTitle": "Host Festlegen",
"@hostDialogTitle": {
"description": "Title of the host dialog",
"context": "Visible in the host dialog"
},
"hostDialogDescription": "Gebe den Host des Ollama-Servers ein. Dies wird validiert und kann später in den Einstellungen geändert werden.",
"@hostDialogDescription": {
"description": "Description of the host dialog",
"context": "Visible in the host dialog"
},
"hostDialogErrorInvalidHost": "Der Host konnte nicht validiert werden, bitte versuche es erneut. Entweder ist er nicht erreichbar oder es handelt sich nicht um eine gültige Ollama-Serverinstanz.",
"@hostDialogErrorInvalidHost": {
"description": "Error message displayed when the host is invalid",
"context": "Visible in the host dialog"
},
"hostDialogErrorInvalidUrl": "Die URL ist ungültig. Versuche, sie erneut zu überprüfen.",
"@hostDialogErrorInvalidUrl": {
"description": "Error message displayed when the URL is invalid",
"context": "Visible in the host dialog"
},
"hostDialogSave": "Host Speichern",
"@hostDialogSave": {
"description": "Text displayed for save host button, should be capitalized",
"context": "Visible in the host dialog"
},
"noSelectedModel": "<selektor>",
"@noSelectedModel": {
"description": "Text displayed when no model is selected",
"context": "Visible in the chat view, opens the model dialog when clicked"
},
"modelDialogAddModel": "Modell hinzufügen",
"@modelDialogAddModel": {
"description": "Text displayed for add model button",
"context": "Visible in the model dialog"
}
} }

View File

@ -69,5 +69,10 @@
"@modelDialogAddModel": { "@modelDialogAddModel": {
"description": "Text displayed for add model button", "description": "Text displayed for add model button",
"context": "Visible in the model dialog" "context": "Visible in the model dialog"
},
"modelDialogAddSteps": "To add a new model, visit ollama.com on your computer, look for a model you like, copy the command and paste it in a new terminal window. Wait for the download to complete, this can take a while. Once it is complete, reopen this selector and you'll find your newly added model.",
"@modelDialogAddSteps": {
"description": "Steps to add a new model",
"context": "Visible in the model dialog"
} }
} }

View File

@ -391,7 +391,7 @@ class _MainAppState extends State<MainApp> {
.selectionClick(); .selectionClick();
}, },
icon: const Icon( icon: const Icon(
Icons.file_copy_rounded), Icons.photo_camera_rounded),
label: Text(AppLocalizations.of( label: Text(AppLocalizations.of(
context)! context)!
.takeImage))), .takeImage))),

View File

@ -8,7 +8,7 @@ import 'package:http/http.dart' as http;
import 'package:dartx/dartx.dart'; import 'package:dartx/dartx.dart';
import 'package:ollama_dart/ollama_dart.dart' as llama; import 'package:ollama_dart/ollama_dart.dart' as llama;
void setHost(BuildContext context, [String host = ""]) { void setHost(BuildContext context) {
bool loading = false; bool loading = false;
bool invalidHost = false; bool invalidHost = false;
bool invalidUrl = false; bool invalidUrl = false;
@ -93,7 +93,7 @@ void setHost(BuildContext context, [String host = ""]) {
messages = []; messages = [];
setState(() {}); setState(() {});
host = tmpHost; host = tmpHost;
prefs?.setString("host", host); prefs?.setString("host", host!);
} }
}, },
child: child:
@ -105,6 +105,7 @@ void setModel(BuildContext context, Function setState) {
List<String> models = []; List<String> models = [];
List<bool> modal = []; List<bool> modal = [];
int usedIndex = -1; int usedIndex = -1;
int addIndex = -1;
bool loaded = false; bool loaded = false;
Function? setModalState; Function? setModalState;
void load() async { void load() async {
@ -113,6 +114,10 @@ void setModel(BuildContext context, Function setState) {
models.add(list.models![i].model!.split(":")[0]); models.add(list.models![i].model!.split(":")[0]);
modal.add((list.models![i].details!.families ?? []).contains("clip")); modal.add((list.models![i].details!.families ?? []).contains("clip"));
} }
addIndex = models.length;
// ignore: use_build_context_synchronously
models.add(AppLocalizations.of(context)!.modelDialogAddModel);
modal.add(false);
for (var i = 0; i < models.length; i++) { for (var i = 0; i < models.length; i++) {
if (models[i] == model) { if (models[i] == model) {
usedIndex = i; usedIndex = i;
@ -147,33 +152,17 @@ void setModel(BuildContext context, Function setState) {
prefs?.setBool("multimodal", multimodal); prefs?.setBool("multimodal", multimodal);
setState(() {}); setState(() {});
}, },
child: SizedBox(
width: double.infinity,
child: (!loaded)
? const Padding(
padding: EdgeInsets.all(16),
child: LinearProgressIndicator())
: Column(mainAxisSize: MainAxisSize.min, children: [
Padding(
padding: const EdgeInsets.only(
left: 16, right: 16, top: 16),
child: SizedBox(
width: double.infinity,
child: OutlinedButton.icon(
onPressed: () {},
label: Text(AppLocalizations.of(context)!
.modelDialogAddModel),
icon: const Icon(Icons.add_rounded)))),
const Divider(),
Padding(
padding:
const EdgeInsets.only(left: 16, right: 16),
child: Container( child: Container(
width: double.infinity,
padding: const EdgeInsets.only(left: 16, right: 16, top: 16),
child: (!loaded)
? const LinearProgressIndicator()
: Column(mainAxisSize: MainAxisSize.min, children: [
Container(
width: double.infinity, width: double.infinity,
constraints: BoxConstraints( constraints: BoxConstraints(
maxHeight: maxHeight:
MediaQuery.of(context).size.height * MediaQuery.of(context).size.height * 0.4),
0.4),
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
child: Wrap( child: Wrap(
@ -185,16 +174,17 @@ void setModel(BuildContext context, Function setState) {
return ChoiceChip( return ChoiceChip(
label: Text(models[index]), label: Text(models[index]),
selected: usedIndex == index, selected: usedIndex == index,
avatar: (recommendedModels avatar: (addIndex == index)
? const Icon(Icons.add_rounded)
: ((recommendedModels
.contains(models[index])) .contains(models[index]))
? const Icon( ? const Icon(
Icons.star_rounded) Icons.star_rounded)
: ((modal[index]) : ((modal[index])
? const Icon(Icons ? const Icon(Icons
.collections_rounded) .collections_rounded)
: null), : null)),
checkmarkColor: (usedIndex == checkmarkColor: (usedIndex == index)
index)
? ((MediaQuery.of(context) ? ((MediaQuery.of(context)
.platformBrightness == .platformBrightness ==
Brightness.light) Brightness.light)
@ -208,42 +198,54 @@ void setModel(BuildContext context, Function setState) {
: null, : null,
labelStyle: (usedIndex == index) labelStyle: (usedIndex == index)
? TextStyle( ? TextStyle(
color: (MediaQuery.of( color: (MediaQuery.of(context)
context)
.platformBrightness == .platformBrightness ==
Brightness.light) Brightness.light)
? (theme ?? ? (theme ?? ThemeData())
ThemeData())
.colorScheme .colorScheme
.secondary .secondary
: (themeDark ?? : (themeDark ??
ThemeData ThemeData.dark())
.dark())
.colorScheme .colorScheme
.secondary) .secondary)
: null, : null,
selectedColor: (MediaQuery.of( selectedColor: (MediaQuery.of(context)
context)
.platformBrightness == .platformBrightness ==
Brightness.light) Brightness.light)
? (theme ?? ThemeData()) ? (theme ?? ThemeData())
.colorScheme .colorScheme
.primary .primary
: (themeDark ?? : (themeDark ?? ThemeData.dark())
ThemeData.dark())
.colorScheme .colorScheme
.primary, .primary,
onSelected: (bool selected) { onSelected: (bool selected) {
if (addIndex == index) {
Navigator.of(context).pop();
showModalBottomSheet(
context: context,
builder: (context) {
return Padding(
padding:
const EdgeInsets
.only(
left: 16,
right: 16,
top: 16),
child: Text(
AppLocalizations.of(
context)!
.modelDialogAddSteps));
});
}
if (!chatAllowed) return; if (!chatAllowed) return;
setLocalState(() { setLocalState(() {
usedIndex = usedIndex = selected ? index : -1;
selected ? index : -1;
}); });
}, },
); );
}, },
).toList(), ).toList(),
)))) )))
]))); ])));
}); });
}); });