mm_os 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/lib/app.js +50 -0
- package/package.json +1 -1
package/index.js
CHANGED
package/lib/app.js
CHANGED
|
@@ -63,6 +63,36 @@ App.prototype.initApp = async function() {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* 启动应用
|
|
68
|
+
*/
|
|
69
|
+
App.prototype.startApp = async function() {
|
|
70
|
+
for (var k in this.dict) {
|
|
71
|
+
var o = this.dict[k];
|
|
72
|
+
try {
|
|
73
|
+
o.state = 1;
|
|
74
|
+
await o.run('start');
|
|
75
|
+
} catch (e) {
|
|
76
|
+
$.log.error("启动应用错误", e);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 停止应用
|
|
83
|
+
*/
|
|
84
|
+
App.prototype.stopApp = async function() {
|
|
85
|
+
for (var k in this.dict) {
|
|
86
|
+
var o = this.dict[k];
|
|
87
|
+
try {
|
|
88
|
+
o.state = 0;
|
|
89
|
+
await o.run('stop');
|
|
90
|
+
} catch (e) {
|
|
91
|
+
$.log.error("停止应用错误", e);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
66
96
|
/**
|
|
67
97
|
* 安装应用
|
|
68
98
|
*/
|
|
@@ -70,4 +100,24 @@ App.prototype.install = async function(name, ...args) {
|
|
|
70
100
|
return await this.exec(name, 'install', ...args);
|
|
71
101
|
}
|
|
72
102
|
|
|
103
|
+
/**
|
|
104
|
+
* 卸载
|
|
105
|
+
*/
|
|
106
|
+
App.prototype.uninstall = async function(name, ...args) {
|
|
107
|
+
return await this.exec(name, 'uninstall', ...args);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* 启动
|
|
112
|
+
*/
|
|
113
|
+
App.prototype.start = async function(name, ...args) {
|
|
114
|
+
return await this.exec(name, 'start', ...args);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* 停止
|
|
119
|
+
*/
|
|
120
|
+
App.prototype.stop = async function(name, ...args) {
|
|
121
|
+
return await this.exec(name, 'stop', ...args);
|
|
122
|
+
}
|
|
73
123
|
module.exports = App;
|