diff --git a/SAS/TMSS/frontend/tmss_webapp/package.json b/SAS/TMSS/frontend/tmss_webapp/package.json index b63abd6c200da0ca55ecfbc4c3737eea29781a4d..da0ab66f612537c211fc0b23368694122acd7ca2 100644 --- a/SAS/TMSS/frontend/tmss_webapp/package.json +++ b/SAS/TMSS/frontend/tmss_webapp/package.json @@ -81,7 +81,7 @@ "prepareTemplateSchemas": "node prepareTemplateSchemas.js", "cleanTemplateSchemas": "node cleanTemplateSchemas.js" }, - "proxy": "http://127.0.0.1:8000/", + "proxy": "http://127.0.0.1:8008/", "eslintConfig": { "extends": "react-app" }, diff --git a/SAS/TMSS/frontend/tmss_webapp/src/App.css b/SAS/TMSS/frontend/tmss_webapp/src/App.css index bfac349899bd80c18d77de7bd42d9b5adaa052c1..3d1a5c6cc7b891ca42e6a269e36bb07e179ecaf5 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/App.css +++ b/SAS/TMSS/frontend/tmss_webapp/src/App.css @@ -149,7 +149,7 @@ p { .layout-main .fa,.far { color: #005b9f; - font-size: 20px !important; + font-size: 20px; } thead { diff --git a/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_pageheader.scss b/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_pageheader.scss index 933a7a97e0d572f4795799d0d275be8c6844e22a..a54e54ef84f7299f21033c8c23ba6ef2292d5e7c 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_pageheader.scss +++ b/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_pageheader.scss @@ -18,9 +18,16 @@ .page-action-menu i { margin-left: 5px; } - +.subsystem{ + font-size: 14px !important; + padding: 5px; + font-weight: bold; + margin-right: 10px; + border-radius: 100%; + + } .page-header .fa,.far { - font-size: 25px !important; + font-size: 20px; } .fa-disabled { @@ -34,5 +41,6 @@ padding-bottom: 2px ; font-weight: bold; margin-right: 10px; - border-radius: 100% - } \ No newline at end of file + border-radius: 100%; + } + \ No newline at end of file diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js index 85f2fb088d081ac01174e6727f6271dbb7ea649f..7867a693e88f93d42805b08389e020f32e1b49a0 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js @@ -109,6 +109,7 @@ export class TimelineView extends Component { onSavedisable:false, result:false, dsStatus: false, // To show the Dynamic Scheduling status in timeline/week view page header + subSystemStatus: false, isOnSkyView: this.timelineUIAttributes.isOnSkyView===undefined?true:this.timelineUIAttributes.isOnSkyView, // Flag to show on sky view in normal timeline view } this.STATUS_BEFORE_SCHEDULED = ['defining', 'defined', 'schedulable']; // Statuses before scheduled to get station_group @@ -278,6 +279,15 @@ export class TimelineView extends Component { } this.setState({fsStatus: status}); }); + this.state.dsStatus && await UtilService.getSubSystemScheduler() + .then(response => { + var status = false; + if(response) { + status = response.status_value === 'active'? true: false; + } + this.setState({subSystemStatus: status}); + }) + } /** @@ -287,6 +297,14 @@ export class TimelineView extends Component { */ async updateDSStatus(status, scheduleType) { if(scheduleType === 'dynamic') { + this.state.status && await UtilService.getSubSystemScheduler() + .then(response => { + var status = false; + if(response) { + status = response.status_value === 'active'? true: false; + } + this.setState({subSystemStatus: status}); + }) this.setState({dsStatus: status}); } if(scheduleType === 'fixed') { @@ -1332,7 +1350,7 @@ export class TimelineView extends Component { if (jsonData.action === 'create') { this.addNewData(jsonData.object_details.id, jsonData.object_type, jsonData.object_details); } else if (jsonData.action === 'update') { - this.updateExistingData(jsonData.object_details.id, jsonData.object_type, jsonData.object_details); + this.updateExistingData(jsonData.object_details.id? jsonData.object_details.id: '', jsonData.object_type, jsonData.object_details); } else if (jsonData.action === 'delete') { this.deleteExistingData(jsonData.object_details.id, jsonData.object_type); } @@ -1419,6 +1437,12 @@ export class TimelineView extends Component { } break; } + case 'subsystem': { + let subSystemStatus = this.state.subSystemStatus; + subSystemStatus = object.status_value === 'active' ? true: false + this.setState({subSystemStatus: subSystemStatus}) + break; + } case 'task_blueprint': { // let suBlueprints = this.state.suBlueprints; // let existingSUB = _.find(suBlueprints, ['id', object.scheduling_unit_blueprint_id]); @@ -1634,10 +1658,14 @@ export class TimelineView extends Component { title: this.state.dsStatus?'Dynamic Scheduling is On':'Dynamic Scheduling is Off', className:`tag p-chips-token-label su-${this.state.dsStatus? 'finished': 'error'}`, type: 'tag' }, + this.state.dsStatus && { + title: this.state.subSystemStatus?'Dynamic Scheduler is Active':'Dynamic Scheduler is Idle', + className:` fa fa-${this.state.subSystemStatus? 'play' : 'stop'} subsystem p-chips-token-label su-${this.state.subSystemStatus? 'finished': 'error'}`, + type: 'tag' }, { content: 'F', title: this.state.fsStatus?'Fixed time Scheduling is On':'Fixed time Scheduling is Off', className:`tag p-chips-token-label su-${this.state.fsStatus? 'finished': 'error'}`, - type: 'tag' }, + type: 'tag' }, { icon: 'fa-cog', title: 'Scheduling Settings', type: 'button', actOn: 'click', props: { callback: this.showDymanicSchedulerPopup }, }, { icon: 'fa-bars', title: '', diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js index 8885de13186eb139d0db888c8e8175291fa9dcd2..ed7af061d169e05b19bca6300f2709aacbc69a67 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js @@ -86,6 +86,7 @@ export class WeekTimelineView extends Component { popPosition: {display: 'none'}, dsStatus: false, // To show the Dynamic Scheduling status in timeline/week view page header fsStatus: false, + subSystemStatus: false, isOnSkyView: this.timelineUIAttributes.isOnSkyWeekView===undefined?true:this.timelineUIAttributes.isOnSkyWeekView, // Flag to show on sky view in week view } this.STATUS_BEFORE_SCHEDULED = ['defining', 'defined', 'schedulable']; // Statuses before scheduled to get station_group @@ -143,6 +144,14 @@ export class WeekTimelineView extends Component { } this.setState({fsStatus: status}); }); + this.state.dsStatus && await UtilService.getSubSystemScheduler() + .then(response => { + var status = false; + if(response) { + status = response.status_value === 'active'? true: false; + } + this.setState({subSystemStatus: status}); + }) } /** @@ -152,6 +161,14 @@ export class WeekTimelineView extends Component { */ async updateDSStatus(status, scheduleType) { if(scheduleType === 'dynamic') { + this.state.status && await UtilService.getSubSystemScheduler() + .then(response => { + var status = false; + if(response) { + status = response.status_value === 'active'? true: false; + } + this.setState({subSystemStatus: status}); + }) this.setState({dsStatus: status}); } if(scheduleType === 'fixed') { @@ -912,7 +929,7 @@ export class WeekTimelineView extends Component { if (jsonData.action === 'create') { this.addNewData(jsonData.object_details.id, jsonData.object_type, jsonData.object_details); } else if (jsonData.action === 'update') { - this.updateExistingData(jsonData.object_details.id, jsonData.object_type, jsonData.object_details); + this.updateExistingData(jsonData.object_details.id? jsonData.object_details.id: '', jsonData.object_type, jsonData.object_details); } else if (jsonData.action === 'delete') { this.deleteExistingData(jsonData.object_details.id, jsonData.object_type); } @@ -978,6 +995,12 @@ export class WeekTimelineView extends Component { } break; } + case 'subsystem': { + let subSystemStatus = this.state.subSystemStatus; + subSystemStatus = object.status_value === 'active' ? true: false + this.setState({subSystemStatus: subSystemStatus}) + break; + } case 'task_blueprint': { // let suBlueprints = this.state.suBlueprints; // let existingSUB = _.find(suBlueprints, ['id', object.scheduling_unit_blueprint_id]); @@ -1308,6 +1331,10 @@ export class WeekTimelineView extends Component { title: this.state.dsStatus?'Dynamic Scheduling is On':'Dynamic Scheduling is Off', className:`tag p-chips-token-label su-${this.state.dsStatus? 'finished': 'error'}`, type: 'tag' }, + this.state.dsStatus && { + title: this.state.subSystemStatus?'Dynamic Scheduler is Active':'Dynamic Scheduler is Idle', + className:`fa fa-${this.state.subSystemStatus? 'play' : 'stop'} subsystem p-chips-token-label su-${this.state.subSystemStatus? 'finished': 'error'}`, + type: 'tag' }, { content: 'F', title: this.state.fsStatus?'Fixed time Scheduling is On':'Fixed time Scheduling is Off', className:`tag p-chips-token-label su-${this.state.fsStatus? 'finished': 'error'}`, diff --git a/SAS/TMSS/frontend/tmss_webapp/src/services/util.service.js b/SAS/TMSS/frontend/tmss_webapp/src/services/util.service.js index f9aab0724bed5a135ee53b909ff9c11f3eb27124..92c6dac3cf6ee80e2ca63fcde464aeeb06d817e7 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/services/util.service.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/services/util.service.js @@ -265,6 +265,16 @@ const UtilService = { return null; } }, + getSubSystemScheduler: async function() { + try { + const url = '/api/subsystem/scheduler'; + const response = await axios.get(url); + return response.data; + } catch (error) { + console.error('[getSubStystemScheduler]', error); + return null; + } + }, /** * Update Switch On/Off status of Dynamic Scheduling * @param {Object} JSON object