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,28 +65,27 @@ class MyPopup extends PanelMenu.Button {
|
||||
|
||||
this.menu.connect('open-state-changed', (menu, open) => {
|
||||
if (open) {
|
||||
log('opened');
|
||||
let result = send_request('https://badge.cadoles.com/ninebadge/rest/showtimers', 'POST', key)
|
||||
timeLabel.set_text('Capital actuel : ' + result.capitaltime)
|
||||
let status = send_request('https://badge.cadoles.com/ninebadge/rest/status', 'POST', key)
|
||||
if(status.status == "started") {
|
||||
label.set_text('FIN POINTAGE');
|
||||
started = true
|
||||
} else {
|
||||
started = false
|
||||
label.set_text('DÉBUT POINTAGE');
|
||||
try {
|
||||
let result = send_request('https://badge.cadoles.com/ninebadge/rest/showtimers', 'POST', key)
|
||||
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');
|
||||
started = true
|
||||
} else {
|
||||
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
Block a user