mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-06 13:56:14 +08:00
add default platform versions
This commit is contained in:
parent
018e23a2be
commit
63f6355c08
@ -261,6 +261,6 @@ export default {
|
||||
}
|
||||
}
|
||||
#relevanceBox {
|
||||
margin-right: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
|
@ -128,9 +128,11 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.update();
|
||||
apiV2Request('permissions', 'GET', { author: window.PROJECT_OWNER, slug: window.PROJECT_SLUG }).then(response => {
|
||||
this.canUpload = response.permissions.includes('create_version');
|
||||
});
|
||||
apiV2Request('permissions', 'GET', { author: window.PROJECT_OWNER, slug: window.PROJECT_SLUG }).then(
|
||||
response => {
|
||||
this.canUpload = response.permissions.includes('create_version');
|
||||
}
|
||||
);
|
||||
this.$watch(
|
||||
() => this.page,
|
||||
() => {
|
||||
|
@ -1,4 +1,7 @@
|
||||
import { createApp } from 'vue';
|
||||
import $ from 'jquery';
|
||||
import VersionList from '@/VersionList';
|
||||
|
||||
$.ajaxSetup(window.ajaxSettings);
|
||||
|
||||
createApp(VersionList).mount('#version-list');
|
||||
|
@ -81,6 +81,11 @@ public class ApplicationController extends HangarController {
|
||||
|
||||
private final HttpServletRequest request;
|
||||
|
||||
// TODO remove
|
||||
private final List<String> paperVersions = List.of("1.8", "1.9", "1.10", "1.11", "1.12", "1.13", "1.14", "1.15", "1.16");
|
||||
private final List<String> waterfallVersions = List.of("1.11", "1.11", "1.12", "1.13", "1.14", "1.15", "1.16");
|
||||
private final List<String> velocityVersions = List.of("1.0", "1.1");
|
||||
|
||||
@Autowired
|
||||
public ApplicationController(HangarDao<PlatformVersionsDao> platformVersionsDao, UserService userService, ProjectService projectService, OrgService orgService, VersionService versionService, FlagService flagService, UserActionLogService userActionLogService, JobService jobService, SitemapService sitemapService, StatsService statsService, StatusZ statusZ, ObjectMapper mapper, HangarConfig hangarConfig, HttpServletRequest request) {
|
||||
this.platformVersionsDao = platformVersionsDao;
|
||||
@ -97,6 +102,18 @@ public class ApplicationController extends HangarController {
|
||||
this.hangarConfig = hangarConfig;
|
||||
this.request = request;
|
||||
this.statsService = statsService;
|
||||
|
||||
initPlatformVersions();
|
||||
}
|
||||
|
||||
// TODO remove
|
||||
private void initPlatformVersions() {
|
||||
Map<Platform, List<String>> platformVersions = platformVersionsDao.get().getVersions();
|
||||
if (platformVersions.isEmpty()) {
|
||||
platformVersionsDao.get().insert(paperVersions.stream().map(v -> new PlatformVersionsTable(Platform.PAPER, v)).collect(Collectors.toList()));
|
||||
platformVersionsDao.get().insert(velocityVersions.stream().map(v -> new PlatformVersionsTable(Platform.VELOCITY, v)).collect(Collectors.toList()));
|
||||
platformVersionsDao.get().insert(waterfallVersions.stream().map(v -> new PlatformVersionsTable(Platform.WATERFALL, v)).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/")
|
||||
|
Loading…
Reference in New Issue
Block a user