2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
14 #include <afsconfig.h>
15 #include <afs/param.h>
28 #include "svr_window.h"
29 #include "svr_security.h"
30 #include "svr_syncvldb.h"
31 #include "svr_salvage.h"
32 #include "svc_create.h"
33 #include "svc_delete.h"
34 #include "svc_startstop.h"
35 #include "svc_viewlog.h"
37 #include "svr_install.h"
38 #include "svr_uninstall.h"
39 #include "svr_prune.h"
40 #include "svr_getdates.h"
41 #include "svr_execute.h"
42 #include "svr_hosts.h"
46 #include "set_repprop.h"
47 #include "set_create.h"
48 #include "set_delete.h"
50 #include "set_quota.h"
51 #include "set_rename.h"
52 #include "set_release.h"
53 #include "set_clone.h"
55 #include "set_restore.h"
59 * PROTOTYPES _________________________________________________________________
63 void Command_OnProperties (LPIDENT lpi);
64 void Command_OnIconView (HWND hDialog, BOOL fServerView, CHILDTAB iTab, int cmd);
68 * ROUTINES ___________________________________________________________________
72 void StartContextCommand (HWND hDialog,
73 LPIDENT lpiRepresentedByWindow,
74 LPIDENT lpiChosenByClick,
77 CHILDTAB iTab = Server_GetDisplayedTab (hDialog);
78 LPIDENT lpi = (lpiChosenByClick) ? lpiChosenByClick : lpiRepresentedByWindow;
80 if (lpi && lpi->fIsCell())
86 if (iTab == tabSERVICES)
87 ShowColumnsDialog (hDialog, &gr.viewSvc);
88 else if (iTab == tabAGGREGATES)
89 ShowColumnsDialog (hDialog, &gr.viewAgg);
90 else if (iTab == tabFILESETS)
91 ShowColumnsDialog (hDialog, &gr.viewSet);
93 ShowColumnsDialog (hDialog, NULL);
96 case M_SVR_VIEW_ONEICON:
97 case M_SVR_VIEW_TWOICONS:
98 case M_SVR_VIEW_STATUS:
99 Command_OnIconView (hDialog, TRUE, iTab, cmd);
103 case M_VIEW_TWOICONS:
105 Command_OnIconView (hDialog, FALSE, iTab, cmd);
110 Command_OnProperties (lpi);
119 StartTask (taskREFRESH, NULL, g.lpiCell);
124 StartTask (taskREFRESH, NULL, lpi);
126 StartTask (taskREFRESH, NULL, g.lpiCell);
131 Server_SyncVLDB (lpi);
136 Server_Salvage (lpi);
140 Filesets_Create (lpi);
143 case M_SET_REPLICATION:
144 if (lpi && lpi->fIsFileset())
145 Filesets_ShowReplication (Server_GetWindowForChild (hDialog), lpi);
149 if (lpi && lpi->fIsFileset())
150 Filesets_Delete (lpi);
154 Filesets_Clone (lpi);
158 if (lpi && lpi->fIsFileset())
163 Filesets_Restore (lpi);
167 if (lpi && lpi->fIsFileset())
168 Filesets_Release (lpi);
172 if (lpi && lpi->fIsFileset())
173 Filesets_ShowMoveTo (lpi, NULL);
177 if (lpi && lpi->fIsFileset())
178 Filesets_SetQuota (lpi);
182 if (lpi && lpi->fIsFileset())
183 StartTask (taskSET_LOCK, NULL, lpi);
187 if (lpi && !lpi->fIsService())
188 StartTask (taskSET_UNLOCK, NULL, lpi);
189 else if (!lpi && g.lpiCell)
190 StartTask (taskSET_UNLOCK, NULL, g.lpiCell);
194 if (lpi && lpi->fIsFileset())
195 Filesets_ShowRename (lpi);
199 if (lpi && lpi->fIsServer())
200 StartTask (taskSVR_GETWINDOWPOS, g.hMain, lpi);
204 if (lpi && lpi->fIsServer())
209 Server_CloseAll (TRUE);
213 Server_Security (lpi);
221 Server_Install (lpi);
224 case M_SVR_UNINSTALL:
225 Server_Uninstall (lpi);
233 Server_GetDates (lpi);
237 Server_Execute (lpi);
241 if (lpi && lpi->fIsService())
242 Services_ShowServiceLog (lpi);
244 Services_ShowServerLog (lpi);
248 if (lpi && lpi->fIsServer())
249 StartTask (taskSVR_MONITOR_ONOFF, NULL, lpi);
254 Services_Create (NULL);
256 Services_Create (lpi->GetServer());
260 if (lpi && lpi->fIsService())
261 Services_Delete (lpi);
265 if (lpi && lpi->fIsService())
266 Services_Start (lpi);
270 if (lpi && lpi->fIsService())
275 if (lpi && lpi->fIsService())
276 Services_Restart (lpi);
292 WinHelp (g.hMain, cszHELPFILENAME, HELP_FINDER, 0);
310 void Command_OnProperties (LPIDENT lpi)
314 size_t nAlerts = Alert_GetCount (lpi);
316 if (lpi->fIsServer())
318 Server_ShowProperties (lpi, nAlerts);
320 else if (lpi->fIsService())
322 Services_ShowProperties (lpi, nAlerts);
324 else if (lpi->fIsAggregate())
326 Aggregates_ShowProperties (lpi, nAlerts);
328 else if (lpi->fIsFileset())
330 Filesets_ShowProperties (lpi, nAlerts);
336 void Command_OnIconView (HWND hDialog, BOOL fServerView, CHILDTAB iTab, int cmd)
338 ICONVIEW *piv = NULL;
344 else if (iTab == tabAGGREGATES)
348 else if (iTab == tabSERVICES)
352 else if (iTab == tabFILESETS)
360 case M_SVR_VIEW_TWOICONS:
361 case M_VIEW_TWOICONS:
365 case M_SVR_VIEW_STATUS:
370 case M_SVR_VIEW_ONEICON:
379 UpdateDisplay_SetIconView (FALSE, hDialog, piv, iv);
383 Main_SetServerViewMenus();