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 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);
|
||||
|
||||
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());
|
||||
|
||||
let startItem = new PopupMenu.PopupMenuItem('');
|
||||
|
@ -59,9 +65,10 @@ class MyPopup extends PanelMenu.Button {
|
|||
|
||||
this.menu.connect('open-state-changed', (menu, open) => {
|
||||
if (open) {
|
||||
log('opened');
|
||||
try {
|
||||
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") {
|
||||
label.set_text('FIN POINTAGE');
|
||||
|
@ -70,17 +77,15 @@ class MyPopup extends PanelMenu.Button {
|
|||
started = false
|
||||
label.set_text('DÉBUT POINTAGE');
|
||||
}
|
||||
ifValidateLabel.set_text('CAPITAL SI VALIDÉ : +0:00')
|
||||
} catch(error) {
|
||||
log(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
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){
|
||||
send_request('https://badge.cadoles.com/ninebadge/rest/clockout', 'POST', key)
|
||||
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