babantudev 1 month ago
parent
commit
4770250b32

+ 2 - 1
assets/lang/en.json

@@ -317,5 +317,6 @@
    "letMeWrite": "Let me write it!",
    "writeHere": "Write here..",
    "ratingAspect": "Rating Aspect",
-   "sendingRequest": "Sending requests"
+   "sendingRequest": "Sending requests",
+   "changePriority": "Change Priority"
 }

+ 2 - 1
assets/lang/id.json

@@ -317,5 +317,6 @@
    "letMeWrite": "Saya punya pendapat lain!",
    "writeHere": "Tulis disini..",
    "ratingAspect": "Aspek Penilaian",
-   "sendingRequest": "Mengirim permintaan"
+   "sendingRequest": "Mengirim permintaan",
+   "changePriority": "Ubah Prioritas"
 }

+ 2 - 1
assets/lang/ja.json

@@ -317,5 +317,6 @@
    "letMeWrite": "書かせてください!",
    "writeHere": "ここに書いてください。",
    "ratingAspect": "評価面",
-   "sendingRequest": "リクエストの送信"
+   "sendingRequest": "リクエストの送信",
+   "changePriority": "優先順位を変更する"
 }

+ 2 - 1
assets/lang/ko.json

@@ -317,5 +317,6 @@
    "letMeWrite": "내가 쓰게 해주세요!",
    "writeHere": "여기 쓰시 오..",
    "ratingAspect": "평가 측면",
-   "sendingRequest": "요청 보내기"
+   "sendingRequest": "요청 보내기",
+   "changePriority": "우선순위 변경"
 }

+ 2 - 1
assets/lang/zh.json

@@ -317,5 +317,6 @@
    "letMeWrite": "让我来写吧!",
    "writeHere": "写在这里..",
    "ratingAspect": "评级方面",
-   "sendingRequest": "发送请求"
+   "sendingRequest": "发送请求",
+   "changePriority": "改变优先级"
 }

+ 1 - 2
lib/app_router.dart

@@ -52,7 +52,6 @@ class AppRouter extends RootStackRouter {
   List<AutoRouteGuard> get appGuards => [
     AutoRouteGuard.simple((resolver, router) async{
       RouteMatch<dynamic> vRedirector = resolver.route;
-      var codeFromUrl = '';
       String? rawPid = '';
       var pid;
       bool stb = false;
@@ -69,7 +68,7 @@ class AppRouter extends RootStackRouter {
         router.pushNamed("/qr?new=true");
       }
 
-      if(vRedirector.fragment != null && vRedirector.fragment != '' && U.getAccessCode() != null){
+      if(vRedirector.fragment != '' && U.getAccessCode() != null){
         await _sharedPreferencesManager.clearKey(SharedPreferencesManager.keyBaseUrl);
         await _sharedPreferencesManager.clearKey(SharedPreferencesManager.keyAccessCode);
         await _sharedPreferencesManager.clearKey(SharedPreferencesManager.keySerialCode);

+ 3 - 3
lib/main.dart

@@ -28,7 +28,7 @@ import 'package:http/http.dart' as http;
 
 import 'app_router.dart';
 
-final SharedPreferencesManager _sharedPreferencesManager = locator<SharedPreferencesManager>();
+// final SharedPreferencesManager _sharedPreferencesManager = locator<SharedPreferencesManager>();
 var isDebug = true;
 
 class MyHttpOverrides extends HttpOverrides {
@@ -180,7 +180,7 @@ class NotificationClass {
       // print('tokennya');
       // print(token);
       if (token != null) {
-        var res = _apiAuthProvider.postDataNoAuth('/api/notifications/received/$token/$mid').then((value) =>
+        _apiAuthProvider.postDataNoAuth('/api/notifications/received/$token/$mid').then((value) =>
             print('sukses kirim confirm')
         );
       }
@@ -227,7 +227,7 @@ class NotificationClass {
     FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
     FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage? message) {
       if (message != null && !U.hidePayload) {
-        print(message.data);
+        // print(message.data);
         goNotification(message.data, context);
       }
     });

+ 1 - 1
lib/src/layouts/functions/detail.dart

@@ -63,7 +63,7 @@ class DetailFunction{
   openAttachment(list) async{
     var filePath = await token.getPath()+'/TelNow/Files/';
     if(!File(filePath+getFileName(list['responseAttachment'])).existsSync()){
-      print("file isnot ready yet");
+      // print("file isnot ready yet");
       await apiAuthProvider.downloadImage(list['responseAttachment'], filePath+getFileName(list['responseAttachment']));
     }
     await OpenFile.open(filePath+getFileName(list['responseAttachment']));

+ 16 - 5
lib/src/layouts/functions/request.dart

@@ -144,14 +144,15 @@ class RequestFunction{
     }
   }
 
-  sendRequest(BuildContext context, widget, controllerNote, controllerLocation, controllerDateString) async{
+  sendRequest(BuildContext context, widget, controllerNote, controllerLocation, controllerDateString, currentSliderValue) async{
     showLoading(context, lottie: kIsWeb && !isCanvasKit ? null : 'Paperplane.json', text: 'sendingRequest'.tr());
     var data;
     data = {
       'note': controllerNote.text.trim() == '' ? '' : controllerNote.text.trim(),
       'location': Provider.of<CreateSerModule>(context, listen: false).locationType() == 2 ? controllerLocation.text.trim() : Provider.of<CreateSerModule>(context, listen: false).defaultLocation(),
       'sendLater': Provider.of<CreateSerModule>(context, listen: false).sendLater(),
-      'datetimeScheduled': controllerDateString.text.trim()
+      'datetimeScheduled': controllerDateString.text.trim(),
+      'requestPriority': getPrioValue(currentSliderValue)
     };
 
     if(!kIsWeb && U.newServerVersion(1709864293) && !U.getInternetStatus()){
@@ -182,7 +183,16 @@ class RequestFunction{
     }
   }
 
-  sendRequestToOthers(BuildContext context, widget, controllerUserId, controllerNote, controllerLocation, controllerDateString) async{
+  getPrioValue(currentSliderValue){
+    switch(currentSliderValue){
+      case 0: return 'RENDAH';
+      case 50: return 'NORMAL';
+      case 100: return 'TINGGI';
+      default: return 'NORMAL';
+    }
+  }
+
+  sendRequestToOthers(BuildContext context, widget, controllerUserId, controllerNote, controllerLocation, controllerDateString, currentSliderValue) async{
     showLoading(context, lottie: kIsWeb && !isCanvasKit ? null : 'Paperplane.json', text: 'sendingRequest'.tr());
     var data;
     data = {
@@ -193,7 +203,8 @@ class RequestFunction{
         'note': controllerNote.text.trim() == '' ? '' : controllerNote.text.trim(),
         'tenantCode': widget.request['tenantCode'],
         'location': Provider.of<CreateSerModule>(context, listen: false).locationType() == 2 ? controllerLocation.text.trim() : Provider.of<CreateSerModule>(context, listen: false).defaultLocation(),
-        'datetimeScheduled': controllerDateString.text.trim()
+        'datetimeScheduled': controllerDateString.text.trim(),
+        'requestPriority': getPrioValue(currentSliderValue)
       }]
     };
 
@@ -210,7 +221,7 @@ class RequestFunction{
 
       try{
         var res = await apiAuthProvider.postData('/api/receptionists/send/request', null, data, context);
-        print("res ##> $res");
+        // print("res ##> $res");
         if (res != null) {
           Future.delayed(Duration(seconds: 3), (){
             closeLoading(context);

+ 1 - 1
lib/src/layouts/mobile/message_broadcast.dart

@@ -258,7 +258,7 @@ class _MobMessageBroadcastPageState extends State<MobMessageBroadcastPage> {
                                 ),
                               ),
                               onTap: () {
-                                print('delete please!');
+                                // print('delete please!');
                                 setState(() {
                                   _filePath = '';
                                   _fileName = '';

+ 3 - 3
lib/src/layouts/mobile/message_chat.dart

@@ -157,14 +157,14 @@ class _MobMessageChatPageState extends State<MobMessageChatPage> {
 
             downloadImage(data);
           } else if (result.type == DocumentChangeType.modified && isAfterLoad) {
-            print("modified");
+            // print("modified");
             if (messageData.where((element) => element['uniqueId'] == data!['uniqueId']).length > 0) {
               int index = messageData.indexWhere((element) => element['uniqueId'] == data!['uniqueId']);
               messageData[index]['read'] = data!['read'];
               messageData[index]['readStatus'] = data['readStatus'];
             }
           } else if (result.type == DocumentChangeType.removed && isAfterLoad) {
-            print("removed");
+            // print("removed");
           }
         });
         isAfterLoad = true;
@@ -203,7 +203,7 @@ class _MobMessageChatPageState extends State<MobMessageChatPage> {
 
   scrollListener() {
     if (scrollController.offset >= scrollController.position.maxScrollExtent) {
-      print('loadMessage');
+      // print('loadMessage');
       getMessage();
     }
   }

+ 92 - 9
lib/src/layouts/mobile/request_create.dart

@@ -28,6 +28,17 @@ class MobReqCreatePage extends StatefulWidget {
   State<MobReqCreatePage> createState() => _MobReqCreatePageState();
 }
 
+getColorScheme(val){
+  var color;
+  switch (val){
+    case 0: color = Color(0xFF4FB66C); break;
+    case 50: color = Color(0xFFFFA800); break;
+    case 100: color = Color(0xFFC9223B); break;
+    default: color = Color(0xFF4FB66C);
+  }
+  return color;
+}
+
 class _MobReqCreatePageState extends State<MobReqCreatePage> {
   final RequestFunction reqFunc = RequestFunction();
   final SharedPreferencesManager sharedPreferencesManager = locator<SharedPreferencesManager>();
@@ -39,6 +50,8 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
   TextEditingController controllerUserId = new TextEditingController()..text = '';
 
   FocusNode focusNodeLocation = new FocusNode();
+  double _currentSliderValue = 0;
+  Color sliderColor = getColorScheme(0);
 
   @override
   void initState() {
@@ -51,6 +64,13 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
     reqFunc.getSuggestionLocation(context);
     U.getOtherLabelList(context);
 
+    switch (widget.request['requestPriority']){
+      case 'RENDAH': _currentSliderValue = 0; break;
+      case 'NORMAL': _currentSliderValue = 50; break;
+      case 'TINGGI': _currentSliderValue = 100; break;
+    }
+    sliderColor = getColorScheme(_currentSliderValue);
+
     // TODO: implement initState
     super.initState();
   }
@@ -204,7 +224,7 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
                                             }
                                           }
                                         },
-                                        onTapCancel: () => print("gasido cah"),
+                                        onTapCancel: () => print(" "),
                                       ),
                                     ],
                                   ),
@@ -367,7 +387,7 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
                                     decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5)), border: Border.all(color: Colors.black26, width: 2)),
                                   ),
                                   onTap: ()=>pickupImageNew(),
-                                ) : Container()
+                                ) : Container(),
                               ],
                             ) : GestureDetector(
                               child: Container(
@@ -382,7 +402,69 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
                                 ),
                               ),
                               onTap: ()=>pickupImageNew(),
-                            )
+                            ),
+                            U.newServerVersion(1736473802) ? Column(
+                              crossAxisAlignment: CrossAxisAlignment.start,
+                              children: [
+                                SizedBox(height: 36),
+                                Text('changePriority'.tr(), style: TextStyle(color: textColor, fontWeight: FontWeight.w600)),
+                                SizedBox(height: 12),
+                                Container(
+                                  height: 32,
+                                  decoration: BoxDecoration(
+                                    color: Colors.white,
+                                    borderRadius: BorderRadius.circular(25.0),
+                                    border: Border.all(
+                                      width: 3.0,
+                                      color: Colors.transparent,
+                                    ),
+                                    gradient: LinearGradient(
+                                      colors: [
+                                        Color(0xFF4FB66C).withOpacity(1),
+                                        Color(0xFFFFA800).withOpacity(1),
+                                        Color(0xFFC9223B).withOpacity(1),
+                                      ],
+                                      begin: Alignment.topLeft,
+                                      end: Alignment.bottomRight,
+                                    ),
+                                  ),
+                                  child: Container(
+                                    decoration: BoxDecoration(
+                                      color: Colors.white,
+                                      borderRadius: BorderRadius.circular(25.0),
+                                    ),
+                                    child: SliderTheme(
+                                      data: SliderThemeData(
+                                        inactiveTrackColor: Colors.white,
+                                      ),
+                                      child: Slider(
+                                        activeColor: sliderColor,
+                                        value: _currentSliderValue,
+                                        max:100,
+                                        divisions: 2,
+                                        onChanged: (double value) {
+                                          setState(() {
+                                            _currentSliderValue = value;
+                                            sliderColor = getColorScheme(value);
+                                          });
+                                        },
+                                      ),
+                                    ),
+                                  ),
+                                ),
+                                SizedBox(height: 4,),
+                                Center(
+                                    child: Row(
+                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                                      children: [
+                                        Text('priorityLow'.tr(), style: TextStyle(fontSize: 12),),
+                                        Text('priorityNormal'.tr(), style: TextStyle(fontSize: 12)),
+                                        Text('priorityHigh'.tr(), style: TextStyle(fontSize: 12)),
+                                      ],
+                                    )
+                                )
+                              ],
+                            ) : SizedBox()
                           ],
                         ),
                       ],
@@ -436,7 +518,7 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
                           if (controllerDateString.text.trim().isEmpty && widget.request['noteFormat'] == 'DATE'){
                             showError(context, 'dateRequired'.tr());
                           } else {
-                            reqFunc.sendRequestToOthers(context, widget, controllerUserId, controllerNote, controllerLocation, controllerDateString);
+                            reqFunc.sendRequestToOthers(context, widget, controllerUserId, controllerNote, controllerLocation, controllerDateString, _currentSliderValue);
                           }
                         } else {
                           showError(context, 'idRequired'.tr());
@@ -444,7 +526,7 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
                       } else if (controllerDateString.text.trim().isNotEmpty && widget.request['noteFormat'] == 'DATE'){
                         dialogSendLater();
                       } else {
-                        reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString);
+                        reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString, _currentSliderValue);
                       }
                     } else {
                       showError(context, 'lengthMax'.tr());
@@ -500,7 +582,7 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
                     onTap: (){
                       navigateBack(contexts);
                       Provider.of<CreateSerModule>(context, listen: false).setSendLater(true);
-                      reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString);
+                      reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString, _currentSliderValue);
                     },
                   ),
                 ),
@@ -529,7 +611,7 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
                     ),
                     onTap: (){
                       navigateBack(contexts);
-                      reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString);
+                      reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString, _currentSliderValue);
                     },
                   ),
                 ),
@@ -555,8 +637,9 @@ class _MobReqCreatePageState extends State<MobReqCreatePage> {
   pickupImageNew() async{
     if(Provider.of<CreateSerModule>(context, listen: false).images().length < 5){
       if (kIsWeb) {
-        var image = await reqFunc.getImageNew(context, ImageSource.gallery);
-        Provider.of<CreateSerModule>(context, listen: false).setImages(image);
+        await reqFunc.getImageNew(context, ImageSource.gallery).then((img){
+          img != null ? Provider.of<CreateSerModule>(context, listen: false).setImages(img) : (){};
+        });
       } else{
         showModalBottomSheet<void>(
             context: context,

+ 1 - 1
lib/src/layouts/mobile/request_success.dart

@@ -120,7 +120,7 @@ class _MobReqSuccessPageState extends State<MobReqSuccessPage> {
                             } : () async{
                               var filePath = await token.getPath()+'/TelNow/Files/';
                               if(!File(filePath+getFileName(list['responseAttachment'])).existsSync()){
-                                print("file isnot ready yet");
+                                // print("file isnot ready yet");
                                 await apiAuthProvider.downloadImage(list['responseAttachment'], filePath+getFileName(list['responseAttachment']));
                               }
                               await OpenFile.open(filePath+getFileName(list['responseAttachment']));

+ 1 - 1
lib/src/layouts/web/app_web.dart

@@ -14,7 +14,7 @@ class _WebAppPageState extends State<WebAppPage> {
 
   @override
   void initState() {
-    // getOtherList();
+    getOtherList();
     begin = true;
     // TODO: implement initState
     super.initState();

+ 1 - 1
lib/src/layouts/web/menu_history.dart

@@ -32,7 +32,7 @@ class _WebHistoryPageState extends State<WebHistoryPage> with TickerProviderStat
 
   @override
   void initState() {
-    print(U.newServerVersion(1716279633));
+    // print(U.newServerVersion(1716279633));
     Provider.of<HistoryModule>(context, listen: false).reset();
     _animationController = new AnimationController(vsync: this, duration: Duration(seconds: 1));
     _animationController.repeat(reverse: true);

+ 3 - 3
lib/src/layouts/web/message_list.dart

@@ -151,14 +151,14 @@ class _WebMessageListPageState extends State<WebMessageListPage> {
               messageData.add(data);
             }
           } else if (result.type == DocumentChangeType.modified && isAfterLoad) {
-            print("modified");
+            // print("modified");
             if (messageData.where((element) => element['uniqueId'] == data!['uniqueId']).length > 0) {
               int index = messageData.indexWhere((element) => element['uniqueId'] == data!['uniqueId']);
               messageData[index]['read'] = data!['read'];
               messageData[index]['readStatus'] = data['readStatus'];
             }
           } else if (result.type == DocumentChangeType.removed && isAfterLoad) {
-            print("removed");
+            // print("removed");
           }
         });
         isAfterLoad = true;
@@ -195,7 +195,7 @@ class _WebMessageListPageState extends State<WebMessageListPage> {
 
   scrollListener() {
     if (scrollController.offset >= scrollController.position.maxScrollExtent) {
-      print('loadMessage');
+      // print('loadMessage');
       getMessage();
     }
   }

+ 83 - 7
lib/src/layouts/web/request_create.dart

@@ -23,6 +23,17 @@ class WebReqCreatePage extends StatefulWidget {
   State<WebReqCreatePage> createState() => _WebReqCreatePageState();
 }
 
+getColorScheme(val){
+  var color;
+  switch (val){
+    case 0: color = Color(0xFF4FB66C); break;
+    case 50: color = Color(0xFFFFA800); break;
+    case 100: color = Color(0xFFC9223B); break;
+    default: color = Color(0xFF4FB66C);
+  }
+  return color;
+}
+
 class _WebReqCreatePageState extends State<WebReqCreatePage> {
   final RequestFunction reqFunc = RequestFunction();
   final SharedPreferencesManager sharedPreferencesManager = locator<SharedPreferencesManager>();
@@ -34,6 +45,8 @@ class _WebReqCreatePageState extends State<WebReqCreatePage> {
   TextEditingController controllerUserId = new TextEditingController()..text = '';
 
   FocusNode focusNodeLocation = new FocusNode();
+  double _currentSliderValue = 0;
+  Color sliderColor = getColorScheme(0);
 
   @override
   void initState() {
@@ -259,7 +272,7 @@ class _WebReqCreatePageState extends State<WebReqCreatePage> {
                                                 decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5)), border: Border.all(color: Colors.black26, width: 2)),
                                               ),
                                               onTap: ()=>pickupImageNew(),
-                                            ) : Container()
+                                            ) : Container(),
                                           ],
                                         );
                                       },
@@ -277,7 +290,70 @@ class _WebReqCreatePageState extends State<WebReqCreatePage> {
                                       ),
                                     ),
                                     onTap: ()=>pickupImageNew(),
-                                  )
+                                  ),
+                                  // Text("MBUH ==> ${U.newServerVersion(1736473802)} X ${U.retServerVersion()}"),
+                                  U.newServerVersion(1736473802) ? Column(
+                                    crossAxisAlignment: CrossAxisAlignment.start,
+                                    children: [
+                                      SizedBox(height: 36),
+                                      Text('changePriority'.tr(), style: TextStyle(color: textColor, fontWeight: FontWeight.w600)),
+                                      SizedBox(height: 12),
+                                      Container(
+                                        height: 32,
+                                        decoration: BoxDecoration(
+                                          color: Colors.white,
+                                          borderRadius: BorderRadius.circular(25.0),
+                                          border: Border.all(
+                                            width: 3.0,
+                                            color: Colors.transparent,
+                                          ),
+                                          gradient: LinearGradient(
+                                            colors: [
+                                              Color(0xFF4FB66C).withOpacity(1),
+                                              Color(0xFFFFA800).withOpacity(1),
+                                              Color(0xFFC9223B).withOpacity(1),
+                                            ],
+                                            begin: Alignment.topLeft,
+                                            end: Alignment.bottomRight,
+                                          ),
+                                        ),
+                                        child: Container(
+                                          decoration: BoxDecoration(
+                                            color: Colors.white,
+                                            borderRadius: BorderRadius.circular(25.0),
+                                          ),
+                                          child: SliderTheme(
+                                            data: SliderThemeData(
+                                              inactiveTrackColor: Colors.white,
+                                            ),
+                                            child: Slider(
+                                              activeColor: sliderColor,
+                                              value: _currentSliderValue,
+                                              max:100,
+                                              divisions: 2,
+                                              onChanged: (double value) {
+                                                setState(() {
+                                                  _currentSliderValue = value;
+                                                  sliderColor = getColorScheme(value);
+                                                });
+                                              },
+                                            ),
+                                          ),
+                                        ),
+                                      ),
+                                      SizedBox(height: 4,),
+                                      Center(
+                                          child: Row(
+                                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                                            children: [
+                                              Text('priorityLow'.tr(), style: TextStyle(fontSize: 12),),
+                                              Text('priorityNormal'.tr(), style: TextStyle(fontSize: 12)),
+                                              Text('priorityHigh'.tr(), style: TextStyle(fontSize: 12)),
+                                            ],
+                                          )
+                                      )
+                                    ],
+                                  ) : SizedBox()
                                 ],
                               ),
                             ],
@@ -378,7 +454,7 @@ class _WebReqCreatePageState extends State<WebReqCreatePage> {
                                             onTap: ()async{
                                               context.read<CreateSerModule>().setLocationType(2);
                                             },
-                                            onTapCancel: () => print("gasido cah"),
+                                            onTapCancel: () => print(" "),
                                           ),
                                         ],
                                       ),
@@ -429,7 +505,7 @@ class _WebReqCreatePageState extends State<WebReqCreatePage> {
                                   if (controllerDateString.text.trim().isEmpty && widget.request['noteFormat'] == 'DATE'){
                                     showError(context, 'dateRequired'.tr());
                                   } else {
-                                    reqFunc.sendRequestToOthers(context, widget, controllerUserId, controllerNote, controllerLocation, controllerDateString);
+                                    reqFunc.sendRequestToOthers(context, widget, controllerUserId, controllerNote, controllerLocation, controllerDateString, _currentSliderValue);
                                   }
                                 } else {
                                   showError(context, 'idRequired'.tr());
@@ -437,7 +513,7 @@ class _WebReqCreatePageState extends State<WebReqCreatePage> {
                               } else if (controllerDateString.text.trim().isNotEmpty && widget.request['noteFormat'] == 'DATE'){
                                 dialogSendLater();
                               } else {
-                                reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString);
+                                reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString, _currentSliderValue);
                               }
                             } else {
                               showError(context, 'lengthMax'.tr());
@@ -497,7 +573,7 @@ class _WebReqCreatePageState extends State<WebReqCreatePage> {
                     onTap: (){
                       navigateBack(contexts);
                       Provider.of<CreateSerModule>(context, listen: false).setSendLater(true);
-                      reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString);
+                      reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString, _currentSliderValue);
                     },
                   ),
                 ),
@@ -526,7 +602,7 @@ class _WebReqCreatePageState extends State<WebReqCreatePage> {
                     ),
                     onTap: (){
                       navigateBack(contexts);
-                      reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString);
+                      reqFunc.sendRequest(context, widget, controllerNote, controllerLocation, controllerDateString, _currentSliderValue);
                     },
                   ),
                 ),

+ 1 - 1
lib/src/layouts/web/request_success.dart

@@ -145,7 +145,7 @@ class _WebReqSuccessPageState extends State<WebReqSuccessPage> {
                                       onTap: () async{
                                         var filePath = await token.getPath()+'/TelNow/Files/';
                                         if(!File(filePath+getFileName(list['responseAttachment'])).existsSync()){
-                                          print("file isnot ready yet");
+                                          // print("file isnot ready yet");
                                           await apiAuthProvider.downloadImage(list['responseAttachment'], filePath+getFileName(list['responseAttachment']));
                                         }
                                         await OpenFile.open(filePath+getFileName(list['responseAttachment']));

+ 8 - 4
lib/src/utils/U.dart

@@ -92,18 +92,18 @@ class U {
   }
 
   static Future<Token?> refreshAuth(RefreshTokenBody refreshTokenBody) async {
-    print("refresh token");
+    // print("refresh token");
     return _lockAuth.synchronized(() async {
-      print("refresh token start");
+      // print("refresh token start");
       var nw = DateTime.now().millisecondsSinceEpoch;
       if (_authLastMs == 0 || nw - _authLastMs >= 5000) {
-        print("refresh token request");
+        // print("refresh token request");
         ApiAuthRepository apiAuthRepository = ApiAuthRepository();
         var token = await _tryRefreshAuth(refreshTokenBody);
         _authLastMs = DateTime.now().millisecondsSinceEpoch;
         _lastReqToken = token;
       }
-      print("refresh token finish");
+      // print("refresh token finish");
       return _lastReqToken;
     });
 
@@ -316,6 +316,10 @@ class U {
     return version <= _serverVersion;
   }
 
+  static int retServerVersion(){
+    return _serverVersion;
+  }
+
   static Map _otherLabelList = {};
   static getOtherLabelList(BuildContext context) async{
     if(newServerVersion(1725245109)){

+ 4 - 4
web/index.html

@@ -148,7 +148,7 @@
   <script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-firestore.js"></script>
 
   <script>
-    var serviceWorkerVersion = null;
+    var flutter_service_worker_version = null;
     var scriptLoaded = false;
     function loadMainDartJs() {
       if (scriptLoaded) {
@@ -167,7 +167,7 @@
         // Wait for registration to finish before dropping the <script> tag.
         // Otherwise, the browser will load the script multiple times,
         // potentially different versions.
-        var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
+        var serviceWorkerUrl = 'flutter_service_worker.js?v=' + flutter_service_worker_version;
         navigator.serviceWorker.register(serviceWorkerUrl)
           .then((reg) => {
             function waitForActivation(serviceWorker) {
@@ -182,7 +182,7 @@
               // No active web worker and we have installed or are installing
               // one for the first time. Simply wait for it to activate.
               waitForActivation(reg.installing || reg.waiting);
-            } else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
+            } else if (!reg.active.scriptURL.endsWith(flutter_service_worker_version)) {
               // When the app updates the serviceWorkerVersion changes, so we
               // need to ask the service worker to update.
               console.log('New service worker available.');
@@ -200,7 +200,7 @@
               // No active web worker and we have installed or are installing
               // one for the first time. Simply wait for it to activate.
 			  console.log('Firebase messaging has been installing.');
-            } else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
+            } else if (!reg.active.scriptURL.endsWith(flutter_service_worker_version)) {
               // When the app updates the serviceWorkerVersion changes, so we
               // need to ask the service worker to update.
               console.log('Firebase messaging is available.');