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 <afs/param.h>
27 #include "svr_window.h"
28 #include "svr_security.h"
29 #include "svr_syncvldb.h"
30 #include "svr_salvage.h"
31 #include "svc_create.h"
32 #include "svc_delete.h"
33 #include "svc_startstop.h"
34 #include "svc_viewlog.h"
36 #include "svr_install.h"
37 #include "svr_uninstall.h"
38 #include "svr_prune.h"
39 #include "svr_getdates.h"
40 #include "svr_execute.h"
41 #include "svr_hosts.h"
45 #include "set_repprop.h"
46 #include "set_create.h"
47 #include "set_delete.h"
49 #include "set_quota.h"
50 #include "set_rename.h"
51 #include "set_release.h"
52 #include "set_clone.h"
54 #include "set_restore.h"
58 * PROTOTYPES _________________________________________________________________
62 void Command_OnProperties (LPIDENT lpi);
63 void Command_OnIconView (HWND hDialog, BOOL fServerView, CHILDTAB iTab, int cmd);
67 * ROUTINES ___________________________________________________________________
71 void StartContextCommand (HWND hDialog,
72 LPIDENT lpiRepresentedByWindow,
73 LPIDENT lpiChosenByClick,
76 CHILDTAB iTab = Server_GetDisplayedTab (hDialog);
77 LPIDENT lpi = (lpiChosenByClick) ? lpiChosenByClick : lpiRepresentedByWindow;
79 if (lpi && lpi->fIsCell())
85 if (iTab == tabSERVICES)
86 ShowColumnsDialog (hDialog, &gr.viewSvc);
87 else if (iTab == tabAGGREGATES)
88 ShowColumnsDialog (hDialog, &gr.viewAgg);
89 else if (iTab == tabFILESETS)
90 ShowColumnsDialog (hDialog, &gr.viewSet);
92 ShowColumnsDialog (hDialog, NULL);
95 case M_SVR_VIEW_ONEICON:
96 case M_SVR_VIEW_TWOICONS:
97 case M_SVR_VIEW_STATUS:
98 Command_OnIconView (hDialog, TRUE, iTab, cmd);
102 case M_VIEW_TWOICONS:
104 Command_OnIconView (hDialog, FALSE, iTab, cmd);
109 Command_OnProperties (lpi);
118 StartTask (taskREFRESH, NULL, g.lpiCell);
123 StartTask (taskREFRESH, NULL, lpi);
125 StartTask (taskREFRESH, NULL, g.lpiCell);
130 Server_SyncVLDB (lpi);
135 Server_Salvage (lpi);
139 Filesets_Create (lpi);
142 case M_SET_REPLICATION:
143 if (lpi && lpi->fIsFileset())
144 Filesets_ShowReplication (Server_GetWindowForChild (hDialog), lpi);
148 if (lpi && lpi->fIsFileset())
149 Filesets_Delete (lpi);
153 Filesets_Clone (lpi);
157 if (lpi && lpi->fIsFileset())
162 Filesets_Restore (lpi);
166 if (lpi && lpi->fIsFileset())
167 Filesets_Release (lpi);
171 if (lpi && lpi->fIsFileset())
172 Filesets_ShowMoveTo (lpi, NULL);
176 if (lpi && lpi->fIsFileset())
177 Filesets_SetQuota (lpi);
181 if (lpi && lpi->fIsFileset())
182 StartTask (taskSET_LOCK, NULL, lpi);
186 if (lpi && !lpi->fIsService())
187 StartTask (taskSET_UNLOCK, NULL, lpi);
188 else if (!lpi && g.lpiCell)
189 StartTask (taskSET_UNLOCK, NULL, g.lpiCell);
193 if (lpi && lpi->fIsFileset())
194 Filesets_ShowRename (lpi);
198 if (lpi && lpi->fIsServer())
199 StartTask (taskSVR_GETWINDOWPOS, g.hMain, lpi);
203 if (lpi && lpi->fIsServer())
208 Server_CloseAll (TRUE);
212 Server_Security (lpi);
220 Server_Install (lpi);
223 case M_SVR_UNINSTALL:
224 Server_Uninstall (lpi);
232 Server_GetDates (lpi);
236 Server_Execute (lpi);
240 if (lpi && lpi->fIsService())
241 Services_ShowServiceLog (lpi);
243 Services_ShowServerLog (lpi);
247 if (lpi && lpi->fIsServer())
248 StartTask (taskSVR_MONITOR_ONOFF, NULL, lpi);
253 Services_Create (NULL);
255 Services_Create (lpi->GetServer());
259 if (lpi && lpi->fIsService())
260 Services_Delete (lpi);
264 if (lpi && lpi->fIsService())
265 Services_Start (lpi);
269 if (lpi && lpi->fIsService())
274 if (lpi && lpi->fIsService())
275 Services_Restart (lpi);
291 WinHelp (g.hMain, cszHELPFILENAME, HELP_FINDER, 0);
309 void Command_OnProperties (LPIDENT lpi)
313 size_t nAlerts = Alert_GetCount (lpi);
315 if (lpi->fIsServer())
317 Server_ShowProperties (lpi, nAlerts);
319 else if (lpi->fIsService())
321 Services_ShowProperties (lpi, nAlerts);
323 else if (lpi->fIsAggregate())
325 Aggregates_ShowProperties (lpi, nAlerts);
327 else if (lpi->fIsFileset())
329 Filesets_ShowProperties (lpi, nAlerts);
335 void Command_OnIconView (HWND hDialog, BOOL fServerView, CHILDTAB iTab, int cmd)
337 ICONVIEW *piv = NULL;
343 else if (iTab == tabAGGREGATES)
347 else if (iTab == tabSERVICES)
351 else if (iTab == tabFILESETS)
359 case M_SVR_VIEW_TWOICONS:
360 case M_VIEW_TWOICONS:
364 case M_SVR_VIEW_STATUS:
369 case M_SVR_VIEW_ONEICON:
378 UpdateDisplay_SetIconView (FALSE, hDialog, piv, iv);
382 Main_SetServerViewMenus();