コード例 #1
0
        static public void ShowSummaryInfo(JCompDeviceStorage storage)
        {
            StringBuilder str = new StringBuilder();

            str.Append(ModelHelper.ModelPropertyList(storage, "<br/>", null, null));

            //str.Append(phone.Number);
            AppendBr(str);
            AppendBr(str);
            str.Append(storage.Name);
            AppendBr(str);
            AppendBr(str);
            if (storage.JCompDevice != null && storage.JCompDevice.Description != null)
            {
                AppendBr(str);
                str.Append(storage.JCompDevice.Name + storage.JCompDevice.GetInternalAddress());
                AppendBr(str);
                str.Append(storage.JCompDevice.Description);
                AppendBr(str);
            }

            if (!string.IsNullOrEmpty(storage.SambaName))
            {
                AppendBr(str);
                str.Append("Samba config for server");
                AppendBr(str);
                str.Append("<pre>");
                str.Append(HttpUtility.HtmlEncode(JCompDeviceStorage.MakeSambaConfigBlock(storage)));
                str.Append("</pre>");
                str.Append("Samba prepare for client");
                AppendBr(str);
                str.Append("<pre>");

                if (storage.JCompDevice != null && !string.IsNullOrEmpty(storage.JCompDevice.GetInternalAddress()))
                {
                    str.Append(HttpUtility.HtmlEncode(JCompDeviceStorage.MakeSambaClientPrepareScript(storage)));
                    str.Append("</pre>");
                    str.Append("Samba connect for client (/etc/init.d/rc.local)");
                    AppendBr(str);
                    str.Append("<pre>");
                    str.Append(HttpUtility.HtmlEncode(JCompDeviceStorage.MakeSambaClientConnectScript(storage)));
                    str.Append("</pre>");
                    str.Append("Samba connect for client fstab (/etc/fstab )");
                    AppendBr(str);
                    str.Append("<pre>");
                    str.Append(HttpUtility.HtmlEncode(JCompDeviceStorage.MakeSambaClientConnectFstabScript(storage)));
                    str.Append("</pre>");
                }
            }

            if (!string.IsNullOrEmpty(storage.DevicePath))
            {
                AppendBr(str);
                str.Append("Cкрипт монтирования физического устройства");
                AppendBr(str);
                str.Append("<pre>");
                str.Append(HttpUtility.HtmlEncode(JCompDeviceStorage.MakeMountScript(storage)));
                str.Append("</pre>");
                AppendBr(str);
                str.Append("Cкрипт размонтирования физического устройства");
                AppendBr(str);
                str.Append("<pre>");
                str.Append(HttpUtility.HtmlEncode(JCompDeviceStorage.MakeUnMountScript(storage)));
                str.Append("</pre>");
            }


            if (storage.MasterStorage != null)
            {
                JCompDeviceStorage master = storage.MasterStorage;
                AppendBr(str);
                str.Append("Синхронизация односторонняя. Файлы, которых нет на базе, будут удалены на целевом. Файлы базы, которых нет на целевом, будут туда добавлены");
                AppendBr(str);


                str.Append("Основной скрипт синхронизации базы мастер хранилища (запускать на нем) \"" + master.JCompDevice.Name + "\"  c слейв-хранилищем   \"" + storage.JCompDevice.Name + "\" (добавить -n для теста)");
                AppendBr(str);
                str.Append("<pre>");
                str.Append(HttpUtility.HtmlEncode(JCompDeviceStorage.MakeRsyncScript(master, storage, false)));
                str.Append("</pre>");

                str.Append("Дополнительный скрипт синхронизации базы слейв хранилища (запускать на нем) \"" + storage.JCompDevice.Name + "\"  c мастер-хранилищем   \"" + master.JCompDevice.Name + "\" (добавить -n для теста)");
                AppendBr(str);
                str.Append("<pre>");
                str.Append(HttpUtility.HtmlEncode(JCompDeviceStorage.MakeRsyncScript(storage, master, false)));
                str.Append("</pre>");

                AppendBr(str);
            }

            SimpleHtmlTextEditDialog dlg = new SimpleHtmlTextEditDialog();

            dlg.EditedText = str.ToString();
            dlg.ShowDialog();
        }