Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MobileEventLog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Data-Logistics-Support
MobileEventLog
Commits
4252ee6b
Commit
4252ee6b
authored
Sep 15, 2022
by
Maximilian Betz
Browse files
Options
Downloads
Patches
Plain Diff
added label id prefix and rest url fields to configuration widget and datamodel
parent
6af74716
No related branches found
No related tags found
1 merge request
!1
Devices also Contact Based
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sw/lib/configuration.dart
+43
-0
43 additions, 0 deletions
sw/lib/configuration.dart
sw/lib/datamodel.dart
+27
-0
27 additions, 0 deletions
sw/lib/datamodel.dart
with
70 additions
and
0 deletions
sw/lib/configuration.dart
+
43
−
0
View file @
4252ee6b
...
...
@@ -192,6 +192,7 @@ class _MyHomePageState extends State<Configuration> {
try
{
futureCollections
=
connector
.
fetchCollections
();
await
futureCollections
;
//wait and catch error here!
// TODO: fallback to current collection from configuration.currentCollection in case the query fails of being offline.
setState
(()
{});
}
catch
(
e
){
...
...
@@ -249,6 +250,34 @@ class _MyHomePageState extends State<Configuration> {
style:
TextStyle
(
fontSize:
14
)
),
const
SizedBox
(
height:
50
),
TextFormField
(
keyboardType:
TextInputType
.
text
,
autofocus:
false
,
initialValue:
configuration
.
labelConfig
.
prefix
,
decoration:
const
InputDecoration
(
border:
OutlineInputBorder
(),
labelText:
'Label Prefix'
,
hintText:
''
,
),
onChanged:
(
value
)
{
configuration
.
labelConfig
.
prefix
=
value
;
},
),
const
SizedBox
(
height:
15.0
),
TextFormField
(
keyboardType:
TextInputType
.
number
,
autofocus:
false
,
initialValue:
configuration
.
labelConfig
.
cnt
.
toString
(),
decoration:
const
InputDecoration
(
border:
OutlineInputBorder
(),
labelText:
'Label count'
,
hintText:
''
,
),
onChanged:
(
value
)
{
configuration
.
labelConfig
.
cnt
=
value
as
int
;
},
),
const
SizedBox
(
height:
15.0
),
TextFormField
(
keyboardType:
TextInputType
.
emailAddress
,
autofocus:
false
,
...
...
@@ -276,6 +305,20 @@ class _MyHomePageState extends State<Configuration> {
configuration
.
loginInformation
.
password
=
value
;
},
),
const
SizedBox
(
height:
15.0
),
TextFormField
(
keyboardType:
TextInputType
.
text
,
autofocus:
false
,
initialValue:
configuration
.
restRequestUrl
,
decoration:
const
InputDecoration
(
border:
OutlineInputBorder
(),
labelText:
'Label Prefix'
,
hintText:
''
,
),
onChanged:
(
value
)
{
configuration
.
restRequestUrl
=
value
;
},
),
const
SizedBox
(
height:
50
),
FutureBuilder
<
List
<
Collection
>>(
future:
futureCollections
,
...
...
...
...
This diff is collapsed.
Click to expand it.
sw/lib/datamodel.dart
+
27
−
0
View file @
4252ee6b
...
...
@@ -244,6 +244,25 @@ class EventType{
}
class
LabelConfiguration
{
int
cnt
;
String
prefix
;
LabelConfiguration
(
this
.
cnt
,
this
.
prefix
);
Map
<
String
,
dynamic
>
toJson
()
=
>
{
"prefix"
:
prefix
,
"cnt"
:
cnt
};
LabelConfiguration
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
:
prefix
=
json
[
'prefix'
],
cnt
=
json
[
'cnt'
];
}
class
SensorLogin
{
String
mail
;
String
password
;
...
...
@@ -273,6 +292,8 @@ abstract class ConfigurationStoreBase {
List
<
Device
>
devices
=
[];
List
<
EventType
>
eventTypes
=
[];
SensorLogin
loginInformation
=
SensorLogin
(
''
,
''
);
LabelConfiguration
labelConfig
=
LabelConfiguration
(
0
,
''
);
String
restRequestUrl
=
''
;
bool
initialized
=
false
;
Map
<
String
,
dynamic
>
toMap
()
{
...
...
@@ -282,6 +303,8 @@ abstract class ConfigurationStoreBase {
'devices'
:
jsonEncode
(
devices
),
'eventTypes'
:
jsonEncode
(
eventTypes
),
'initialized'
:
initialized
,
'labelConfiguration'
:
jsonEncode
(
labelConfig
),
'restRequestUrl'
:
restRequestUrl
,
};
}
...
...
@@ -314,6 +337,10 @@ abstract class ConfigurationStoreBase {
for
(
var
element
in
dynList
){
eventTypes
.
add
(
EventType
.
fromJson
(
element
));
}
labelConfig
=
LabelConfiguration
.
fromJson
(
map
[
'labelConfiguration'
]);
restRequestUrl
=
map
[
'restRequestUrl'
];
initialized
=
map
[
'initialized'
];
}
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment