Comments (5)
you can ask for the dashboard info directly, either via the service in self.ctx.dashboardService.getDashboardInfo() it calls /api/dashboard/info/${dashboardId}
, check dashboard.service.ts
for more. This automatically authenticates with logged in user.
Otherwise you can use localStorage.jwt_token.
from thingsboard.
you can ask for the dashboard info directly, either via the service in self.ctx.dashboardService.getDashboardInfo() it calls
/api/dashboard/info/${dashboardId}
, checkdashboard.service.ts
for more. This automatically authenticates with logged in user.Otherwise you can use localStorage.jwt_token.
Could you please elaborate this?
from thingsboard.
in your widget code:
self.ctx.dashboardService.getDashboardInfo(location.pathname.split('/')[2]).subscribe(d => console.log(d.createdTime))
This gets the current dashboardid based on the url and console logs the createdTime
from thingsboard.
self.ctx.dashboardService.getDashboardInfo(location.pathname.split('/')[2]).subscribe(d => console.log(d.createdTime))
This snippet of code is giving an error: "Cannot read properties of undefined (reading 'dashboardService')" how can I deal with this kind of code?... I think the problem is in subscribe method
from thingsboard.
I Solved this problem using localStorage token, then fetched the API and got my results.
from thingsboard.
Related Issues (20)
- Can you support custom RPC topics?
- How to read response from "sendTwoWayRpcCommand(entityId,requestBody)" HOT 3
- Devices from Customer HOT 4
- Updating state to other State in Markdown Map
- character limit in decoders and console.log HOT 2
- Copy to view node - not copying attributes to Entity View HOT 3
- Click buttons to change widget HOT 2
- LwM2M: disconnected LwM2M devices constantly display as active with lastActivityTime always being very recent
- LwM2M: ObserveComposite operation
- Aggregated functions erros
- thingsboard REST API taking too much time to get history data
- Development environment for team
- What is "profile type" of a device profile ? HOT 1
- Access device claiming timestamp
- Export device pictures HOT 10
- Add an option to customise the file name for widget data export
- Searching dashboards as a customer with entityquerycontroller HOT 3
- Heatmap Widget HOT 1
- Back button HOT 1
- Toast Notifications in Custom Action and Markdown HTML HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thingsboard.