How to use quasar - 10 common examples

To help you get started, we’ve selected a few quasar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openhab / org.openhab.ui.habot / web / src / store / items / actions.js View on Github external
let itemName = evt.topic.split('/')[2]
      let item = context.getters.name(itemName)
      if (item.transformedState) {
        // need to get the transformedState from the API
        axios.get('/rest/items/' + itemName).then((resp) => {
          context.commit('updateOne', { itemName: itemName, newState: payload.value, newTransformedState: resp.data.transformedState })
        })
      } else {
        context.commit('updateOne', { itemName: itemName, newState: payload.value })
      }
    }

    if (evt.type.indexOf('ItemAddedEvent') >= 0 || evt.type.indexOf('ItemUpdatedEvent') >= 0 || evt.type.indexOf('ItemRemovedEvent') >= 0) {
      console.log('Items have changed, refreshing store')
      eventSource.close() // close the event source immediately to avoid catching more events
      Notify.create({ type: 'info', message: 'Items have changed, refreshing' })
      setTimeout(() => {
        context.dispatch('initialLoad').then(() => {
          context.dispatch('watchEvents')
        })
      }, 500)
    }
  }
github rmetcalf9 / dockJob / webfrontend / src / pages / Login.vue View on Github external
creationHandler () {
      var TTT = this
      globalStore.commit('SET_APIFN', TTT.$callDockjobAPI)
      if (globalStore.getters.datastoreState === 'INITIAL') {
        Loading.show()
        var callback = {
          ok: function (response) {
            Loading.hide()
            if (globalStore.getters.datastoreState === 'INITIAL') {
              console.log('Error state STILL initial - stopping infinite loop')
            } else {
              // TTT.$router.replace(TTT.$route.query.redirect || '/')
              TTT.creationHandler()
            }
          },
          error: function (response) {
            Loading.hide()
            console.log('Error frontend connection data state: ' + response.message)
            Notify.create(response.message)
          }
        }
github aws-samples / aws-serverless-airline-booking / src / frontend / store / bookings / actions.js View on Github external
};
      const {
        // @ts-ignore
        data: {
          listBookings: { items: bookingData }
        }
      } = await API.graphql(graphqlOperation(listBookings, bookingFilter));

      let bookings = bookingData.map(booking => new Booking(booking));

      console.log(bookings);

      commit("SET_BOOKINGS", bookings);

      resolve();
      Loading.hide();
    } catch (err) {
      console.error(err);
      reject(err);
    }
  });
}
github rmetcalf9 / dockJob / webfrontend / src / pages / Dashboard.vue View on Github external
ok: function (response) {
          // console.log(response.data.guid)
          Loading.hide()

          TTT.pinnedJobs = response.data.result

          TTT.loading = false

          if (!response.data.dePaginatorResp.complete) {
            Notify.create({color: 'info', message: 'Not all pinned jobs were queried back'})
          }
        },
        error: function (error) {
github rmetcalf9 / dockJob / webfrontend / src / pages / Jobs.vue View on Github external
ok: function (response) {
            // console.log(response.data.name)
            TTT.selectedSecond = []
            TTT.request({
              pagination: TTT.jobsDataTableSettings.serverPagination,
              filter: TTT.jobsDataTableSettings.filter
            })
            Notify.create({color: 'positive', detail: 'Job "' + response.data.name + '" Deleted'})
          },
          error: function (error) {
github rmetcalf9 / dockJob / webfrontend_old / src / components / Login.vue View on Github external
creationHandler () {
      var TTT = this
      if (globalStore.getters.datastoreState === 'INITIAL') {
        Loading.show()
        var callback = {
          ok: function (response) {
            Loading.hide()
            if (globalStore.getters.datastoreState === 'INITIAL') {
              console.log('Error state STILL initial - stopping infinite loop')
            }
            else {
              // TTT.$router.replace(TTT.$route.query.redirect || '/')
              TTT.creationHandler()
            }
          },
          error: function (response) {
            Loading.hide()
            console.log('Error frontend connection data state: ' + response.message)
            Toast.create(response.message)
          }
github aws-samples / aws-serverless-airline-booking / src / frontend / store / bookings / actions.js View on Github external
async function processBooking({ chargeToken, outboundFlight }) {
  const processBookingInput = {
    input: {
      paymentToken: chargeToken,
      bookingOutboundFlightId: outboundFlight.id
    }
  };

  try {
    Loading.show({
      message: "Creating a new booking..."
    });

    const {
      // @ts-ignore
      data: {
        processBooking: { id: bookingProcessId }
      }
    } = await API.graphql(
      graphqlOperation(processBookingMutation, processBookingInput)
    );

    return bookingProcessId;
  } catch (err) {
    console.error(err);
    throw err;
github rmetcalf9 / dockJob / webfrontend / src / pages / Login.vue View on Github external
ok: function (response) {
            Loading.hide()
            if (globalStore.getters.datastoreState === 'INITIAL') {
              console.log('Error state STILL initial - stopping infinite loop')
            } else {
              // TTT.$router.replace(TTT.$route.query.redirect || '/')
              TTT.creationHandler()
            }
          },
          error: function (response) {
github zuck / alighieri / src / store / index.js View on Github external
updateStats: debounce(state => {
      state.content = convertHtmlToTxt(state.contentHTML)
      state.sentences = state.content
        .replace(/(\.+|:|;|\?|!)/g, '$1\n')
        .split(/\n+\s*/)
        .filter(n => n)
      state.words = state.content.split(/\s+/).filter(n => n)
      if (state.words) {
        LocalStorage.set(CONTENT_BACKUP_KEY, state.contentHTML)
      } else {
        LocalStorage.remove(CONTENT_BACKUP_KEY)
      }
    }, 100 /* Execute at most once every 100ms */)
  },
github zuck / alighieri / src / components / Writer.vue View on Github external
updateContentAndStats () {
      this.content = this.convertHtmlToTxt(this.contentHTML)
      // Store backup content (only if there is valid text)
      if (this.content && this.content.length > 0) {
        LocalStorage.set(CONTENT_BACKUP_KEY, this.contentHTML)
      }
      else {
        LocalStorage.remove(CONTENT_BACKUP_KEY)
      }
      this.sentences = this.content
        .replace(/(\.+|:|;|\?|!)/g, '$1\n')
        .split(/\n+\s*/)
        .filter(n => n)
      this.words = this.content
        .split(/\s+/)
        .filter(n => n)
    },
    processEditOperation (operation) {