Navigation

    Quasar Framework

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. felice
    F
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 22
    • Best 0
    • Groups 0

    felice

    @felice

    0
    Reputation
    10
    Profile views
    22
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    felice Follow

    Latest posts made by felice

    • RE: Command "cordova" failed with exit code: 1 on Windows

      I tried to restart my computer and tried again and it now shows:

      Checking Java JDK and Android SDK versions
      ANDROID_SDK_ROOT=C:\Users\Felice Tan\AppData\Local\Android\Sdk (recommended setting)
      ANDROID_HOME=C:\Users\Felice Tan\AppData\Local\Android\Sdk (DEPRECATED)
      Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
      
      FAILURE: Build failed with an exception.
      
      * What went wrong:
      Unable to start the daemon process.
      This problem might be caused by incorrect configuration of the daemon.
      For example, an unrecognized jvm option is used.
      Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/6.2.2/userguide/gradle_daemon.html
      Process command line: C:\Program Files (x86)\Java\jdk1.8.0_181\bin\java.exe -Xmx2048m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\Felice Tan\Gradle\gradle-6.2.2-all\gradle-6.2.2\lib\gradle-launcher-6.2.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.2.2
      Please read the following process output to find out more:
      -----------------------
      Error occurred during initialization of VM
      Could not reserve enough space for 2097152KB object heap
      
      
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
      
      posted in Help
      F
      felice
    • Command "cordova" failed with exit code: 1 on Windows

      I am trying to put my quasar application into android through android studio but could due to the following error:

      Checking Java JDK and Android SDK versions
      ANDROID_SDK_ROOT=C:\Users\Felice Tan\AppData\Local\Android\Sdk (recommended setting)
      ANDROID_HOME=C:\Users\Felice Tan\AppData\Local\Android\Sdk (DEPRECATED)
      Could not find an installed version of Gradle either in Android Studio,
      or on your system to install the gradle wrapper. Please include gradle
      in your path, or install Android Studio
      
       app:spawn Command "cordova" failed with exit code: 1 +0ms
       app:cordova-conf Updated Cordova config.xml +10ms
      

      Any idea on how to resolve this issue?

      posted in Help
      F
      felice
    • RE: Session/Local Variables for Quasar

      @jraez Oh, I see. Will try that, thanks alot for the help! 🙂

      posted in Help
      F
      felice
    • RE: Session/Local Variables for Quasar

      I have figured out how it works!

      At login page:

      this.$q.localStorage.set("username", current_username)
      

      At main page:

      let value = this.$q.localStorage.getItem("username")
      

      If I want to logout from my application, do I do the following?

      this.$q.localStorage.clear()
      
      posted in Help
      F
      felice
    • Session/Local Variables for Quasar

      I am creating a login page for my application, and I was thinking how can I store my username as a session variable such that the username will be display on my pages after I have logged in.

      I have looked at the Local/Session Plugin from https://quasar.dev/quasar-plugins/web-storage#Introduction but was unclear of how I should implement it in my code.

      I have followed and used the code from the documentation in my <script> tag as shown:

      this.$q.localStorage.set(key, value)
      let value = this.$q.localStorage.getItem(key)
      

      This is a variable that I use to store the username from the username input textfield:

      var current_username = this.userToSave.username;
      

      Are there any examples I could reference to for the Local/Session Plugin? And if I used the above code in my login page, how can I access the session variable in my other pages?

      Would appreciate some help on this, thank you!

      posted in Help
      F
      felice
    • RE: Pull to Refresh not working

      @jadedRepublic here is the code for getReminder():

      methods: {
         getReminder() {     
                 var documentClient = new AWS.DynamoDB.DocumentClient({apiVersion: "2012-08-10"});
                 var params = {
                   TableName: "schedule",
                   Select: "ALL_ATTRIBUTES"
                 };
                 if(this.credentials) {
                   documentClient.scan(params, (err, data) => {
                   if (err) {
                     console.error("Unable to read item. Error JSON:", JSON.stringify(err, null, 2));
                   } 
                   else {
                     for(var i in data) {
                       scanResults.push([i, data[i]]);
                     }
                     reminderData = scanResults[0];
                     reminderData = reminderData[1];
                     reminderData.forEach((item) => {
                     let med_id = item.medicine_id;
                     let med_name = item.medicine_name;  
                     let med_frequency = item.medicine_frequency;
                     let med_prescription = item.doctor_prescription;
                     let med_time = item.medicine_time;
                     this.tableData.push({id: med_id, 
                                              name: med_name, 
                                              frequency: med_frequency,
                                              prescription: med_prescription, 
                                              time: med_time});
                });
              }
           });
         }
         else {
                 var that = this;
                 var promise = AWS.config.credentials.getPromise();
                 promise.then(() => {
                     var creds = {
                          ...
                     };
           
                     that.credentials = creds;
                     documentClient.scan(params, (err, data) => {
                     if (err) {
                       console.error("Unable to read item. Error JSON:", JSON.stringify(err, null, 2));
                     } 
                     else {
                       for(var i in data) {
                       scanResults.push([i, data[i]]);
                     }
                     reminderData = scanResults[0];
                     reminderData = reminderData[1];
                     reminderData.forEach((item) => {
                        let med_id = item.medicine_id;
                        let med_name = item.medicine_name;  
                        let med_frequency = item.medicine_frequency;
                        let med_prescription = item.doctor_prescription;
                        let med_time = item.medicine_time;
                        this.tableData.push({id: med_id, 
                                                name: med_name, 
                                                frequency: med_frequency, 
                                                prescription: med_prescription, 
                                                time: med_time});
             });
           }
          });
         },
          function(err) {
                 that.credentials = null;
              }
            );
        }
      
      posted in Help
      F
      felice
    • RE: Pull to Refresh not working

      @ouaR Thank you for your reply! 🙂

      I would like to ask if there is a way I could reflect newly added items into the list when the page is pulled to refresh?
      I tried including my method getReminder() in the code but it does not work.

      I have a form that allows inputs into the database, and I am looking for a method to update the list of items (through pull to refresh) when new items are added.

      Code

      refresh (done) {
              setTimeout(() => {
                console.log("Refresh"),
                this.getReminder(),
                done()
              }, 1000)
            }
      
      posted in Help
      F
      felice
    • RE: How can I populate my data from an array in another method?

      @rab I managed to solved my error by the following amendments and it worked! 🙂 Thanks alot!
      Instead of using:

      promise.then(function() {...});
      

      I have changed to:

      promise.then(() => {...});
      
      posted in Help
      F
      felice
    • RE: How can I populate my data from an array in another method?

      Hi @chyde90, I would like to enquire about the following issue:

      As I want to auto-load the list of items when the page is refreshed, I have included the following code that runs the getReminder method when the page is loaded.

      created() {
           this.getReminder()
           if(this.credentials) {
             console.log("in created(), have credentials");
              }
           else {
             console.log("in created(), getting credentials...");
             this.credentials = this.getCredentials();
           }
         }
      

      However, I am getting the following error indicating that it cannot read the property ‘tableData’ of undefined which I don’t really understand what the error means.
      bb69c31e-4f25-42c4-890a-e45e2a0f30cc-image.png

      I have made changes to the existing getReminder code by adding the credentials in:

       methods: {
            getReminder() {     
                    var documentClient = new AWS.DynamoDB.DocumentClient({apiVersion: "2012-08-10"});
                    var params = {
                      TableName: "schedule",
                      Select: "ALL_ATTRIBUTES"
                    };
                    if(this.credentials) {
                      documentClient.scan(params, (err, data) => {
                      if (err) {
                        console.error("Unable to read item. Error JSON:", JSON.stringify(err, null, 2));
                      } 
                      else {
                        for(var i in data) {
                          scanResults.push([i, data[i]]);
                        }
                        reminderData = scanResults[0];
                        reminderData = reminderData[1];
      
                        reminderData.forEach((item) => {
                          let med_id = item.medicine_id;
                          let med_name = item.medicine_name;  
                          let med_frequency = item.medicine_frequency;
                          let med_prescription = item.doctor_prescription;
                          let med_time = item.medicine_time;
            
                          this.tableData.push({id: med_id, 
                                              name: med_name, 
                                              frequency: med_frequency,
                                              prescription: med_prescription, 
                                              time: med_time});
                          });
                        }
                      });
                    }
                    else {
                      var that = this;
                      var promise = AWS.config.credentials.getPromise();
      
                      promise.then(
                        function() {
                          var creds = {
                            ...
                          };
            
                          that.credentials = creds;
                          documentClient.scan(params, (err, data) => {
                          if (err) {
                            console.error("Unable to read item. Error JSON:", JSON.stringify(err, null, 2));
                          } 
                          else {
                            for(var i in data) {
                            scanResults.push([i, data[i]]);
                          }
                          reminderData = scanResults[0];
                          reminderData = reminderData[1];
      
                          reminderData.forEach((item) => {
                            let med_id = item.medicine_id;
                            let med_name = item.medicine_name;  
                            let med_frequency = item.medicine_frequency;
                            let med_prescription = item.doctor_prescription;
                            let med_time = item.medicine_time;
                            this.tableData.push({id: med_id, 
                                                name: med_name, 
                                                frequency: med_frequency, 
                                                prescription: med_prescription, 
                                                time: med_time});
                          });
                        }
                      });
                    },
                    function(err) {
                      that.credentials = null;
                    }
                  );
                }
      
      posted in Help
      F
      felice
    • Pull to Refresh not working

      I am trying to refresh my list of items using <q-pull-to-refresh> but when I pull the page down, it does not stop loading even though I have set the setTimeout to 1000. I want to refresh my list of items such that newly added items can be reflected in the list when refreshed. Is there any way I can solve this?

      Code:

      refresher (done) {
         setTimeout(() => {
           console.log("Refresh")
         }, 1000)
       } 
      
      posted in Help
      F
      felice