diff --git a/js/db/result-set.js b/js/db/result-set.js index c539ccd2..4144ca2c 100644 --- a/js/db/result-set.js +++ b/js/db/result-set.js @@ -1,123 +1,130 @@ - -var Result = require('./result'); +const Result = require('./result'); /** * This class stores the database results. */ module.exports = new Class({ - results: null - ,error: null + results: null, + error: null, - /** - * Initilizes the resultset object. - */ - ,initialize(results, error) { - this.results = results; - this.error = error; - } - - /** - * Gets the query error. - * - * @return {Db.Err} the error or null if no errors hapened - */ - ,getError() { - return this.error; - } - - ,fetch() { - if (this.error) - throw this.error; - - if (this.results !== null - && this.results.length > 0) - return this.results.shift(); + /** + * Initilizes the resultset object. + */ + initialize(results, error) { + this.results = results; + this.error = error; + }, - return null; - } - - /** - * Fetchs the next result from the resultset. - * - * @return {Db.Result} the result or %null if error or there are no more results - */ - ,fetchResult() { - var result = this.fetch(); - - if (result !== null) { - if (result.data instanceof Array) - return new Result(result); - else - return true; - } + /** + * Gets the query error. + * + * @return {Db.Err} the error or null if no errors hapened + */ + getError() { + return this.error; + }, - return null; - } + fetch() { + if (this.error) { + throw this.error; + } + console.log('this.results', this.results); + if (this.results !== null && this.results.length > 0) { + return this.results.shift(); + } - /** - * Fetchs the first row object from the next resultset. - * - * @return {Array} the row if success, %null otherwise - */ - ,fetchObject() { - var result = this.fetch(); + return null; + }, - if (result !== null - && result.data instanceof Array - && result.data.length > 0) - return result.data[0]; + /** + * Fetchs the next result from the resultset. + * + * @return {Db.Result} the result or %null if error or there are no more results + */ + fetchResult() { + const result = this.fetch(); + console.log('test result', result); + if (result !== null) { + if (result.data instanceof Array) { + return new Result(result); + } else { + return true; + } + } - return null; - } + return null; + }, - /** - * Fetchs data from the next resultset. - * - * @return {Array} the data - */ - ,fetchData() { - var result = this.fetch(); + /** + * Fetchs the first row object from the next resultset. + * + * @return {Array} the row if success, %null otherwise + */ + fetchObject() { + const result = this.fetch(); - if (result !== null - && result.data instanceof Array) - return result.data; + if ( + result !== null && + result.data instanceof Array && + result.data.length > 0 + ) { + return result.data[0]; + } - return null; - } + return null; + }, - /** - * Fetchs the first row and column value from the next resultset. - * - * @return {Object} the value if success, %null otherwise - */ - ,fetchValue() { - var row = this.fetchRow(); + /** + * Fetchs data from the next resultset. + * + * @return {Array} the data + */ + fetchData() { + const result = this.fetch(); - if (row instanceof Array && row.length > 0) - return row[0]; + if (result !== null && result.data instanceof Array) { + return result.data; + } - return null; - } + return null; + }, - /** - * Fetchs the first row from the next resultset. - * - * @return {Array} the row if success, %null otherwise - */ - ,fetchRow() { - var result = this.fetch(); + /** + * Fetchs the first row and column value from the next resultset. + * + * @return {Object} the value if success, %null otherwise + */ + fetchValue() { + const row = this.fetchRow(); - if (result !== null - && result.data instanceof Array - && result.data.length > 0) { - var object = result.data[0]; - var row = new Array(result.columns.length); - for(var i = 0; i < row.length; i++) - row[i] = object[result.columns[i].name]; - return row; - } - - return null; - } + if (row instanceof Array && row.length > 0) { + return row[0]; + } + + return null; + }, + + /** + * Fetchs the first row from the next resultset. + * + * @return {Array} the row if success, %null otherwise + */ + fetchRow() { + const result = this.fetch(); + + if ( + result !== null && + result.data instanceof Array && + result.data.length > 0 + ) { + const object = result.data[0]; + const row = new Array(result.columns.length); + for (let i = 0; i < row.length; i++) { + row[i] = object[result.columns[i].name]; + } + return row; + } + + return null; + } }); - diff --git a/src/components/ui/VnConfirm.vue b/src/components/ui/VnConfirm.vue index e0552175..c8067d7c 100644 --- a/src/components/ui/VnConfirm.vue +++ b/src/components/ui/VnConfirm.vue @@ -105,23 +105,18 @@ async function confirm() { en-US: - confirm: Confirm wantToContinue: Are you sure you want to continue? cancel: Cancel es-ES: - confirm: Confirmar wantToContinue: ¿Seguro que quieres continuar? cancel: Cancelar ca-ES: - confirm: Confirmar wantToContinue: Segur que vols continuar? cancel: Cancel·lar fr-FR: - confirm: Confirmer wantToContinue: Êtes-vous sûr de vouloir continuer? cancel: Annuler pt-PT: - confirm: Confirme wantToContinue: Tem a certeza de que deseja continuar? cancel: Cancelar diff --git a/src/components/ui/VnImg.vue b/src/components/ui/VnImg.vue index 8bc1abee..132c1431 100644 --- a/src/components/ui/VnImg.vue +++ b/src/components/ui/VnImg.vue @@ -97,6 +97,7 @@ const url = computed(() => { spinner-color="primary" :width="props.width" :height="props.height" + draggable >