DIRECTORY AlpineControl, AlpineIdentity, AlpineFTPCmds, Commander, File, LogBasic, Process, Rope, ViewRec, VolumeGroup; AlpineControlPanelImpl: CEDAR PROGRAM IMPORTS AlpineControl, AlpineFTPCmds, AlpineIdentity, Commander, File, LogBasic, Process, ViewRec, VolumeGroup EXPORTS ~ BEGIN Context: TYPE = RECORD[ panel: REF Panel _ NEW[Panel], volumes: ARRAY [0..3] OF File.Volume _ ALL[NIL], rv: ViewRec.RecordViewer]; Panel: TYPE = RECORD [ StartFTP: PROC RETURNS[result: Rope.ROPE] _ StartFTPProc, StopFTP: PROC RETURNS[result: Rope.ROPE] _ StopFTPProc, ExportInterfaces: PROC RETURNS[result: Rope.ROPE] _ ExportInterfacesProc, UnExportInterfaces: PROC RETURNS[result: Rope.ROPE] _ UnExportInterfacesProc, Shutdown: PROC RETURNS[result: Rope.ROPE] _ ShutdownProc, sampleDelay: CARDINAL _ 10, volumeInfo: ARRAY [0..3] OF RECORD [ name: Rope.ROPE _ NIL, totalSpace: LONG CARDINAL _ 0, freeSpace: LONG CARDINAL _ 0], logInfo: RECORD [ totalSize: LONG CARDINAL _ 0, spaceUsed: LONG CARDINAL _ 0, percentUsed: CARDINAL _ 0] ]; StartFTPProc: PROC [] RETURNS [result: Rope.ROPE] ~ { [msg: result] _ AlpineFTPCmds.StartAlpineFTPServer[ volGroup: AlpineIdentity.myFileStore ]; }; StopFTPProc: PROC [] RETURNS [result: Rope.ROPE] ~ { [msg: result] _ AlpineFTPCmds.StopAlpineFTPServer[ volGroup: AlpineIdentity.myFileStore ]; }; ExportInterfacesProc: PROC [] RETURNS [result: Rope.ROPE _ "done"] ~ TRUSTED { AlpineControl.ExportInterfaces[]; }; UnExportInterfacesProc: PROC [] RETURNS [result: Rope.ROPE _ "done"] ~ TRUSTED { AlpineControl.UnexportInterfaces[]; }; ShutdownProc: PROC [] RETURNS [result: Rope.ROPE _ "done"] ~ TRUSTED { [] _ AlpineControl.Halt[1]; }; MakeAlpineControlPanel: Commander.CommandProc = TRUSTED { context: REF Context _ NEW[Context]; panel: REF Panel _ context.panel; i: [0..4); volumeGroupID: VolumeGroup.VolumeGroupID _ VolumeGroup.GetNext[VolumeGroup.nullVolumeGroupID]; i _ 0; FOR volList: LIST OF VolumeGroup.VolumeID _ VolumeGroup.GetVolumes[volumeGroupID], volList.rest WHILE volList # NIL DO volume: File.Volume; context.volumes[i] _ volume _ File.FindVolumeFromID[volList.first]; [name: panel.volumeInfo[i].name, size: panel.volumeInfo[i].totalSpace] _ File.LogicalInfo[volume]; i _ i+1; ENDLOOP; panel.logInfo.totalSize _ LogBasic.LogFileSize[]; context.rv _ ViewRec.ViewRef[agg: panel, sample: FALSE, viewerInit: [name: AlpineIdentity.myFileStore]]; ViewRec.SetBehavior[ newBehavior: [[min: 10000, max:10000]] ]; TRUSTED { Process.Detach[ FORK Sampler[context] ] }; }; Sampler: PROC [context: REF Context] RETURNS [] ~ { panel: REF Panel _ context.panel; DO FOR i: [0..4) IN [0..4) DO IF context.volumes[i] # NIL THEN [free: panel.volumeInfo[i].freeSpace] _ File.LogicalInfo[context.volumes[i]]; ENDLOOP; TRUSTED {panel.logInfo.spaceUsed _ LogBasic.LogUsage[]}; panel.logInfo.percentUsed _ (100*panel.logInfo.spaceUsed) / panel.logInfo.totalSize; ViewRec.SampleRV[context.rv]; Process.Pause[Process.SecondsToTicks[panel.sampleDelay]]; ENDLOOP; }; Init: PROC [] RETURNS [] ~ { Commander.Register[ "///Commands/AlpineControlPanel", MakeAlpineControlPanel, "Makes a control viewer for the running Alpine Server"]; }; Init[]; END. AlpineControlPanelImpl.mesa Carl Hauser, April 17, 1986 8:38:33 am PST [cmd: REF CommandObject] RETURNS [result: REF _ NIL, msg: ROPE _ NIL] CommandObject = [ in, out, err: STREAM, commandLine, command: ROPE, propertyList: List.AList, procData: CommandProcHandle] Κν˜™Icode™*—šΟk ˜ Kšœ˜K˜K˜K˜ K˜K˜ K˜Kšœ˜Kšœ˜Kšœ ˜ —K˜Kšœœ˜%Kšœg˜nKšœ˜šœ˜K˜—šœ œœ˜Kšœœ œ˜Kš œ œœœœ˜0Kšœ˜K˜—šœœœ˜KšΟnœœœœ˜9Kšžœœœœ˜8Kšžœœœœ˜JKšžœœœœ˜NKšžœœœœ˜9Kšœ œ˜šœ œœœ˜$Kšœ œœ˜Kšœ œœ˜Kšœ  œ˜—šœ œ˜Kšœ œœ˜Kšœ œœ˜Kšœ œ˜—K˜K˜—šž œœœ˜5Kšœ[˜[K˜K˜—šž œœœ˜4KšœZ˜ZK˜K˜—šžœœœ œ˜NK˜!K˜—šžœœœ œ˜PK˜#K˜—šž œœœ œ˜FK˜K˜K˜—šΟbœœ˜9Jš œœœ œœœœ™Ešœ™Jšœœœ™1Jšœ6™6—Jšœ œ œ ˜$Jšœœ˜!J˜ Kšœ^˜^K˜š œ œœLœ œ˜vK˜KšœC˜CKšœb˜bK˜Kšœ˜—Kšœ1˜1J˜Kšœh˜hK˜>Kšœœ˜4—˜K˜K˜—šžœœ œ œ˜3Kšœœ˜!š˜šœ œ˜KšœœœN˜nKšœ˜—Kšœ1˜8KšœT˜TKšœ˜K˜9Kšœ˜—K˜K˜—šžœœœ˜K˜šœ˜Jšœ9˜9Jšœ8˜8—K˜K˜—K˜Kšœ˜—…— hc