Correction nom
This commit is contained in:
parent
0a2310f6ac
commit
e0f098d33d
|
@ -41,11 +41,17 @@ class MyPopup extends PanelMenu.Button {
|
||||||
let time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
|
let time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
|
||||||
|
|
||||||
let timeItem = new PopupMenu.PopupMenuItem('');
|
let timeItem = new PopupMenu.PopupMenuItem('');
|
||||||
let timeLabel = new St.Label({text:'Capital actuel : +0:00'});
|
let timeLabel = new St.Label({text:'CAPITAL TOTAL : +0:00'});
|
||||||
timeItem.add(timeLabel);
|
timeItem.add(timeLabel);
|
||||||
|
|
||||||
this.menu.addMenuItem(timeItem);
|
this.menu.addMenuItem(timeItem);
|
||||||
|
|
||||||
|
let ifValidateItem = new PopupMenu.PopupMenuItem('');
|
||||||
|
let ifValidateLabel = new St.Label({text:'CAPITAL SI VALIDÉ : +0:00'});
|
||||||
|
ifValidateItem.add(ifValidateLabel);
|
||||||
|
|
||||||
|
//this.menu.addMenuItem(ifValidateItem);
|
||||||
|
|
||||||
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
||||||
|
|
||||||
let startItem = new PopupMenu.PopupMenuItem('');
|
let startItem = new PopupMenu.PopupMenuItem('');
|
||||||
|
@ -59,28 +65,27 @@ class MyPopup extends PanelMenu.Button {
|
||||||
|
|
||||||
this.menu.connect('open-state-changed', (menu, open) => {
|
this.menu.connect('open-state-changed', (menu, open) => {
|
||||||
if (open) {
|
if (open) {
|
||||||
log('opened');
|
try {
|
||||||
let result = send_request('https://badge.cadoles.com/ninebadge/rest/showtimers', 'POST', key)
|
let result = send_request('https://badge.cadoles.com/ninebadge/rest/showtimers', 'POST', key)
|
||||||
timeLabel.set_text('Capital actuel : ' + result.capitaltime)
|
timeLabel.set_text('CAPITAL TOTAL : ' + result.capitaltime)
|
||||||
let status = send_request('https://badge.cadoles.com/ninebadge/rest/status', 'POST', key)
|
|
||||||
if(status.status == "started") {
|
let status = send_request('https://badge.cadoles.com/ninebadge/rest/status', 'POST', key)
|
||||||
label.set_text('FIN POINTAGE');
|
if(status.status == "started") {
|
||||||
started = true
|
label.set_text('FIN POINTAGE');
|
||||||
} else {
|
started = true
|
||||||
started = false
|
} else {
|
||||||
label.set_text('DÉBUT POINTAGE');
|
started = false
|
||||||
|
label.set_text('DÉBUT POINTAGE');
|
||||||
|
}
|
||||||
|
ifValidateLabel.set_text('CAPITAL SI VALIDÉ : +0:00')
|
||||||
|
} catch(error) {
|
||||||
|
log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
startItem.connect('activate', () => {
|
startItem.connect('activate', () => {
|
||||||
try {
|
|
||||||
let result = send_request('https://badge.cadoles.com/ninebadge/rest/showtimers', 'POST', key)
|
|
||||||
timeLabel.set_text('CAPITAL : ' + result.capitaltime)
|
|
||||||
} catch(error) {
|
|
||||||
log(error);
|
|
||||||
}
|
|
||||||
if(started){
|
if(started){
|
||||||
send_request('https://badge.cadoles.com/ninebadge/rest/clockout', 'POST', key)
|
send_request('https://badge.cadoles.com/ninebadge/rest/clockout', 'POST', key)
|
||||||
started = false
|
started = false
|
Before Width: | Height: | Size: 943 B After Width: | Height: | Size: 943 B |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Loading…
Reference in New Issue