mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-03-11 04:31:44 +00:00
Compare commits
10 Commits
fix_bugs
...
aug_bug_fi
| Author | SHA1 | Date | |
|---|---|---|---|
| bf6df377f6 | |||
| 18605f52a0 | |||
| 5a291ce9f8 | |||
| 25b9457043 | |||
| 040e678b1e | |||
| 7a32ad7878 | |||
| ea256c4f51 | |||
| ece37fc3c1 | |||
| cf80251f82 | |||
| 4a252b38a8 |
2
.env.development
Normal file
2
.env.development
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ENV_NAME=development
|
||||||
|
BASE_URL=https://syncrow-dev.azurewebsites.net
|
||||||
2
.env.production
Normal file
2
.env.production
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ENV_NAME=production
|
||||||
|
BASE_URL=https://syncrow-staging.azurewebsites.net
|
||||||
2
.env.staging
Normal file
2
.env.staging
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ENV_NAME=staging
|
||||||
|
BASE_URL=https://syncrow-staging.azurewebsites.net
|
||||||
60
.github/workflows/azure-static-web-apps-agreeable-wave-096d61a10.yml
vendored
Normal file
60
.github/workflows/azure-static-web-apps-agreeable-wave-096d61a10.yml
vendored
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
name: Azure Static Web Apps CI/CD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened, closed]
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_and_deploy_job:
|
||||||
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Build and Deploy Job
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
lfs: false
|
||||||
|
|
||||||
|
- name: Set up Flutter
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
flutter-version: '3.22.2' # Specify the Flutter version you want to use
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: flutter pub get
|
||||||
|
|
||||||
|
- name: Build Flutter Web App
|
||||||
|
run: flutter build web
|
||||||
|
|
||||||
|
- name: Build And Deploy
|
||||||
|
id: builddeploy
|
||||||
|
uses: Azure/static-web-apps-deploy@v1
|
||||||
|
with:
|
||||||
|
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ZEALOUS_MUSHROOM_0D31A3303 }}
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
|
||||||
|
action: "upload"
|
||||||
|
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
|
||||||
|
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
|
||||||
|
app_location: "/build/web" # App source code path
|
||||||
|
api_location: "" # Api source code path - optional
|
||||||
|
output_location: "/build/web" # Built app content directory - optional
|
||||||
|
###### End of Repository/Build Configurations ######
|
||||||
|
|
||||||
|
close_pull_request_job:
|
||||||
|
if: github.event_name == 'pull_request' && github.event.action == 'closed'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Close Pull Request Job
|
||||||
|
steps:
|
||||||
|
- name: Close Pull Request
|
||||||
|
id: closepullrequest
|
||||||
|
uses: Azure/static-web-apps-deploy@v1
|
||||||
|
with:
|
||||||
|
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ZEALOUS_MUSHROOM_0D31A3303 }}
|
||||||
|
action: "close"
|
||||||
61
.vscode/launch.json
vendored
Normal file
61
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
"name": "DEVELOPMENT",
|
||||||
|
|
||||||
|
"request": "launch",
|
||||||
|
|
||||||
|
"type": "dart",
|
||||||
|
|
||||||
|
"args": [
|
||||||
|
|
||||||
|
"--dart-define",
|
||||||
|
|
||||||
|
"FLAVOR=development"
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
"flutterMode": "debug"
|
||||||
|
|
||||||
|
},{
|
||||||
|
|
||||||
|
"name": "STAGING",
|
||||||
|
|
||||||
|
"request": "launch",
|
||||||
|
|
||||||
|
"type": "dart",
|
||||||
|
|
||||||
|
"args": [
|
||||||
|
|
||||||
|
"--dart-define",
|
||||||
|
|
||||||
|
"FLAVOR=staging"
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
"flutterMode": "debug"
|
||||||
|
|
||||||
|
},{
|
||||||
|
|
||||||
|
"name": "PRODUCTION",
|
||||||
|
|
||||||
|
"request": "launch",
|
||||||
|
|
||||||
|
"type": "dart",
|
||||||
|
|
||||||
|
"args": [
|
||||||
|
|
||||||
|
"--dart-define",
|
||||||
|
|
||||||
|
"FLAVOR=production"
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
"flutterMode": "debug"
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
import 'package:syncrow_web/pages/auth/bloc/auth_bloc.dart';
|
import 'package:syncrow_web/pages/auth/bloc/auth_bloc.dart';
|
||||||
import 'package:syncrow_web/pages/home/bloc/home_bloc.dart';
|
import 'package:syncrow_web/pages/home/bloc/home_bloc.dart';
|
||||||
import 'package:syncrow_web/pages/visitor_password/bloc/visitor_password_bloc.dart';
|
import 'package:syncrow_web/pages/visitor_password/bloc/visitor_password_bloc.dart';
|
||||||
@ -11,8 +12,12 @@ import 'package:syncrow_web/utils/constants/routes_const.dart';
|
|||||||
import 'package:syncrow_web/utils/theme/theme.dart';
|
import 'package:syncrow_web/utils/theme/theme.dart';
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
try {
|
||||||
initialSetup();
|
const environment = String.fromEnvironment('FLAVOR', defaultValue: 'development');
|
||||||
|
await dotenv.load(fileName: '.env.$environment');
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
initialSetup();
|
||||||
|
} catch (_) {}
|
||||||
runApp(MyApp());
|
runApp(MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class ReportsTable extends StatelessWidget {
|
|||||||
TableCellWidget(value: date),
|
TableCellWidget(value: date),
|
||||||
TableCellWidget(value: time),
|
TableCellWidget(value: time),
|
||||||
TableCellWidget(
|
TableCellWidget(
|
||||||
value: '${data.value!} $thirdColumnDescription',
|
value: '${data.value!} ${thirdColumnDescription ?? ''}',
|
||||||
onTap: () => onRowTap(index),
|
onTap: () => onRowTap(index),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -99,7 +99,7 @@ class WallSensorBloc extends Bloc<WallSensorEvent, WallSensorState> {
|
|||||||
try {
|
try {
|
||||||
await DevicesManagementApi.getDeviceReports(deviceId, event.code)
|
await DevicesManagementApi.getDeviceReports(deviceId, event.code)
|
||||||
.then((value) {
|
.then((value) {
|
||||||
emit(DeviceReportsState(deviceReport: value));
|
emit(DeviceReportsState(deviceReport: value, code:event.code));
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
emit(DeviceReportsFailedState(error: e.toString()));
|
emit(DeviceReportsFailedState(error: e.toString()));
|
||||||
|
|||||||
@ -42,7 +42,8 @@ class DeviceReportsLoadingState extends WallSensorState {}
|
|||||||
|
|
||||||
class DeviceReportsState extends WallSensorState {
|
class DeviceReportsState extends WallSensorState {
|
||||||
final DeviceReport deviceReport;
|
final DeviceReport deviceReport;
|
||||||
const DeviceReportsState({required this.deviceReport});
|
final String code;
|
||||||
|
const DeviceReportsState({required this.deviceReport, required this.code});
|
||||||
}
|
}
|
||||||
|
|
||||||
class DeviceReportsFailedState extends WallSensorState {
|
class DeviceReportsFailedState extends WallSensorState {
|
||||||
|
|||||||
@ -38,8 +38,10 @@ class WallSensorControls extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
} else if (state is DeviceReportsState) {
|
} else if (state is DeviceReportsState) {
|
||||||
return ReportsTable(
|
return ReportsTable(
|
||||||
report: state.deviceReport,
|
report: state.deviceReport,
|
||||||
thirdColumnTitle: "Value",
|
thirdColumnTitle:
|
||||||
thirdColumnDescription: "Lux",
|
state.code == 'illuminance_value' ? "Value" : 'Status',
|
||||||
|
thirdColumnDescription:
|
||||||
|
state.code == 'illuminance_value' ? "Lux" : null,
|
||||||
onRowTap: (index) {},
|
onRowTap: (index) {},
|
||||||
onClose: () {
|
onClose: () {
|
||||||
context.read<WallSensorBloc>().add(BackToGridViewEvent());
|
context.read<WallSensorBloc>().add(BackToGridViewEvent());
|
||||||
|
|||||||
@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class SpaseManagementicon extends StatelessWidget {
|
|
||||||
const SpaseManagementicon({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
body: Container(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,41 +1,35 @@
|
|||||||
abstract class ApiEndpoints {
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
static const String baseUrl = 'https://syncrow-dev.azurewebsites.net';
|
|
||||||
// static const String baseUrl = 'http://100.107.182.63:4001'; //Localhost
|
|
||||||
//https://syncrow-staging.azurewebsites.net
|
|
||||||
////////////////////////////////////// Authentication ///////////////////////////////
|
|
||||||
static const String signUp = '$baseUrl/authentication/user/signup';
|
|
||||||
static const String login = '$baseUrl/authentication/user/login';
|
|
||||||
static const String forgetPassword =
|
|
||||||
'$baseUrl/authentication/user/forget-password';
|
|
||||||
static const String sendOtp = '$baseUrl/authentication/user/send-otp';
|
|
||||||
static const String verifyOtp = '$baseUrl/authentication/user/verify-otp';
|
|
||||||
static const String getRegion = '$baseUrl/region';
|
|
||||||
static const String visitorPassword = '$baseUrl/visitor-password';
|
|
||||||
static const String getDevices = '$baseUrl/visitor-password/devices';
|
|
||||||
|
|
||||||
static const String sendOnlineOneTime =
|
abstract class ApiEndpoints {
|
||||||
'$baseUrl/visitor-password/temporary-password/online/one-time';
|
static String baseUrl = dotenv.env['BASE_URL'] ?? '';
|
||||||
|
static const String signUp = '/authentication/user/signup';
|
||||||
|
static const String login = '/authentication/user/login';
|
||||||
|
static const String forgetPassword = '/authentication/user/forget-password';
|
||||||
|
static const String sendOtp = '/authentication/user/send-otp';
|
||||||
|
static const String verifyOtp = '/authentication/user/verify-otp';
|
||||||
|
static const String getRegion = '/region';
|
||||||
|
static const String visitorPassword = '/visitor-password';
|
||||||
|
static const String getDevices = '/visitor-password/devices';
|
||||||
|
|
||||||
|
static const String sendOnlineOneTime = '/visitor-password/temporary-password/online/one-time';
|
||||||
static const String sendOnlineMultipleTime =
|
static const String sendOnlineMultipleTime =
|
||||||
'$baseUrl/visitor-password/temporary-password/online/multiple-time';
|
'/visitor-password/temporary-password/online/multiple-time';
|
||||||
|
|
||||||
//offline Password
|
//offline Password
|
||||||
static const String sendOffLineOneTime =
|
static const String sendOffLineOneTime = '/visitor-password/temporary-password/offline/one-time';
|
||||||
'$baseUrl/visitor-password/temporary-password/offline/one-time';
|
|
||||||
static const String sendOffLineMultipleTime =
|
static const String sendOffLineMultipleTime =
|
||||||
'$baseUrl/visitor-password/temporary-password/offline/multiple-time';
|
'/visitor-password/temporary-password/offline/multiple-time';
|
||||||
|
|
||||||
static const String getUser = '$baseUrl/user/{userUuid}';
|
static const String getUser = '/user/{userUuid}';
|
||||||
|
|
||||||
////// Devices Management ////////////////
|
////// Devices Management ////////////////
|
||||||
|
|
||||||
static const String getAllDevices = '$baseUrl/device';
|
static const String getAllDevices = '/device';
|
||||||
static const String getDeviceStatus =
|
static const String getDeviceStatus = '/device/{uuid}/functions/status';
|
||||||
'$baseUrl/device/{uuid}/functions/status';
|
|
||||||
|
|
||||||
static const String deviceControl = '$baseUrl/device/{uuid}/control';
|
static const String deviceControl = '/device/{uuid}/control';
|
||||||
static const String gatewayApi = '/device/gateway/{gatewayUuid}/devices';
|
static const String gatewayApi = '/device/gateway/{gatewayUuid}/devices';
|
||||||
static const String openDoorLock = '/door-lock/open/{doorLockUuid}';
|
static const String openDoorLock = '/door-lock/open/{doorLockUuid}';
|
||||||
|
|
||||||
static const String getDeviceLogs =
|
static const String getDeviceLogs = '/device/report-logs/{uuid}?code={code}';
|
||||||
'$baseUrl/device/report-logs/{uuid}?code={code}';
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -150,6 +150,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.1.5"
|
version: "8.1.5"
|
||||||
|
flutter_dotenv:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_dotenv
|
||||||
|
sha256: "9357883bdd153ab78cbf9ffa07656e336b8bbb2b5a3ca596b0b27e119f7c7d77"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "5.1.0"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -48,6 +48,8 @@ dependencies:
|
|||||||
go_router:
|
go_router:
|
||||||
intl: ^0.19.0
|
intl: ^0.19.0
|
||||||
dropdown_search: ^5.0.6
|
dropdown_search: ^5.0.6
|
||||||
|
flutter_dotenv: ^5.1.0
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
@ -77,6 +79,9 @@ flutter:
|
|||||||
- assets/icons/
|
- assets/icons/
|
||||||
- assets/images/
|
- assets/images/
|
||||||
- assets/
|
- assets/
|
||||||
|
- .env.development
|
||||||
|
- .env.staging
|
||||||
|
- .env.production
|
||||||
|
|
||||||
|
|
||||||
# An image asset can refer to one or more resolution-specific "variants", see
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
|
|||||||
Reference in New Issue
Block a user