Commit 6b9889c5 6b9889c56109c640a8d49a78e0b70f64b90b8b2b by root

save

1 parent 1ca3c925
Showing 24 changed files with 134 additions and 80 deletions
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
136 <dependency> 136 <dependency>
137 <groupId>org.emercit</groupId> 137 <groupId>org.emercit</groupId>
138 <artifactId>utilstools</artifactId> 138 <artifactId>utilstools</artifactId>
139 <version>1.10</version> 139 <version>1.12</version>
140 </dependency> 140 </dependency>
141 141
142 </dependencies> 142 </dependencies>
......
1 0c831cca0c5124f3ffc71777c3dcdcf2
...\ No newline at end of file ...\ No newline at end of file
1 ce9b7ffbd258e08f0e98899ddc7ce98cb796c020
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4 <modelVersion>4.0.0</modelVersion>
5 <groupId>org.emercit</groupId>
6 <artifactId>utilstools</artifactId>
7 <version>1.11</version>
8 </project>
1 94176b3faae2e97402e3986207289b36
...\ No newline at end of file ...\ No newline at end of file
1 38e64ab16233d080a796113e2609c7234cbc0ca0
...\ No newline at end of file ...\ No newline at end of file
1 528d24e7e4a499f3ffd53b20f37c1d6e
...\ No newline at end of file ...\ No newline at end of file
1 04c21c2a5e86f843cd60cd939caee1a12d5f75b4
...\ No newline at end of file ...\ No newline at end of file
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4 <modelVersion>4.0.0</modelVersion>
5 <groupId>org.emercit</groupId>
6 <artifactId>utilstools</artifactId>
7 <version>1.12</version>
8 </project>
1 29a1c8d26c4092087916fac887980824
...\ No newline at end of file ...\ No newline at end of file
1 bf0822135245c634ab3f2d4789fd0a1238a10492
...\ No newline at end of file ...\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
3 <groupId>org.emercit</groupId> 3 <groupId>org.emercit</groupId>
4 <artifactId>utilstools</artifactId> 4 <artifactId>utilstools</artifactId>
5 <versioning> 5 <versioning>
6 <release>1.10</release> 6 <release>1.12</release>
7 <versions> 7 <versions>
8 <version>1.0</version> 8 <version>1.0</version>
9 <version>1.1</version> 9 <version>1.1</version>
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
16 <version>1.8</version> 16 <version>1.8</version>
17 <version>1.9</version> 17 <version>1.9</version>
18 <version>1.10</version> 18 <version>1.10</version>
19 <version>1.11</version>
20 <version>1.12</version>
19 </versions> 21 </versions>
20 <lastUpdated>20150730104601</lastUpdated> 22 <lastUpdated>20150730124043</lastUpdated>
21 </versioning> 23 </versioning>
22 </metadata> 24 </metadata>
......
1 9d106f7b79ae181205c9a30243b5a016
...\ No newline at end of file ...\ No newline at end of file
1 783d946983428dd9e3aa55dbcc953fce
...\ No newline at end of file ...\ No newline at end of file
......
1 b525ea5f10b108b6840c20968146c6608b40168c
...\ No newline at end of file ...\ No newline at end of file
1 916946b4b7029a982ce5dfcef1f086ac89c62019
...\ No newline at end of file ...\ No newline at end of file
......
1 package org.emercit.devtools.service;
2 import org.emercit.model.IPAddressValidator;
3 import java.util.Vector;
4 import org.emercit.svmanager.service.Sv;
5 import org.emercit.svmanager.service.SvControl;
6 import org.emercit.svmanager.model.SvBean;
7 import java.util.Vector;
8
9 import org.emercit.pckutils.checkservice.STService;
10 import org.emercit.utilstools.config.Paths;
11
12 public enum SvService {
13
14 INSTANCE;
15
16
17 private Sv sv=new Sv();
18
19 private Vector<SvBean> svbeans;
20
21 private SvBean svbean;
22
23 private SvControl svcontrol;
24
25 private STService st=new STService();
26
27
28 /*
29 * Список все процессов, которыми управляем
30 */
31 public Vector<SvBean> getSvBeans() {
32
33 svbeans=new Vector<SvBean>();
34
35 for (SvBean s:svbeans) { // проверяем запущен или остановлен
36 try { s.setIsrun(st.IsRun(s.getProcess())); } catch (Exception e) {};
37 }
38
39 return svbeans;
40 }
41
42 /*
43 *
44 */
45 public int Update(Vector<SvBean> beans) {
46
47 return sv.set(beans);
48 }
49
50 public int Start(SvBean svbean) {
51
52 svcontrol=new SvControl(svbean.getProcess());
53 return svcontrol.start();
54 }
55
56 public int Stop(SvBean svbean) {
57
58 svcontrol=new SvControl(svbean.getProcess());
59 return svcontrol.stop();
60 }
61
62
63 public int Restart(SvBean svbean) {
64 svcontrol=new SvControl(svbean.getProcess());
65 return svcontrol.restart();
66 }
67
68
69
70
71
72
73
74
75
76 }
...\ No newline at end of file ...\ No newline at end of file
...@@ -2,22 +2,8 @@ ...@@ -2,22 +2,8 @@
2 Ext.define('App.view.Log', { 2 Ext.define('App.view.Log', {
3 extend : 'Ext.form.Panel', 3 extend : 'Ext.form.Panel',
4 xtype : 'mvvm-LogView', 4 xtype : 'mvvm-LogView',
5 alias: 'widget.showPreview', 5 layout: 'fit',
6 // renderTo: document.body,
7 /*
8 layout: {
9 type: 'vbox',
10 align: 'stretch'
11 },
12 */
13
14 layout: 'fit',
15
16 height: 400, 6 height: 400,
17 // width : 600,
18
19 // title : 'MyPanel',
20
21 initComponent: function() { 7 initComponent: function() {
22 Ext.apply(this, { 8 Ext.apply(this, {
23 9
...@@ -39,60 +25,18 @@ Ext.define('App.view.Log', { ...@@ -39,60 +25,18 @@ Ext.define('App.view.Log', {
39 25
40 26
41 items: [ 27 items: [
42 28 {
43 { 29 xtype : 'textareafield',
44 xtype : 'textareafield', 30 id:'logResult',
45 //grow : true, 31 readOnly : true,
46 id:'logResult', 32 }
47 readOnly : true,
48 // height: 300,
49 // anchor: '100%'
50
51 }
52
53
54 // {
55 // xtype: 'textareafield',
56 // itemId: 'txtFld',
57 // border: false,
58 //height: 660,
59 //width: 370,
60 //autoScroll: true,
61 // margin: '0 10 10 10',
62 //hidden: true
63 // }
64
65 ], 33 ],
66 34
67
68
69 }); 35 });
70 this.callParent(arguments); 36 this.callParent(arguments);
71 } 37 }
72 }); 38 });
73 39
74 /*
75 Ext.application({
76 name: 'Fiddle',
77
78 launch: function() {
79
80 var textarea,
81 ipsum = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum";
82
83 var preview = Ext.create('Test.view.ShowPreview', {
84 renderTo: Ext.getBody()
85 });
86
87 textarea = preview.down('#txtFld');
88 textarea.setValue(ipsum+ipsum);
89 }
90 });
91
92
93 */
94
95
96 40
97 41
98 42
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -69,7 +69,7 @@ public class DnsLinux implements IDns{ ...@@ -69,7 +69,7 @@ public class DnsLinux implements IDns{
69 dbs.add(db); 69 dbs.add(db);
70 i++; 70 i++;
71 } 71 }
72 log.info(Msg.LoadFileSucc); 72 //log.info(Msg.LoadFileSucc.getDescription());
73 } catch(Exception e) { 73 } catch(Exception e) {
74 log.error(e.getMessage()); 74 log.error(e.getMessage());
75 } 75 }
...@@ -98,7 +98,7 @@ public class DnsLinux implements IDns{ ...@@ -98,7 +98,7 @@ public class DnsLinux implements IDns{
98 } 98 }
99 99
100 bw.close(); 100 bw.close();
101 log.info(Msg.SaveFileSucc.getDescription()); 101 //log.info(Msg.SaveFileSucc.getDescription());
102 return Msg.SaveFileSucc.getCode(); 102 return Msg.SaveFileSucc.getCode();
103 103
104 } catch (IOException e) { 104 } catch (IOException e) {
......
...@@ -62,7 +62,7 @@ public class NtpLinux implements INtp { ...@@ -62,7 +62,7 @@ public class NtpLinux implements INtp {
62 62
63 bw.close(); 63 bw.close();
64 64
65 log.info(Msg.SaveFileSucc.getDescription()); 65 //log.info(Msg.SaveFileSucc.getDescription());
66 } catch (IOException e) { 66 } catch (IOException e) {
67 log.error(e.getMessage()); 67 log.error(e.getMessage());
68 return Msg.SaveFileError.getCode(); 68 return Msg.SaveFileError.getCode();
......
...@@ -13,18 +13,15 @@ public class Sv { ...@@ -13,18 +13,15 @@ public class Sv {
13 public Db db=new Db(Paths.BEAN_SV); 13 public Db db=new Db(Paths.BEAN_SV);
14 14
15 private SvBean svbean; 15 private SvBean svbean;
16
17 private Vector<SvBean> svbeans; 16 private Vector<SvBean> svbeans;
18 17
19 private SvControl svcontrol; 18 private SvControl svcontrol;
20 19
21 public int set(Vector<SvBean> m) { 20 public int set(Vector<SvBean> m) {
22
23 return db.create(m); 21 return db.create(m);
24 } 22 }
25 23
26 public Vector<SvBean> get() { 24 public Vector<SvBean> get() {
27
28 return (Vector<SvBean>)db.select(); 25 return (Vector<SvBean>)db.select();
29 } 26 }
30 27
......
...@@ -5,12 +5,17 @@ import org.emercit.pckutils.cmd.CmdExec; ...@@ -5,12 +5,17 @@ import org.emercit.pckutils.cmd.CmdExec;
5 import org.emercit.utilstools.config.Paths; 5 import org.emercit.utilstools.config.Paths;
6 import org.emercit.utilstools.config.Msg; 6 import org.emercit.utilstools.config.Msg;
7 7
8 import org.emercit.pckutils.checkservice.STService;
9
8 public class SvControl implements ISvControl { 10 public class SvControl implements ISvControl {
9 11
10 private CmdExec cmdexec=new CmdExec(); 12 private CmdExec cmdexec=new CmdExec();
11 13
14 private STService st=new STService();
15
12 private String process; 16 private String process;
13 17
18
14 public SvControl(String process) { 19 public SvControl(String process) {
15 20
16 this.process=process; 21 this.process=process;
...@@ -18,8 +23,14 @@ public class SvControl implements ISvControl { ...@@ -18,8 +23,14 @@ public class SvControl implements ISvControl {
18 23
19 public int stop() { 24 public int stop() {
20 25
21 try { cmdexec.Run(Paths.dirInit_d+" "+process+" "+"stop"); }catch(Exception e) { return Msg.ProcessStopError.getCode(); }; 26 try {
22 27 cmdexec.Run(Paths.dirInit_d+" "+process+" "+"stop");
28
29
30 }catch(Exception e)
31 {
32 return Msg.ProcessStopError.getCode();
33 };
23 return Msg.ProcessStopSucc.getCode(); 34 return Msg.ProcessStopSucc.getCode();
24 } 35 }
25 36
......
...@@ -7,8 +7,8 @@ import org.emercit.utilstools.config.MsgResult; ...@@ -7,8 +7,8 @@ import org.emercit.utilstools.config.MsgResult;
7 7
8 public enum Msg { 8 public enum Msg {
9 9
10 SaveFileSucc(1,TypeMsg.INFO,"Выполнено сохранение файла"), 10 SaveFileSucc(1,TypeMsg.INFO,"Сохранение успешно выполнено"),
11 SaveFileError(2,TypeMsg.ERROR,"Сохранение файла не выполнено"), 11 SaveFileError(2,TypeMsg.ERROR,"Ошибка при сохранении"),
12 12
13 LoadFileSucc(3,TypeMsg.INFO,"Чтение файла выполнено"), 13 LoadFileSucc(3,TypeMsg.INFO,"Чтение файла выполнено"),
14 LoadFileError(4,TypeMsg.ERROR,"Ошибка чтения файла"), 14 LoadFileError(4,TypeMsg.ERROR,"Ошибка чтения файла"),
......
...@@ -35,7 +35,7 @@ public class Db implements IDb { ...@@ -35,7 +35,7 @@ public class Db implements IDb {
35 XMLEncoder xmlEncoder = new XMLEncoder(bos); 35 XMLEncoder xmlEncoder = new XMLEncoder(bos);
36 xmlEncoder.writeObject(o); 36 xmlEncoder.writeObject(o);
37 xmlEncoder.close(); 37 xmlEncoder.close();
38 log.info(Msg.SaveFileSucc.getDescription()); 38 //log.info(Msg.SaveFileSucc.getDescription());
39 }catch(Exception e) { 39 }catch(Exception e) {
40 log.error(e.getMessage()); 40 log.error(e.getMessage());
41 return Msg.SaveFileError.getCode(); 41 return Msg.SaveFileError.getCode();
...@@ -55,7 +55,7 @@ public class Db implements IDb { ...@@ -55,7 +55,7 @@ public class Db implements IDb {
55 new FileInputStream(pathfile))); 55 new FileInputStream(pathfile)));
56 Object result=(Object)d.readObject(); 56 Object result=(Object)d.readObject();
57 d.close(); 57 d.close();
58 log.info(Msg.LoadFileSucc.getDescription()); 58 //log.info(Msg.LoadFileSucc.getDescription());
59 return result; 59 return result;
60 }catch(Exception e) { 60 }catch(Exception e) {
61 log.error(e.getMessage()); 61 log.error(e.getMessage());
......