Skip to content

Snippets other

Check role

HTML
<template v-if="hasRole('sys_administrator')">I've got  role</template>

Dev tips

Performance Check

JavaScript
1
2
3
4
5
var t0 = performance.now();
//body

var t1 = performance.now();
console.log("totals " + (t1 - t0) + " milliseconds.");

Debugger

JavaScript
1
2
3
//console.log('hello');
debugger; // trigger chrome to stop 
//console.log('world');

Regex Text

JavaScript
/api\/teams\/.*\/users/.test('/api/teams/fdsafdsf/users')

refs select html element by id

HTML
1
2
3
4
<!--html-->
<textarea ref="el"></textarea>
<!--js-->
this.$refs.el.value

SRS

Text Only
mounted() {

    //Pobranie parametru z srs w razie potrzeby 
    const command = this.$parent?.$parent?.api?.tables?.find(x => x.name === 'view');
    const table = command ? this.convertSRSTableToObject(command) : [];
    this.srsData = table[0] || {};

    //SETUP URL for dictionary 
    var data = this.setERPremoteID(false);
    console.log(data.remoteID);
    console.log(data.remoteSource);
}