-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from xuezechao1/issue_247
backend添加展示agent插件界面
- Loading branch information
Showing
54 changed files
with
39,258 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
sermant-backend/src/main/java/com/huawei/sermant/backend/common/conf/WebConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.huawei.sermant.backend.common.conf; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.InterceptorRegistration; | ||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | ||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; | ||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
public class WebConfig implements WebMvcConfigurer { | ||
|
||
@Override | ||
public void addResourceHandlers(ResourceHandlerRegistry registry) { | ||
registry.addResourceHandler("/**").addResourceLocations("classpath:/frontend/dist/"); | ||
} | ||
|
||
@Override | ||
public void addViewControllers(ViewControllerRegistry registry) { | ||
registry.addViewController("/").setViewName("forward:/index.html"); | ||
} | ||
|
||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping("/**") | ||
.allowCredentials(false) | ||
.allowedMethods("POST","GET","DELETE","PUT","OPTIONS") | ||
.allowedOrigins("*") | ||
; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
sermant-backend/src/main/java/com/huawei/sermant/backend/entity/HeartbeatEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.huawei.sermant.backend.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Setter | ||
public class HeartbeatEntity { | ||
|
||
private String app; | ||
|
||
private String hostname; | ||
|
||
private Long heartbeatVersion; | ||
|
||
private String pluginVersion; | ||
|
||
private Long lastHeartbeat; | ||
|
||
private String pluginName; | ||
|
||
private String appType; | ||
|
||
private List<String> ip; | ||
|
||
private String version; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
sermant-backend/src/main/java/com/huawei/sermant/backend/util/DateUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.huawei.sermant.backend.util; | ||
|
||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
public class DateUtil { | ||
public String getFormatDate(Long times){ | ||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
return formatter.format(times); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"presets": [ | ||
["env", { | ||
"modules": false, | ||
"targets": { | ||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"] | ||
} | ||
}], | ||
"stage-2" | ||
], | ||
"plugins": ["transform-vue-jsx", "transform-runtime"], | ||
"env": { | ||
"test": { | ||
"presets": ["env", "stage-2"], | ||
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/build/ | ||
/config/ | ||
/dist/ | ||
/*.js | ||
/test/unit/coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// https://eslint.org/docs/user-guide/configuring | ||
|
||
module.exports = { | ||
root: true, | ||
parserOptions: { | ||
parser: 'babel-eslint' | ||
}, | ||
env: { | ||
browser: true, | ||
}, | ||
extends: [ | ||
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention | ||
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. | ||
'plugin:vue/essential', | ||
// https://github.com/standard/standard/blob/master/docs/RULES-en.md | ||
'standard' | ||
], | ||
// required to lint *.vue files | ||
plugins: [ | ||
'vue' | ||
], | ||
// add your custom rules here | ||
rules: { | ||
// allow async-await | ||
'generator-star-spacing': 'off', | ||
// allow debugger during development | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// https://github.com/michael-ciniawsky/postcss-load-config | ||
|
||
module.exports = { | ||
"plugins": { | ||
"postcss-import": {}, | ||
"postcss-url": {}, | ||
// to edit target browsers: use "browserslist" field in package.json | ||
"autoprefixer": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# frontend | ||
|
||
> A Vue.js project | ||
## Build Setup | ||
|
||
``` bash | ||
# install dependencies | ||
npm install | ||
|
||
# serve with hot reload at localhost:8080 | ||
npm run dev | ||
|
||
# build for production with minification | ||
npm run build | ||
|
||
# build for production and view the bundle analyzer report | ||
npm run build --report | ||
|
||
# run unit tests | ||
npm run unit | ||
|
||
# run e2e tests | ||
npm run e2e | ||
|
||
# run all tests | ||
npm test | ||
``` | ||
|
||
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). |
Oops, something went wrong.