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
11 #include <afs/param.h>
24 #include "svr_window.h"
25 #include "svr_security.h"
26 #include "svr_syncvldb.h"
27 #include "svr_salvage.h"
28 #include "svc_create.h"
29 #include "svc_delete.h"
30 #include "svc_startstop.h"
31 #include "svc_viewlog.h"
33 #include "svr_install.h"
34 #include "svr_uninstall.h"
35 #include "svr_prune.h"
36 #include "svr_getdates.h"
37 #include "svr_execute.h"
38 #include "svr_hosts.h"
42 #include "set_repprop.h"
43 #include "set_create.h"
44 #include "set_delete.h"
46 #include "set_quota.h"
47 #include "set_rename.h"
48 #include "set_release.h"
49 #include "set_clone.h"
51 #include "set_restore.h"
55 * PROTOTYPES _________________________________________________________________
59 void Command_OnProperties (LPIDENT lpi);
60 void Command_OnIconView (HWND hDialog, BOOL fServerView, CHILDTAB iTab, int cmd);
64 * ROUTINES ___________________________________________________________________
68 void StartContextCommand (HWND hDialog,
69 LPIDENT lpiRepresentedByWindow,
70 LPIDENT lpiChosenByClick,
73 CHILDTAB iTab = Server_GetDisplayedTab (hDialog);
74 LPIDENT lpi = (lpiChosenByClick) ? lpiChosenByClick : lpiRepresentedByWindow;
76 if (lpi && lpi->fIsCell())
82 if (iTab == tabSERVICES)
83 ShowColumnsDialog (hDialog, &gr.viewSvc);
84 else if (iTab == tabAGGREGATES)
85 ShowColumnsDialog (hDialog, &gr.viewAgg);
86 else if (iTab == tabFILESETS)
87 ShowColumnsDialog (hDialog, &gr.viewSet);
89 ShowColumnsDialog (hDialog, NULL);
92 case M_SVR_VIEW_ONEICON:
93 case M_SVR_VIEW_TWOICONS:
94 case M_SVR_VIEW_STATUS:
95 Command_OnIconView (hDialog, TRUE, iTab, cmd);
101 Command_OnIconView (hDialog, FALSE, iTab, cmd);
106 Command_OnProperties (lpi);
115 StartTask (taskREFRESH, NULL, g.lpiCell);
120 StartTask (taskREFRESH, NULL, lpi);
122 StartTask (taskREFRESH, NULL, g.lpiCell);
127 Server_SyncVLDB (lpi);
132 Server_Salvage (lpi);
136 Filesets_Create (lpi);
139 case M_SET_REPLICATION:
140 if (lpi && lpi->fIsFileset())
141 Filesets_ShowReplication (Server_GetWindowForChild (hDialog), lpi);
145 if (lpi && lpi->fIsFileset())
146 Filesets_Delete (lpi);
150 Filesets_Clone (lpi);
154 if (lpi && lpi->fIsFileset())
159 Filesets_Restore (lpi);
163 if (lpi && lpi->fIsFileset())
164 Filesets_Release (lpi);
168 if (lpi && lpi->fIsFileset())
169 Filesets_ShowMoveTo (lpi, NULL);
173 if (lpi && lpi->fIsFileset())
174 Filesets_SetQuota (lpi);
178 if (lpi && lpi->fIsFileset())
179 StartTask (taskSET_LOCK, NULL, lpi);
183 if (lpi && !lpi->fIsService())
184 StartTask (taskSET_UNLOCK, NULL, lpi);
185 else if (!lpi && g.lpiCell)
186 StartTask (taskSET_UNLOCK, NULL, g.lpiCell);
190 if (lpi && lpi->fIsFileset())
191 Filesets_ShowRename (lpi);
195 if (lpi && lpi->fIsServer())
196 StartTask (taskSVR_GETWINDOWPOS, g.hMain, lpi);
200 if (lpi && lpi->fIsServer())
205 Server_CloseAll (TRUE);
209 Server_Security (lpi);
217 Server_Install (lpi);
220 case M_SVR_UNINSTALL:
221 Server_Uninstall (lpi);
229 Server_GetDates (lpi);
233 Server_Execute (lpi);
237 if (lpi && lpi->fIsService())
238 Services_ShowServiceLog (lpi);
240 Services_ShowServerLog (lpi);
244 if (lpi && lpi->fIsServer())
245 StartTask (taskSVR_MONITOR_ONOFF, NULL, lpi);
250 Services_Create (NULL);
252 Services_Create (lpi->GetServer());
256 if (lpi && lpi->fIsService())
257 Services_Delete (lpi);
261 if (lpi && lpi->fIsService())
262 Services_Start (lpi);
266 if (lpi && lpi->fIsService())
271 if (lpi && lpi->fIsService())
272 Services_Restart (lpi);
288 WinHelp (g.hMain, cszHELPFILENAME, HELP_FINDER, 0);
306 void Command_OnProperties (LPIDENT lpi)
310 size_t nAlerts = Alert_GetCount (lpi);
312 if (lpi->fIsServer())
314 Server_ShowProperties (lpi, nAlerts);
316 else if (lpi->fIsService())
318 Services_ShowProperties (lpi, nAlerts);
320 else if (lpi->fIsAggregate())
322 Aggregates_ShowProperties (lpi, nAlerts);
324 else if (lpi->fIsFileset())
326 Filesets_ShowProperties (lpi, nAlerts);
332 void Command_OnIconView (HWND hDialog, BOOL fServerView, CHILDTAB iTab, int cmd)
334 ICONVIEW *piv = NULL;
340 else if (iTab == tabAGGREGATES)
344 else if (iTab == tabSERVICES)
348 else if (iTab == tabFILESETS)
356 case M_SVR_VIEW_TWOICONS:
357 case M_VIEW_TWOICONS:
361 case M_SVR_VIEW_STATUS:
366 case M_SVR_VIEW_ONEICON:
375 UpdateDisplay_SetIconView (FALSE, hDialog, piv, iv);
379 Main_SetServerViewMenus();