Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
barry cho
Jpom
Commits
298da462
Commit
298da462
authored
3 years ago
by
bwcx_jzy
Browse files
Options
Download
Email Patches
Plain Diff
fix 2.8.0
parent
799ee13b
master
change-tab
dev
v2.8.16
v2.8.15
v2.8.14
v2.8.13
v2.8.12
v2.8.11
v2.8.10
v2.8.9
v2.8.8
v2.8.7
v2.8.6
v2.8.5
v2.8.4
v2.8.3
v2.8.2
v2.8.1
v2.8.0-fix
fix-2.8.0
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
modules/agent/src/main/java/io/jpom/controller/IndexController.java
+2
-7
...ent/src/main/java/io/jpom/controller/IndexController.java
modules/server/src/main/java/io/jpom/system/init/InitDb.java
+5
-3
modules/server/src/main/java/io/jpom/system/init/InitDb.java
modules/server/src/main/java/io/jpom/system/init/LoadJsonConfigToDb.java
+3
-16
...src/main/java/io/jpom/system/init/LoadJsonConfigToDb.java
web-vue/src/components/upgrade/index.vue
+10
-12
web-vue/src/components/upgrade/index.vue
with
20 additions
and
38 deletions
+20
-38
modules/agent/src/main/java/io/jpom/controller/IndexController.java
+
2
-
7
View file @
298da462
...
...
@@ -63,19 +63,14 @@ public class IndexController extends BaseAgentController {
@RequestMapping
(
value
=
"info"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
String
info
()
{
int
code
;
if
(
whitelistDirectoryService
.
isInstalled
())
{
code
=
200
;
}
else
{
code
=
201
;
}
JpomManifest
instance
=
JpomManifest
.
getInstance
();
RemoteVersion
remoteVersion
=
RemoteVersion
.
cacheInfo
();
//
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"manifest"
,
instance
);
jsonObject
.
put
(
"remoteVersion"
,
remoteVersion
);
return
JsonMessage
.
getString
(
code
,
""
,
jsonObject
);
return
JsonMessage
.
getString
(
200
,
""
,
jsonObject
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
modules/server/src/main/java/io/jpom/system/init/InitDb.java
+
5
-
3
View file @
298da462
...
...
@@ -158,13 +158,15 @@ public class InitDb implements DisposableBean, InitializingBean {
LoadBuildJsonToDB
.
getInstance
().
doJsonToSql
();
// @author bwcx_jzy @date 2021-12-02
LoadJsonConfigToDb
instance
=
LoadJsonConfigToDb
.
getInstance
();
instance
.
loadIpConfig
();
instance
.
loadMailConfig
();
instance
.
loadOutGivingWhitelistConfig
();
// init workspace
WorkspaceService
workspaceService
=
SpringUtil
.
getBean
(
WorkspaceService
.
class
);
try
{
BaseServerController
.
resetInfo
(
UserModel
.
EMPTY
);
//
instance
.
loadIpConfig
();
instance
.
loadMailConfig
();
instance
.
loadOutGivingWhitelistConfig
();
//
instance
.
loadUserInfo
();
workspaceService
.
checkInitDefault
();
//
...
...
This diff is collapsed.
Click to expand it.
modules/server/src/main/java/io/jpom/system/init/LoadJsonConfigToDb.java
+
3
-
16
View file @
298da462
...
...
@@ -33,7 +33,6 @@ import cn.jiangzeyin.common.spring.SpringUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
io.jpom.common.BaseServerController
;
import
io.jpom.model.data.*
;
import
io.jpom.model.log.MonitorNotifyLog
;
import
io.jpom.service.dblog.DbMonitorNotifyLogService
;
...
...
@@ -151,7 +150,6 @@ public class LoadJsonConfigToDb {
return
;
}
try
{
BaseServerController
.
resetInfo
(
UserModel
.
EMPTY
);
JSON
json
=
JsonFileUtil
.
readJson
(
file
.
getAbsolutePath
());
JSONArray
jsonArray
=
JsonFileUtil
.
formatToArray
((
JSONObject
)
json
);
List
<
UserModel
>
userModels
=
jsonArray
.
toJavaList
(
UserModel
.
class
);
...
...
@@ -174,8 +172,6 @@ public class LoadJsonConfigToDb {
DefaultSystemLog
.
getLog
().
info
(
"{} mv to {}"
,
FileUtil
.
getAbsolutePath
(
file
),
FileUtil
.
getAbsolutePath
(
backupOldData
));
}
catch
(
Exception
e
)
{
DefaultSystemLog
.
getLog
().
error
(
"load user info error "
,
e
);
}
finally
{
BaseServerController
.
remove
();
}
}
...
...
@@ -197,7 +193,7 @@ public class LoadJsonConfigToDb {
//
nodeModel
.
setProtocol
(
StrUtil
.
emptyToDefault
(
nodeModel
.
getProtocol
(),
"http"
));
}).
collect
(
Collectors
.
toList
());
BaseServerController
.
resetInfo
(
UserModel
.
EMPTY
);
NodeService
nodeService
=
SpringUtil
.
getBean
(
NodeService
.
class
);
nodeService
.
insert
(
nodeModels
);
// 将 json 文件转移到备份目录
...
...
@@ -205,8 +201,6 @@ public class LoadJsonConfigToDb {
DefaultSystemLog
.
getLog
().
info
(
"{} mv to {}"
,
FileUtil
.
getAbsolutePath
(
file
),
FileUtil
.
getAbsolutePath
(
backupOldData
));
}
catch
(
Exception
e
)
{
DefaultSystemLog
.
getLog
().
error
(
"load node error "
,
e
);
}
finally
{
BaseServerController
.
remove
();
}
}
...
...
@@ -224,7 +218,6 @@ public class LoadJsonConfigToDb {
if
(
sshModels
==
null
)
{
return
;
}
BaseServerController
.
resetInfo
(
UserModel
.
EMPTY
);
SshService
sshService
=
SpringUtil
.
getBean
(
SshService
.
class
);
sshService
.
insert
(
sshModels
);
// 将 json 文件转移到备份目录
...
...
@@ -232,8 +225,6 @@ public class LoadJsonConfigToDb {
DefaultSystemLog
.
getLog
().
info
(
"{} mv to {}"
,
FileUtil
.
getAbsolutePath
(
file
),
FileUtil
.
getAbsolutePath
(
backupOldData
));
}
catch
(
Exception
e
)
{
DefaultSystemLog
.
getLog
().
error
(
"load ssh error "
,
e
);
}
finally
{
BaseServerController
.
remove
();
}
}
...
...
@@ -251,7 +242,7 @@ public class LoadJsonConfigToDb {
if
(
monitorModels
==
null
)
{
return
;
}
BaseServerController
.
resetInfo
(
UserModel
.
EMPTY
);
MonitorService
monitorService
=
SpringUtil
.
getBean
(
MonitorService
.
class
);
monitorService
.
insert
(
monitorModels
);
// 将 json 文件转移到备份目录
...
...
@@ -259,8 +250,6 @@ public class LoadJsonConfigToDb {
DefaultSystemLog
.
getLog
().
info
(
"{} mv to {}"
,
FileUtil
.
getAbsolutePath
(
file
),
FileUtil
.
getAbsolutePath
(
backupOldData
));
}
catch
(
Exception
e
)
{
DefaultSystemLog
.
getLog
().
error
(
"load monitor error "
,
e
);
}
finally
{
BaseServerController
.
remove
();
}
}
...
...
@@ -279,7 +268,7 @@ public class LoadJsonConfigToDb {
if
(
outGivingModels
==
null
)
{
return
;
}
BaseServerController
.
resetInfo
(
UserModel
.
EMPTY
);
OutGivingServer
outGivingServer
=
SpringUtil
.
getBean
(
OutGivingServer
.
class
);
outGivingServer
.
insert
(
outGivingModels
);
// 将 json 文件转移到备份目录
...
...
@@ -287,8 +276,6 @@ public class LoadJsonConfigToDb {
DefaultSystemLog
.
getLog
().
info
(
"{} mv to {}"
,
FileUtil
.
getAbsolutePath
(
file
),
FileUtil
.
getAbsolutePath
(
backupOldData
));
}
catch
(
Exception
e
)
{
DefaultSystemLog
.
getLog
().
error
(
"load OUTGIVING error "
,
e
);
}
finally
{
BaseServerController
.
remove
();
}
}
...
...
This diff is collapsed.
Click to expand it.
web-vue/src/components/upgrade/index.vue
+
10
-
12
View file @
298da462
...
...
@@ -94,19 +94,17 @@ export default {
// 加载数据
loadData
()
{
systemInfo
(
this
.
nodeId
).
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
temp
=
res
.
data
?.
manifest
;
//
// vueTimeStamp
this
.
temp
.
vueTimeStamp
=
parseTime
(
this
.
getMeta
(
"
build-time
"
));
this
.
temp
=
res
.
data
?.
manifest
;
//
// vueTimeStamp
this
.
temp
=
{
...
this
.
temp
,
vueTimeStamp
:
parseTime
(
this
.
getMeta
(
"
build-time
"
))
};
//
changelog
(
this
.
nodeId
).
then
((
resLog
)
=>
{
this
.
changelog
=
resLog
.
data
;
//
changelog
(
this
.
nodeId
).
then
((
resLog
)
=>
{
this
.
changelog
=
resLog
.
data
;
//
// res.data.
this
.
showVersion
(
false
,
res
.
data
?.
remoteVersion
);
});
}
// res.data.
this
.
showVersion
(
false
,
res
.
data
?.
remoteVersion
);
});
});
},
getMeta
(
metaName
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help