-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support source sink basic info (#14)
- Loading branch information
Showing
16 changed files
with
543 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:paas_dashboard_flutter/generated/l10n.dart'; | ||
import 'package:paas_dashboard_flutter/ui/pulsar/widget/pulsar_sink_basic.dart'; | ||
import 'package:paas_dashboard_flutter/vm/pulsar/pulsar_sink_basic_view_model.dart'; | ||
import 'package:paas_dashboard_flutter/vm/pulsar/pulsar_sink_view_model.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
class PulsarSinkScreen extends StatefulWidget { | ||
PulsarSinkScreen(); | ||
|
||
@override | ||
State<StatefulWidget> createState() { | ||
return new _PulsarSinkScreenState(); | ||
} | ||
} | ||
|
||
class _PulsarSinkScreenState extends State<PulsarSinkScreen> { | ||
_PulsarSinkScreenState(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final vm = Provider.of<PulsarSinkViewModel>(context); | ||
return DefaultTabController( | ||
length: 1, | ||
child: Scaffold( | ||
appBar: AppBar( | ||
title: Text( | ||
'Pulsar Sink Tenant ${vm.tenant} -> Namespace ${vm.namespace} -> Topic ${vm.sinkName}'), | ||
bottom: TabBar( | ||
tabs: [ | ||
Tab(text: S.of(context).basic), | ||
], | ||
), | ||
), | ||
body: TabBarView( | ||
children: [ | ||
ChangeNotifierProvider( | ||
create: (context) => PulsarSinkBasicViewModel( | ||
vm.pulsarInstancePo, | ||
vm.tenantResp, | ||
vm.namespaceResp, | ||
vm.sinkResp), | ||
child: PulsarSinkBasicWidget(), | ||
).build(context), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:paas_dashboard_flutter/generated/l10n.dart'; | ||
import 'package:paas_dashboard_flutter/ui/pulsar/widget/pulsar_source_basic.dart'; | ||
import 'package:paas_dashboard_flutter/ui/pulsar/widget/pulsar_topic_basic.dart'; | ||
import 'package:paas_dashboard_flutter/vm/pulsar/pulsar_source_basic_view_model.dart'; | ||
import 'package:paas_dashboard_flutter/vm/pulsar/pulsar_source_view_model.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
class PulsarSourceScreen extends StatefulWidget { | ||
PulsarSourceScreen(); | ||
|
||
@override | ||
State<StatefulWidget> createState() { | ||
return new _PulsarSourceScreenState(); | ||
} | ||
} | ||
|
||
class _PulsarSourceScreenState extends State<PulsarSourceScreen> { | ||
_PulsarSourceScreenState(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final vm = Provider.of<PulsarSourceViewModel>(context); | ||
return DefaultTabController( | ||
length: 1, | ||
child: Scaffold( | ||
appBar: AppBar( | ||
title: Text( | ||
'Pulsar Source Tenant ${vm.tenant} -> Namespace ${vm.namespace} -> Topic ${vm.sourceName}'), | ||
bottom: TabBar( | ||
tabs: [ | ||
Tab(text: S.of(context).basic), | ||
], | ||
), | ||
), | ||
body: TabBarView( | ||
children: [ | ||
ChangeNotifierProvider( | ||
create: (context) => PulsarSourceBasicViewModel( | ||
vm.pulsarInstancePo, | ||
vm.tenantResp, | ||
vm.namespaceResp, | ||
vm.sourceResp), | ||
child: PulsarSourceBasicWidget(), | ||
).build(context), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:paas_dashboard_flutter/generated/l10n.dart'; | ||
import 'package:paas_dashboard_flutter/ui/util/exception_util.dart'; | ||
import 'package:paas_dashboard_flutter/ui/util/spinner_util.dart'; | ||
import 'package:paas_dashboard_flutter/vm/pulsar/pulsar_sink_basic_view_model.dart'; | ||
import 'package:paas_dashboard_flutter/vm/pulsar/pulsar_topic_basic_view_model.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
class PulsarSinkBasicWidget extends StatefulWidget { | ||
PulsarSinkBasicWidget(); | ||
|
||
@override | ||
State<StatefulWidget> createState() { | ||
return new PulsarSinkBasicWidgetState(); | ||
} | ||
} | ||
|
||
class PulsarSinkBasicWidgetState | ||
extends State<PulsarSinkBasicWidget> { | ||
@override | ||
void initState() { | ||
super.initState(); | ||
final vm = Provider.of<PulsarSinkBasicViewModel>(context, | ||
listen: false); | ||
vm.fetch(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final vm = Provider.of<PulsarSinkBasicViewModel>(context); | ||
if (vm.loading) { | ||
WidgetsBinding.instance!.addPostFrameCallback((timeStamp) { | ||
SpinnerUtil.create(); | ||
}); | ||
} | ||
ExceptionUtil.processLoadException(vm, context); | ||
ExceptionUtil.processOpException(vm, context); | ||
var refreshButton = | ||
TextButton(onPressed: () {}, child: Text(S.of(context).refresh)); | ||
var body = ListView( | ||
children: <Widget>[ | ||
Container( | ||
height: 50, | ||
child: ListView( | ||
scrollDirection: Axis.horizontal, | ||
shrinkWrap: true, | ||
children: [refreshButton], | ||
), | ||
), | ||
Container( | ||
height: 50, | ||
child: ListView( | ||
scrollDirection: Axis.horizontal, | ||
shrinkWrap: true, | ||
children: [ | ||
Text( | ||
'inputs is ${vm.inputs}', | ||
style: new TextStyle(fontSize: 20), | ||
), | ||
], | ||
), | ||
), | ||
Container( | ||
height: 50, | ||
child: ListView( | ||
scrollDirection: Axis.horizontal, | ||
shrinkWrap: true, | ||
children: [ | ||
Text( | ||
'configs is ${vm.configs}', | ||
style: new TextStyle(fontSize: 20), | ||
), | ||
], | ||
), | ||
), | ||
Container( | ||
height: 50, | ||
child: ListView( | ||
scrollDirection: Axis.horizontal, | ||
shrinkWrap: true, | ||
children: [ | ||
Text( | ||
'archive is ${vm.archive}', | ||
style: new TextStyle(fontSize: 20), | ||
), | ||
], | ||
), | ||
), | ||
], | ||
); | ||
return body; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.