packages/ove-core/src/server/api.js
function (req, res) {
        let sectionId = req.params.id;
        let s = server.state.get('sections[' + sectionId + ']');
        if (Utils.isNullOrEmpty(s)) {
            log.debug('Unable to read configuration for section id:', sectionId);
            Utils.sendEmptySuccess(res);
            return;
        }

        let section = {
            id: parseInt(sectionId, 10), x: s.x, y: s.y, w: s.w, h: s.h, space: Object.keys(s.spaces)[0]
        };
        const app = s.app;
        if (app) {
            section.app = { url: app.url, state: app.state, opacity: app.opacity };
        }
        log.debug('Successfully read configuration for section id:', sectionId);
        Utils.sendMessage(res, HttpStatus.OK, JSON.stringify(section));
    }
function (req, res) {
        let sectionId = req.params.id;
        let s = server.state.get('sections[' + sectionId + ']');
        if (Utils.isNullOrEmpty(s)) {
            log.debug('Unable to read configuration for section id:', sectionId);
            Utils.sendEmptySuccess(res);
            return;
        }

        let section = {
            id: parseInt(sectionId, 10), x: s.x, y: s.y, w: s.w, h: s.h, space: Object.keys(s.spaces)[0]
        };
        const app = s.app;
        if (app) {
            section.app = { url: app.url, state: app.state, opacity: app.opacity };
        }
        log.debug('Successfully read configuration for section id:', sectionId);
        Utils.sendMessage(res, HttpStatus.OK, JSON.stringify(section));
    }
function ( req , res ) { let sectionId = req . params . id ; let s = server . state . get ( 'sections[' + sectionId + ']' ) ; if ( Utils . isNullOrEmpty ( s ) ) { log . debug ( 'Unable to read configuration for section id:' , sectionId ) ; Utils . sendEmptySuccess ( res ) ; return ; } let section = { id : parseInt ( sectionId , 10 ) , x : s . x , y : s . y , w : s . w , h : s . h , space : Object . keys ( s . spaces ) [ 0 ] } ; const app = s . app ; if ( app ) { section . app = { url : app . url , state : app . state , opacity : app . opacity } ; } log . debug ( 'Successfully read configuration for section id:' , sectionId ) ; Utils . sendMessage ( res , HttpStatus . OK , JSON . stringify ( section ) ) ; }
Fetches details of an individual section
Fetches details of an individual section