Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display json data #174

Open
jagtarsingh opened this issue Apr 2, 2019 · 0 comments
Open

Display json data #174

jagtarsingh opened this issue Apr 2, 2019 · 0 comments

Comments

@jagtarsingh
Copy link

jagtarsingh commented Apr 2, 2019

Hello,

I am trying to display the json data using mozaik-ext-json widget. But I do not see anything on the dashboard except "unknown". I configured the widget as below:

Installed mozaik-ext-json
--> npm install --save mozaik-ext-json

Registered json. Below is the console log when I run node app.js
--> info: registered API 'json' (mode: poll)

Added json file on the same server which is accessible through http://server IP/a.json

Content of a.json
{
type: 'json.data',
title: 'Title',
value: 'Hello'
}

In the config.js added below:

// clients configs
api: {
    json: {
        url: 'http://server IP/a.json'
    }


    // first dashboard
    {
        // 4 x 3 dashboard
        columns: 4,
        rows:    3,
        widgets: [
            {
                type:  'json.data',
                title: 'THIS IS A TITLE',
                value: '${obj1.value}',
                columns: 1, rows: 1,
                x: 1, y: 1
            },

The console log shows below info:

$ node app.js
info: registered API 'mozaik' (mode: poll)
info: registered API 'github' (mode: poll)
info: registered API 'travis' (mode: poll)
info: registered API 'jenkins' (mode: poll)
info: registered API 'json' (mode: poll)
info: serving static contents from /home/jagtar/mozaik-demo/build
info: Mozaïk server listening at http://server IP:5000
info: Client #1 connected
info: Added subscription 'json.data'
info: Calling 'json.data'
info: [json] calling http://server IP/a.json
info: Setting timer for 'json.data'
double callback!
info: Added subscription 'jenkins.job.aa'
info: Calling 'jenkins.job.aa'
info: [jenkins] fetching from http://jenkins/job/aa/api/json?pretty=true&depth=10&tree=builds[number,duration,result,builtOn,timestamp,id,building]
info: Setting timer for 'jenkins.job.aa'
error: [json] json.data - status code: undefined
info: removing interval for 'json.data'
info: removing interval for 'jenkins.job.aa'
info: Client #1 disconnected
info: Client #2 connected
info: Setting timer for 'json.data'
info: Setting timer for 'jenkins.job.aa'
info: Calling 'json.data'
info: [json] calling http://serer IP/a.json
info: Calling 'jenkins.job.aa'
info: [jenkins] fetching from http://jenkins/job/aa/api/json?pretty=true&depth=10&tree=builds[number,duration,result,builtOn,timestamp,id,building]
double callback!
error: [json] json.data - status code: undefined
info: Calling 'json.data'
info: [json] calling http://server IP/a.json

The Jenkins builds are successfully displayed on the dashboard

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant