lundi 1 novembre 2021

Signup email confirmation onclick button stopped work with no code change?! Help appreciated

so I've encountered a problem where the submit button on a web page built on the Microsoft Azure platform is not responding as it should.

After entering their information and clicking submit the site should redirect to the thank you page and automatically send the user a confirmation email.

It was working fine before, and the code has not been changed since.

Anybody have any idea why would be super helpful thanks.

Maybe be helpful idk: The submit button has an onclick function call __doPostBack(...)

Thanks for the help.




Apollo - User Authentication

I am authenticating my user on the front end. Should I store a session in the backend or send an authorization bearer and for user related data like projects search for the id by sending it through a graphql query on the front end. Or should it instead use context on Apollo server.




How can I write a notification inside a client webpage using JS?

I need to send data from my backend to my frontend (sort of a notification system). My backend is a simple Node JS server that works fine and my frontend is a simple web page using webpack and JS. My goal is to send data from my server to my web client. I tried to solve this by using a notification system with Service Workers. Uunfortunately in my service worker 'push' listener, I can not put the notification content in my actual web page, for instance I tried this : enter image description here , but its not working because apparently we can not use 'window' or 'document' object inside a service worker... so I have two questions please : 1. Is there an easier way to send data from a server to client? 2. Using service workers, is there a way to send the data from the service worker to the web client ? Thank you for all your help !




Web API returns 404 from IIS

I am getting a 404 from a .net core 5.0 web app that I have deployed to a newly set up windows server. I have installed the dotnet-hosting-5.0.11-win runtime libraries on the server and installed IIS with the following settings:

IIS Settings

When I browse to it from IIS I get a 404. I gave up on the initial project and started clean with a stripped down version from the VS2019 templates. Still got the 404 :

404 Error

Here is the project from VS2019 itself just to give you a clearer idea of what I am trying to install and run from the Windows server:

VS2019 project

Here are the publish options for the project:

Publish Options

Created a new website in IIS for this app. Here are the settings for that:

IIS Website Settings

Here are the app pool settings for the app:

App pool settings

Here is the web.config file for the app:

Web.Config

Enabled directory browsing based on other posts I read:

Here is a snapshot of the logs file on the server:

Server Log Files

Any help appreciated!




I failed flutter web build

I'm going to use flutter web and firebase. I'm going to do a simple build test, but if I build it, It stops at 'await ui.webOnlyInitializePlatform();' of web_entrypoint.dart.

pubspec.yaml

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2

    provider: ^6.0.1
    firebase_auth: ^3.1.1
    cloud_firestore: ^2.5.2
    firebase_storage: ^8.0.3
    #  google_sign_in: ^5.1.0
    firebase_core: ^1.6.0
    cached_network_image: ^3.1.0
    carousel_slider: ^4.0.0
    get: ^4.3.8
    flutter_web_frame: ^0.0.2 

main.dart

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  // Firebase.initializeApp();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return FlutterWebFrame(
      builder: (context) {
        return MaterialApp(
          home: Scaffold(
            appBar: AppBar(
              title: Text('Title 123'),
            ),
            body: Center(
              child: Text('Body Text'),
            ),
          ),
        );
      },
      maximumSize: Size(768.0, 1024.0), // Maximum size
      enabled: true, // default is enable, when disable content is full size
      backgroundColor: Colors.grey, // Background color/white space
    );
  }
}

index.html

</script>

<!--firebase-->
<script src = "https://www.gstatic.com/firebasejs/9.2.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.2.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.2.0/firebase-firestore.js"</script>
<script src="https://www.gstatic.com/firebasejs/9.2.0/firebase-storage.js"></script>

<script>
  var firebaseConfig = {
    apiKey: ,
    authDomain: ,
    projectId: ,
    storageBucket: ,
    messagingSenderId: ,
    appId: ,
    measurementId: 
  };

  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);
  firebase.getAnalytics(app);

</script>

</body>
</html>

When build from Chrome, debug stops here.

// @dart=2.12
// Flutter web bootstrap script for package:omd_test/main.dart.

import 'dart:ui' as ui;
import 'dart:async';

import 'package:omd_test/main.dart' as entrypoint;
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'package:omd_test/generated_plugin_registrant.dart';

typedef _UnaryFunction = dynamic Function(List<String> args);
typedef _NullaryFunction = dynamic Function();
Future<void> main() async {
  registerPlugins(webPluginRegistrar);
  await ui.webOnlyInitializePlatform(); //debug stop here
  if (entrypoint.main is _UnaryFunction) {
    return (entrypoint.main as _UnaryFunction)(<String>[]);
  }
  return (entrypoint.main as _NullaryFunction)();
}

If I 'step over' after the debugger stops, the following error is output.

TypeError: Cannot read properties of undefined (reading 'app')

May I know the cause and solution of this problem? Thank you.




How visualize data that are published via MQTT as a website?

A IoT device publish its data via tcp/ip sockets and MQTT. Now I like to process these data inside the web browser and create a beautiful interactive GUI. Since I have no idea in web page programming, I am asking for typical ways to approach that topic. The web page I am looking for should open the MQTT connection, receives the data and visualize it. That should happens inside the web browser so it uses the Laptops/PCs/Phones CPU to do the data processing. This is needed because the MQTT IoT device does not have much computation power. Any ideas, toolchains, frameworks to approach that problem?




Which technology should we use?

We are planning to build our own trading system, assuming that the DB, SQLServer, trading processes and other components are ready.

What are the best technologies that we should consider to implement a fully responsive platform that can be used as a desktop, web and mobile (iOS and mobile) considering that there will be prices updates with SignarlR, and many other live updates, so the app has to be responsive and efficient enough.

And is it actually a good idea to build an app that works on all devices with a single technology ?