-
Notifications
You must be signed in to change notification settings - Fork 3
/
menus.gs
50 lines (47 loc) · 1.7 KB
/
menus.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function onOpen(e) {
var ss = SpreadsheetApp.getActive();
var name = "Device Responses";
var sh = ss.getSheetByName(name);
if ( sh ) {
createMenu();
} else {
createSetupMenu();
}
}
function createMenu() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('SheetsMDM')
.addSubMenu(
ui.createMenu('Run Command')
.addItem('Invoke Munki Install', 'invokeMunkiInstall')
.addItem('Available OS Updates', 'availableOSUpdates')
.addItem('Certificate List', 'certificateList')
.addItem('Device Information', 'deviceInformation')
.addItem('Installed Application List', 'installedApplicationList')
.addItem('OS Update Status', 'osUpdateStatus')
.addItem('Profile List', 'profileList')
.addItem('Provisioning Profile List', 'provisioningProfileList')
.addItem('Restart Device', 'restartDevice')
.addItem('Schedule OS Update', 'scheduleOSUpdate')
.addItem('Schedule OS Update Scan', 'scheduleOSUpdateScan')
.addItem('Security Info', 'securityInfo')
.addItem('Shut Down Device', 'shutDownDevice')
.addItem('Status Update', 'pushNotify')
)
.addItem('Sync', 'syncEverything')
.addToUi();
}
function createSetupMenu() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('SheetsMDM')
.addItem('Setup...', 'setupAndAuthorize')
.addToUi();
ui.alert('GusDay SheetsMDM Example Setup', 'Use the SheetsMDM menu to set up your SheetsMDM instance.', ui.ButtonSet.OK);
}
function setupAndAuthorize() {
getDevicesSheet();
createDeviceResponsesSheet();
var ui = SpreadsheetApp.getUi();
ui.alert('Authorization Finished', 'Please continue the "Configuring SheetsMDM" section of the Wiki to finish setting up your web app.', ui.ButtonSet.OK);
createMenu();
}