新增延迟测试,允许测试指定服务器之间或指定服务器到自定义公网ip的延迟,去除服务器状态信息,升级springboot版本

This commit is contained in:
chuzhongzai 2024-08-18 19:55:59 +08:00
parent 8b94d074cc
commit fa0c2d43bd
29 changed files with 426 additions and 432 deletions

25
pom.xml
View File

@ -14,7 +14,7 @@
<name>scalable-network-storage</name>
<description>scalable-network-storage</description>
<properties>
<java.version>17</java.version>
<java.version>21</java.version>
</properties>
<dependencies>
<dependency>
@ -69,16 +69,10 @@
<version>5.8.26</version>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>6.4.7</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.21</version>
<version>1.25.0</version>
</dependency>
<dependency>
@ -101,6 +95,21 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<imageName>sns</imageName>
<buildArgs>
<arg>--gc=G1</arg>
<arg>-H:+ReportExceptionStackTraces</arg>
<arg>--initialize-at-build-time=org.apache.commons.logging.LogFactory,org.apache.commons.logging.LogFactoryService</arg>
</buildArgs>
<metadataRepository>
<enabled>true</enabled>
</metadataRepository>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,5 +1,6 @@
package com.lion.sns;
import io.netty.bootstrap.Bootstrap;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -11,9 +12,14 @@ public class ScalableNetworkStorageApplication {
private static ConfigurableApplicationContext context;
public static void main(String[] args) {
boot();
context = SpringApplication.run(ScalableNetworkStorageApplication.class, args);
}
public static void boot(){
new Bootstrap();
}
public static void restart() {
ApplicationArguments args = context.getBean(ApplicationArguments.class);

View File

@ -1,18 +1,30 @@
package com.lion.sns.configuration;
import com.lion.sns.message.*;
import com.lion.sns.pojo.*;
import com.lion.sns.pojo.Record;
import com.lion.sns.service.UserService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpSessionEvent;
import jakarta.servlet.http.HttpSessionListener;
import org.springframework.aot.hint.annotation.RegisterReflectionForBinding;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@RegisterReflectionForBinding(classes = {AbstractMessage.class, AdjustShareMessage.class, CancelShareMessage.class, CompressFileMessage.class, ConfigMessage.class,
ConnectMessage.class, DelayTestMessage.class, DynamicConfigMessage.class, ExtractFileMessage.class, FileOperateMessage.class, FileQueryMessage.class, FileResponseMessage.class,
MoveFileRequestMessage.class, MoveFileResponseMessage.class, PairMessage.class, PairResultMessage.class, ResponseMessage.class, ShareFileMessage.class, ShareFileQueryMessage.class,
TaskCancelMessage.class, TaskStatusMessage.class, UnPairMessage.class, FileNode.class, Progress.class, Record.class, ShareFile.class, ShareFileDownloadRecord.class, Site.class, Task.class,
User.class})
public class BeanConfiguration {
@Resource
// @Resource
UserService userService;
public BeanConfiguration(UserService userService){
this.userService = userService;
}
@Bean
public HttpSessionListener getHttpSessionListener(){
return new HttpSessionListener() {

View File

@ -0,0 +1,266 @@
package com.lion.sns.configuration;
import org.apache.commons.logging.LogFactory;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.cache.decorators.FifoCache;
import org.apache.ibatis.cache.decorators.LruCache;
import org.apache.ibatis.cache.decorators.SoftCache;
import org.apache.ibatis.cache.decorators.WeakCache;
import org.apache.ibatis.cache.impl.PerpetualCache;
import org.apache.ibatis.javassist.util.proxy.ProxyFactory;
import org.apache.ibatis.javassist.util.proxy.RuntimeSupport;
import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl;
import org.apache.ibatis.logging.jdk14.Jdk14LoggingImpl;
import org.apache.ibatis.logging.log4j2.Log4j2Impl;
import org.apache.ibatis.logging.nologging.NoLoggingImpl;
import org.apache.ibatis.logging.slf4j.Slf4jImpl;
import org.apache.ibatis.logging.stdout.StdOutImpl;
import org.apache.ibatis.reflection.TypeParameterResolver;
import org.apache.ibatis.scripting.defaults.RawLanguageDriver;
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.mapper.MapperFactoryBean;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.beans.PropertyValue;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution;
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor;
import org.springframework.beans.factory.aot.BeanRegistrationExcludeFilter;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
import org.springframework.beans.factory.support.RegisteredBean;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportRuntimeHints;
import org.springframework.core.ResolvableType;
import org.springframework.util.ClassUtils;
import org.springframework.util.ReflectionUtils;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Configuration(proxyBeanMethods = false)
@ImportRuntimeHints(MyBatisNativeConfiguration.MyBaitsRuntimeHintsRegistrar.class)
public class MyBatisNativeConfiguration {
@Bean
MyBatisBeanFactoryInitializationAotProcessor myBatisBeanFactoryInitializationAotProcessor() {
return new MyBatisBeanFactoryInitializationAotProcessor();
}
@Bean
static MyBatisMapperFactoryBeanPostProcessor myBatisMapperFactoryBeanPostProcessor() {
return new MyBatisMapperFactoryBeanPostProcessor();
}
static class MyBaitsRuntimeHintsRegistrar implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
Stream.of(RawLanguageDriver.class,
XMLLanguageDriver.class,
RuntimeSupport.class,
ProxyFactory.class,
Slf4jImpl.class,
Log.class,
JakartaCommonsLoggingImpl.class,
Log4j2Impl.class,
Jdk14LoggingImpl.class,
StdOutImpl.class,
NoLoggingImpl.class,
SqlSessionFactory.class,
PerpetualCache.class,
FifoCache.class,
LruCache.class,
SoftCache.class,
WeakCache.class,
SqlSessionFactoryBean.class,
ArrayList.class,
HashMap.class,
TreeSet.class,
HashSet.class
).forEach(x -> hints.reflection().registerType(x, MemberCategory.values()));
Stream.of(
"org/apache/ibatis/builder/xml/*.dtd",
"org/apache/ibatis/builder/xml/*.xsd"
).forEach(hints.resources()::registerPattern);
}
}
static class MyBatisBeanFactoryInitializationAotProcessor
implements BeanFactoryInitializationAotProcessor, BeanRegistrationExcludeFilter {
private final Set<Class<?>> excludeClasses = new HashSet<>();
MyBatisBeanFactoryInitializationAotProcessor() {
excludeClasses.add(MapperScannerConfigurer.class);
}
@Override public boolean isExcludedFromAotProcessing(RegisteredBean registeredBean) {
return excludeClasses.contains(registeredBean.getBeanClass());
}
@Override
public BeanFactoryInitializationAotContribution processAheadOfTime(ConfigurableListableBeanFactory beanFactory) {
String[] beanNames = beanFactory.getBeanNamesForType(MapperFactoryBean.class);
if (beanNames.length == 0) {
return null;
}
return (context, code) -> {
RuntimeHints hints = context.getRuntimeHints();
for (String beanName : beanNames) {
BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName.substring(1));
PropertyValue mapperInterface = beanDefinition.getPropertyValues().getPropertyValue("mapperInterface");
if (mapperInterface != null && mapperInterface.getValue() != null) {
Class<?> mapperInterfaceType = (Class<?>) mapperInterface.getValue();
if (mapperInterfaceType != null) {
registerReflectionTypeIfNecessary(mapperInterfaceType, hints);
hints.proxies().registerJdkProxy(mapperInterfaceType);
hints.resources()
.registerPattern(mapperInterfaceType.getName().replace('.', '/').concat(".xml"));
registerMapperRelationships(mapperInterfaceType, hints);
}
}
}
};
}
private void registerMapperRelationships(Class<?> mapperInterfaceType, RuntimeHints hints) {
Method[] methods = ReflectionUtils.getAllDeclaredMethods(mapperInterfaceType);
for (Method method : methods) {
if (method.getDeclaringClass() != Object.class) {
ReflectionUtils.makeAccessible(method);
registerSqlProviderTypes(method, hints, SelectProvider.class, SelectProvider::value, SelectProvider::type);
registerSqlProviderTypes(method, hints, InsertProvider.class, InsertProvider::value, InsertProvider::type);
registerSqlProviderTypes(method, hints, UpdateProvider.class, UpdateProvider::value, UpdateProvider::type);
registerSqlProviderTypes(method, hints, DeleteProvider.class, DeleteProvider::value, DeleteProvider::type);
Class<?> returnType = MyBatisMapperTypeUtils.resolveReturnClass(mapperInterfaceType, method);
registerReflectionTypeIfNecessary(returnType, hints);
MyBatisMapperTypeUtils.resolveParameterClasses(mapperInterfaceType, method)
.forEach(x -> registerReflectionTypeIfNecessary(x, hints));
}
}
}
@SafeVarargs
private <T extends Annotation> void registerSqlProviderTypes(
Method method, RuntimeHints hints, Class<T> annotationType, Function<T, Class<?>>... providerTypeResolvers) {
for (T annotation : method.getAnnotationsByType(annotationType)) {
for (Function<T, Class<?>> providerTypeResolver : providerTypeResolvers) {
registerReflectionTypeIfNecessary(providerTypeResolver.apply(annotation), hints);
}
}
}
private void registerReflectionTypeIfNecessary(Class<?> type, RuntimeHints hints) {
if (!type.isPrimitive() && !type.getName().startsWith("java")) {
hints.reflection().registerType(type, MemberCategory.values());
}
}
}
static class MyBatisMapperTypeUtils {
private MyBatisMapperTypeUtils() {
// NOP
}
static Class<?> resolveReturnClass(Class<?> mapperInterface, Method method) {
Type resolvedReturnType = TypeParameterResolver.resolveReturnType(method, mapperInterface);
return typeToClass(resolvedReturnType, method.getReturnType());
}
static Set<Class<?>> resolveParameterClasses(Class<?> mapperInterface, Method method) {
return Stream.of(TypeParameterResolver.resolveParamTypes(method, mapperInterface))
.map(x -> typeToClass(x, x instanceof Class ? (Class<?>) x : Object.class)).collect(Collectors.toSet());
}
private static Class<?> typeToClass(Type src, Class<?> fallback) {
Class<?> result = null;
if (src instanceof Class<?>) {
if (((Class<?>) src).isArray()) {
result = ((Class<?>) src).getComponentType();
} else {
result = (Class<?>) src;
}
} else if (src instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) src;
int index = (parameterizedType.getRawType() instanceof Class
&& Map.class.isAssignableFrom((Class<?>) parameterizedType.getRawType())
&& parameterizedType.getActualTypeArguments().length > 1) ? 1 : 0;
Type actualType = parameterizedType.getActualTypeArguments()[index];
result = typeToClass(actualType, fallback);
}
if (result == null) {
result = fallback;
}
return result;
}
}
static class MyBatisMapperFactoryBeanPostProcessor implements MergedBeanDefinitionPostProcessor, BeanFactoryAware {
private static final org.apache.commons.logging.Log LOG = LogFactory.getLog(
MyBatisMapperFactoryBeanPostProcessor.class);
private static final String MAPPER_FACTORY_BEAN = "org.mybatis.spring.mapper.MapperFactoryBean";
private ConfigurableBeanFactory beanFactory;
@Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = (ConfigurableBeanFactory) beanFactory;
}
@Override
public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) {
if (ClassUtils.isPresent(MAPPER_FACTORY_BEAN, this.beanFactory.getBeanClassLoader())) {
resolveMapperFactoryBeanTypeIfNecessary(beanDefinition);
}
}
private void resolveMapperFactoryBeanTypeIfNecessary(RootBeanDefinition beanDefinition) {
if (!beanDefinition.hasBeanClass() || !MapperFactoryBean.class.isAssignableFrom(beanDefinition.getBeanClass())) {
return;
}
if (beanDefinition.getResolvableType().hasUnresolvableGenerics()) {
Class<?> mapperInterface = getMapperInterface(beanDefinition);
if (mapperInterface != null) {
// Exposes a generic type information to context for prevent early initializing
beanDefinition
.setTargetType(ResolvableType.forClassWithGenerics(beanDefinition.getBeanClass(), mapperInterface));
}
}
}
private Class<?> getMapperInterface(RootBeanDefinition beanDefinition) {
try {
return (Class<?>) beanDefinition.getPropertyValues().get("mapperInterface");
}
catch (Exception e) {
LOG.debug("Fail getting mapper interface type.", e);
return null;
}
}
}
}

View File

@ -1,7 +1,6 @@
package com.lion.sns.configuration;
import com.lion.sns.interceptor.Interceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
@ -10,9 +9,13 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebComponentConfiguration implements WebMvcConfigurer {
@Resource
// @Resource
Interceptor interceptor;
public WebComponentConfiguration(Interceptor interceptor){
this.interceptor = interceptor;
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")

View File

@ -1,7 +1,6 @@
package com.lion.sns.configuration;
import com.lion.sns.service.WebSocketService;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
@ -11,9 +10,12 @@ import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry
@EnableWebSocket
public class WebsocketConfiguration implements WebSocketConfigurer {
@Resource
WebSocketService webSocketService;
public WebsocketConfiguration(WebSocketService webSocketService){
this.webSocketService = webSocketService;
}
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry.addHandler(webSocketService, "/ws/").setAllowedOrigins("*");

View File

@ -3,7 +3,6 @@ package com.lion.sns.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.lion.sns.service.FileService;
import com.lion.sns.util.Response;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.*;
@ -14,9 +13,14 @@ import java.util.Arrays;
@RestController
@RequestMapping("/file/")
public class FileController {
@Resource
// @Resource
FileService fileService;
public FileController(FileService fileService) {
this.fileService = fileService;
}
@GetMapping("get")
public String getFiles(String path, @SessionAttribute("id") Integer userid){
return fileService.getFiles(path, userid);

View File

@ -1,15 +1,18 @@
package com.lion.sns.controller;
import com.lion.sns.service.ShareService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/share/")
public class ShareFileController {
@Resource
// @Resource
ShareService shareService;
public ShareFileController(ShareService shareService) {
this.shareService = shareService;
}
@PostMapping("")
public String shareFile(String path, Integer time, Integer count, String[] fileNames, @SessionAttribute("id") Integer userid){
return shareService.shareFile(path, time, count, fileNames, userid);

View File

@ -2,7 +2,6 @@ package com.lion.sns.controller;
import com.lion.sns.pojo.Site;
import com.lion.sns.service.SiteService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -11,9 +10,13 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/manage/site/")
public class SiteManageController {
@Resource
// @Resource
SiteService siteService;
public SiteManageController(SiteService siteService) {
this.siteService = siteService;
}
@PostMapping("alter")
public String alterSite(Site site){
return siteService.alterSite(site);

View File

@ -2,16 +2,19 @@ package com.lion.sns.controller;
import com.lion.sns.pojo.User;
import com.lion.sns.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/manage/user/")
public class UserManageController {
@Resource
// @Resource
UserService userService;
public UserManageController(UserService userService) {
this.userService = userService;
}
@PostMapping("create")
public String createUser(User user){
return userService.createUser(user);

View File

@ -4,7 +4,6 @@ import com.lion.sns.pojo.User;
import com.lion.sns.service.FileService;
import com.lion.sns.service.SiteService;
import com.lion.sns.service.UserService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
@ -14,21 +13,28 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttribute;
import java.io.IOException;
@Controller
public class indexController {
@Resource
// @Resource
UserService userService;
@Resource
// @Resource
SiteService siteService;
@Resource
// @Resource
FileService fileService;
public indexController(UserService userService, SiteService siteService, FileService fileService){
this.userService = userService;
this.siteService = siteService;
this.fileService = fileService;
}
@GetMapping("/")
public String index(){
return "index";
public void index(HttpServletResponse resp) throws IOException {
resp.sendRedirect("/index");
}
@PostMapping("/login")

View File

@ -9,13 +9,13 @@ import java.util.Date;
@Mapper
public interface SiteMapper {
@Insert("insert into site (ip, domain, reverse_proxy_prefix, hostname, system, cpu_arch, cpu_name, cpu_core, cpu_thread, storage_path, available_space, total_space)" +
"VALUES (#{ip}, #{domain}, #{reverseProxyPrefix}, #{hostname}, #{system}, #{cpuArch}, #{cpuName}, #{cpuCore}, #{cpuThread}, #{storagePath}, #{availableSpace}, #{totalSpace})")
@Insert("insert into site (ip, domain, reverse_proxy_prefix, hostname, storage_path, available_space, total_space)" +
"VALUES (#{ip}, #{domain}, #{reverseProxyPrefix}, #{hostname}, #{storagePath}, #{availableSpace}, #{totalSpace})")
@Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
void insertSite(Site site);
@Update("update site set ip=#{ip}, domain=#{domain}, reverse_proxy_prefix=#{reverseProxyPrefix}, hostname=#{hostname}, system=#{system}, cpu_arch=#{cpuArch}," +
"cpu_name=#{cpuName}, cpu_core=#{cpuCore}, cpu_thread=#{cpuThread}, storage_path=#{storagePath}, available_space=#{availableSpace}, total_space=#{totalSpace} where id=#{id}")
@Update("update site set ip=#{ip}, domain=#{domain}, reverse_proxy_prefix=#{reverseProxyPrefix}, hostname=#{hostname}," +
"storage_path=#{storagePath}, available_space=#{availableSpace}, total_space=#{totalSpace} where id=#{id}")
void updateSite(Site site);
@Update("update site set last_online=#{last_online} where id=#{id} and id != 1")

View File

@ -9,7 +9,6 @@ public class AbstractMessage {
public static final int FILE_QUERY_MESSAGE = 1;
public static final int FILE_RESPONSE_MESSAGE = 2;
public static final int STATUS_MESSAGE = 10;
public static final int MOVE_FILE_REQUEST_MESSAGE = 15;
public static final int MOVE_FILE_RESPONSE_MESSAGE = 16;
public static final int PAIR_MESSAGE = 20;

View File

@ -30,7 +30,6 @@ public class MessageCodec extends ByteToMessageCodec<AbstractMessage> {
abstractMessage = switch (type){
case AbstractMessage.FILE_QUERY_MESSAGE -> objectMapper.readValue(bytes, FileQueryMessage.class);
case AbstractMessage.FILE_RESPONSE_MESSAGE -> objectMapper.readValue(bytes, FileResponseMessage.class);
case AbstractMessage.STATUS_MESSAGE -> objectMapper.readValue(bytes, StatusMessage.class);
case AbstractMessage.MOVE_FILE_REQUEST_MESSAGE -> objectMapper.readValue(bytes, MoveFileRequestMessage.class);
case AbstractMessage.PAIR_MESSAGE -> objectMapper.readValue(bytes, PairMessage.class);
case AbstractMessage.PAIR_RESULT_MESSAGE -> objectMapper.readValue(bytes, PairResultMessage.class);

View File

@ -11,11 +11,6 @@ public class PairMessage extends AbstractMessage{
String domain;
String reverseProxyPrefix;
String hostname;
String system;
String cpuArch;
String cpuName;
int cpuCore;
int cpuThread;
String storagePath;
long availableSpace;
}

View File

@ -1,25 +0,0 @@
package com.lion.sns.message;
import lombok.Data;
@Data
public class StatusMessage extends AbstractMessage{
{
messageType = STATUS_MESSAGE;
}
int id;
long usedMemory;
long totalMemory;
double usedMemoryPercentage;
long usedSpace;
long totalSpace;
double usedSpacePercentage;
double[] systemLoad;
double usedCpuPercentage;
long ioRead;
long ioWrite;
long networkReceive;
long networkSend;
long systemUpTime;
long systemBootTime;
}

View File

@ -5,8 +5,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.lion.sns.message.PairMessage;
import lombok.Data;
import java.util.Date;
@Data
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Site {
@ -17,11 +15,6 @@ public class Site {
site.setDomain(pairMessage.getDomain());
site.setReverseProxyPrefix(pairMessage.getReverseProxyPrefix());
site.setHostname(pairMessage.getHostname());
site.setSystem(pairMessage.getSystem());
site.setCpuArch(pairMessage.getCpuArch());
site.setCpuName(pairMessage.getCpuName());
site.setCpuCore(pairMessage.getCpuCore());
site.setCpuThread(pairMessage.getCpuThread());
site.setStoragePath(pairMessage.getStoragePath());
return site;
}
@ -41,13 +34,6 @@ public class Site {
String domain;
String reverseProxyPrefix;
String hostname;
String system;
String cpuArch;
String cpuName;
int cpuCore;
int cpuThread;
Date lastOnline;
boolean isOnline;
String storagePath;
long totalSpace;
long availableSpace;

View File

@ -17,7 +17,6 @@ import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
import io.netty.util.concurrent.DefaultPromise;
import io.netty.util.concurrent.Promise;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpSession;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -46,13 +45,12 @@ public class CommunicateService {
SiteMapper siteMapper;
@Resource
// @Resource
TaskService taskService;
@Resource
CustomConfigurationMapper customConfigurationMapper;
@Resource
// @Resource
UserMapper userMapper;
HashMap<Integer, Channel> sessions;
@ -61,8 +59,6 @@ public class CommunicateService {
HashMap<Integer, DefaultPromise<AbstractMessage>> promises;
HashMap<Integer, StatusMessage> loadInformation;
HashMap<Integer, User> userid2user;
HashMap<Integer, HttpSession> userid2httpSession;
@ -78,14 +74,15 @@ public class CommunicateService {
Interceptor interceptor;
public CommunicateService(WebSocketService webSocketService, CustomConfigurationMapper customConfigurationMapper, SiteMapper siteMapper,
Interceptor interceptor){
Interceptor interceptor, TaskService taskService, UserMapper userMapper){
this.userMapper = userMapper;
this.taskService = taskService;
storagePath = customConfigurationMapper.selectValue(CustomConfigurationMapper.PATH);
this.customConfigurationMapper = customConfigurationMapper;
this.interceptor = interceptor;
threadPool = Executors.newFixedThreadPool(2);
messageId = new AtomicInteger();
eventLoop = new DefaultEventLoop();
loadInformation = new HashMap<>();
sessions = new HashMap<>();
userid2user = new HashMap<>();
userid2httpSession = new HashMap<>();
@ -103,7 +100,7 @@ public class CommunicateService {
}}).bind(7777);
this.webSocketService = webSocketService;
this.siteMapper = siteMapper;
webSocketService.initScheduleThread(loadInformation);
webSocketService.initScheduleThread();
webSocketService.logoutFunction = (Function<Integer, Object>) userid -> {
User logoutUser = this.userid2user.remove(userid);
@ -327,12 +324,6 @@ public class CommunicateService {
public void channelRead(ChannelHandlerContext ctx, Object msg) {
AbstractMessage abstractMessage = (AbstractMessage) msg;
switch (abstractMessage.messageType){
case AbstractMessage.STATUS_MESSAGE -> {
StatusMessage statusMessage = (StatusMessage) abstractMessage;
statusMessage.setMessageType(0);
statusMessage.setMessageId(0);
loadInformation.put(statusMessage.getId(), statusMessage);
}
case AbstractMessage.TASK_STATUS_MESSAGE -> {
TaskStatusMessage taskStatusMessage = (TaskStatusMessage) abstractMessage;
for (Task task : taskStatusMessage.getTasks()) {

View File

@ -13,11 +13,9 @@ import com.lion.sns.util.CustomUtil;
import com.lion.sns.util.IoUtil;
import com.lion.sns.util.Response;
import io.netty.util.concurrent.DefaultPromise;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.springframework.stereotype.Service;
@ -44,19 +42,19 @@ import java.util.zip.CRC32;
public class FileService {
String storagePath;
@Resource
// @Resource
CommunicateService communicateService;
@Resource
// @Resource
WebSocketService webSocketService;
@Resource
// @Resource
TaskService taskService;
@Resource
// @Resource
ShareFileMapper shareFileMapper;
@Resource
// @Resource
UserMapper userMapper;
ObjectMapper objectMapper;
@ -67,7 +65,13 @@ public class FileService {
HashMap<String, FileNode> shareFileNodes;
public FileService(CustomConfigurationMapper customConfigurationMapper){
public FileService(CustomConfigurationMapper customConfigurationMapper, CommunicateService communicateService, WebSocketService webSocketService,
TaskService taskService, ShareFileMapper shareFileMapper, UserMapper userMapper){
this.communicateService = communicateService;
this.webSocketService = webSocketService;
this.taskService = taskService;
this.shareFileMapper = shareFileMapper;
this.userMapper = userMapper;
storagePath = customConfigurationMapper.selectValue(CustomConfigurationMapper.PATH);
threadPool = Executors.newFixedThreadPool(4);
ipAndShareCode = new HashMap<>();
@ -877,7 +881,7 @@ public class FileService {
for (String path : task.getPaths()) {
File file = new File(storagePath + task.getRelativePath(), path);
if(file.isFile()){
ArchiveEntry entry = new TarArchiveEntry(file, finalPath.relativize(file.toPath()).toString());
TarArchiveEntry entry = new TarArchiveEntry(file, finalPath.relativize(file.toPath()).toString());
aos.putArchiveEntry(entry);
InputStream inputStream = Files.newInputStream(file.toPath());
byte[] buf = new byte[8192];
@ -893,7 +897,7 @@ public class FileService {
Files.walkFileTree(file.toPath(), new SimpleFileVisitor<>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
ArchiveEntry entry = new TarArchiveEntry(dir.toFile(), finalPath.relativize(dir).toString());
TarArchiveEntry entry = new TarArchiveEntry(dir.toFile(), finalPath.relativize(dir).toString());
aos.putArchiveEntry(entry);
aos.closeArchiveEntry();
return FileVisitResult.CONTINUE;
@ -901,7 +905,7 @@ public class FileService {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
ArchiveEntry entry = new TarArchiveEntry(file.toFile(), finalPath.relativize(file).toString());
TarArchiveEntry entry = new TarArchiveEntry(file.toFile(), finalPath.relativize(file).toString());
aos.putArchiveEntry(entry);
InputStream inputStream = Files.newInputStream(file.toFile().toPath());
byte[] buf = new byte[8192];

View File

@ -10,7 +10,6 @@ import com.lion.sns.pojo.ShareFile;
import com.lion.sns.pojo.User;
import com.lion.sns.util.CustomUtil;
import com.lion.sns.util.Response;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
@ -20,21 +19,25 @@ import java.util.*;
@Service
public class ShareService {
@Resource
// @Resource
ShareFileMapper shareFileMapper;
@Resource
// @Resource
CommunicateService communicateService;
@Resource
// @Resource
UserMapper userMapper;
String storagePath;
ObjectMapper objectMapper;
public ShareService(CustomConfigurationMapper customConfigurationMapper){
public ShareService(CustomConfigurationMapper customConfigurationMapper, ShareFileMapper shareFileMapper,
CommunicateService communicateService, UserMapper userMapper){
storagePath = customConfigurationMapper.selectValue(CustomConfigurationMapper.PATH);
objectMapper = CustomUtil.objectMapper;
this.communicateService = communicateService;
this.shareFileMapper = shareFileMapper;
this.userMapper = userMapper;
}
public String shareFile(String path, Integer time, Integer count, String[] fileNames, int userid){

View File

@ -15,7 +15,6 @@ import com.lion.sns.pojo.Site;
import com.lion.sns.pojo.User;
import com.lion.sns.util.CustomUtil;
import com.lion.sns.util.Response;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import java.io.File;
@ -23,25 +22,31 @@ import java.io.IOException;
import java.net.Inet4Address;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.regex.Pattern;
@Service
public class SiteService {
@Resource
// @Resource
SiteMapper siteMapper;
@Resource
// @Resource
ShareFileMapper shareFileMapper;
@Resource
// @Resource
CommunicateService communicateService;
@Resource
// @Resource
CustomConfigurationMapper customConfigurationMapper;
ObjectMapper objectMapper = CustomUtil.objectMapper;
public SiteService(SiteMapper siteMapper, ShareFileMapper shareFileMapper, CommunicateService communicateService, CustomConfigurationMapper customConfigurationMapper) {
this.siteMapper = siteMapper;
this.shareFileMapper = shareFileMapper;
this.communicateService = communicateService;
this.customConfigurationMapper = customConfigurationMapper;
}
public String alterSite(Site site){
Response response = new Response();
@ -154,10 +159,6 @@ public class SiteService {
public String getSites() {
Response response = new Response();
ArrayList<Site> sites = siteMapper.selectAllSite();
HashMap<Integer, String> ips = communicateService.ips;
for (Site site : sites)
if(ips.containsKey(site.getId()))
site.setOnline(true);
response.success(objectMapper.valueToTree(sites));
return response.toJSONString();
@ -168,21 +169,14 @@ public class SiteService {
User user = communicateService.userid2user.get(userid);
ArrayList<Site> sites = siteMapper.selectAllSite();
ArrayList<Site> result = new ArrayList<>();
HashMap<Integer, String> ips = communicateService.ips;
if(user.getId() != 1)
for (Site site : sites) {
if(user.getSiteId() == site.getId()) {
if(user.getId() != 1) {
for (Site site : sites)
if (user.getSiteId() == site.getId()) {
result.add(site);
if (ips.containsKey(site.getId()))
site.setOnline(true);
break;
}
}
else
for (Site site : sites) {
if (ips.containsKey(site.getId()))
site.setOnline(true);
result.add(site);
}
} else
result.addAll(sites);
response.success(objectMapper.valueToTree(result));
return response.toJSONString();

View File

@ -15,7 +15,6 @@ import com.lion.sns.pojo.Site;
import com.lion.sns.pojo.User;
import com.lion.sns.util.CustomUtil;
import com.lion.sns.util.Response;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpSession;
import org.springframework.stereotype.Service;
@ -24,26 +23,32 @@ import java.util.ArrayList;
@Service
public class UserService {
@Resource
// @Resource
UserMapper userMapper;
@Resource
// @Resource
SiteMapper siteMapper;
@Resource
// @Resource
CommunicateService communicateService;
CustomConfigurationMapper customConfigurationMapper;
@Resource
// @Resource
ShareFileMapper shareFileMapper;
ObjectMapper objectMapper = CustomUtil.objectMapper;
String storagePath;
public UserService(CustomConfigurationMapper customConfigurationMapper){
public UserService(CustomConfigurationMapper customConfigurationMapper, UserMapper userMapper,
SiteMapper siteMapper, CommunicateService communicateService, ShareFileMapper shareFileMapper
){
this.customConfigurationMapper = customConfigurationMapper;
this.userMapper = userMapper;
this.siteMapper = siteMapper;
this.shareFileMapper = shareFileMapper;
this.communicateService = communicateService;
storagePath = customConfigurationMapper.selectValue(CustomConfigurationMapper.PATH);
}

View File

@ -6,17 +6,14 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
import com.lion.sns.dao.CustomConfigurationMapper;
import com.lion.sns.dao.UserMapper;
import com.lion.sns.message.AbstractMessage;
import com.lion.sns.message.StatusMessage;
import com.lion.sns.message.PairMessage;
import com.lion.sns.message.ResponseMessage;
import com.lion.sns.pojo.Task;
import com.lion.sns.pojo.User;
import com.lion.sns.util.CustomUtil;
import com.lion.sns.util.IoUtil;
import io.netty.util.concurrent.DefaultPromise;
import io.netty.util.concurrent.Promise;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.socket.*;
@ -42,7 +39,7 @@ public class WebSocketService implements WebSocketHandler {
* 进度发给发起的那个session
*/
@Resource
// @Resource
UserMapper userMapper;
HashMap<Integer, Task> tasks;
@ -61,13 +58,12 @@ public class WebSocketService implements WebSocketHandler {
public final Map<Integer, Promise<AbstractMessage>> pairMessages;
private Map<Integer, StatusMessage> loadMap;
private final ScheduledExecutorService scheduledThread;
private final ObjectMapper objectMapper;
public WebSocketService(CustomConfigurationMapper customConfigurationMapper) {
public WebSocketService(CustomConfigurationMapper customConfigurationMapper, UserMapper userMapper) {
this.customConfigurationMapper = customConfigurationMapper;
storagePath = customConfigurationMapper.selectValue(CustomConfigurationMapper.PATH);
objectMapper = CustomUtil.objectMapper;
@ -76,6 +72,7 @@ public class WebSocketService implements WebSocketHandler {
scheduledThread = Executors.newScheduledThreadPool(1);
userid2session = new HashMap<>();
onlineUsers = new HashMap<>();
this.userMapper = userMapper;
}
@Override
@ -176,41 +173,6 @@ public class WebSocketService implements WebSocketHandler {
}
}
public void sendLoadInformation(){
//两种状态1.管理员看全部状态 2.用户看自己所绑定的服务器状态
if(session == null && onlineUsers.isEmpty())
return;
loadMap.put(1, IoUtil.generateLoadMessage(1, storagePath));
ObjectNode totalStatus = objectMapper.createObjectNode();
HashMap<Integer, ObjectNode> userid2status = new HashMap<>();
totalStatus.set("1", objectMapper.valueToTree(loadMap.get(1)));
totalStatus.put("type", MESSAGE_TYPE.STATUS);
loadMap.forEach((k, v) -> totalStatus.set(String.valueOf(k), objectMapper.valueToTree(v)));
for (User user : onlineUsers.values()) {
if(loadMap.containsKey(user.getSiteId())) {
ObjectNode status = objectMapper.createObjectNode();
status.put("type", MESSAGE_TYPE.STATUS);
status.set("1", objectMapper.valueToTree(loadMap.get(user.getSiteId())));
userid2status.put(user.getId(), status);
}
}
try {
if(session != null && session.isOpen())
session.sendMessage(new TextMessage(totalStatus.toString()));
userid2session.forEach((k, v) -> {
if(k != 1 && v != null && v.isOpen()){
try {
v.sendMessage(new TextMessage(userid2status.get(k).toString()));
} catch (IOException e) {log.error(e.getMessage());}
}
});
}catch (IOException e){log.error(e.getMessage());}
}
public void sendTaskInformation(){
if(tasks.isEmpty() || (session == null && onlineUsers.isEmpty()))
return;
@ -240,11 +202,9 @@ public class WebSocketService implements WebSocketHandler {
}
}
public void initScheduleThread(HashMap<Integer, StatusMessage> loadMap){
this.loadMap = loadMap;
public void initScheduleThread(){
scheduledThread.scheduleAtFixedRate(() -> {
try {
sendLoadInformation();
sendTaskInformation();
}catch (Exception e){
e.printStackTrace();
@ -285,7 +245,6 @@ public class WebSocketService implements WebSocketHandler {
static class MESSAGE_TYPE{
final static String PAIR = "pair";
final static String INIT = "init";
final static String STATUS = "status";
final static String STATUS_ALTER = "statusAlter";
final static String TASK = "task";
}

View File

@ -22,7 +22,6 @@ import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Scanner;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@ -171,7 +170,6 @@ public class CustomUtil {
}
Site site = Site.generateSite(IoUtil.generatePairMessage());
site.setId(1);
site.setLastOnline(new Date());
site.setStoragePath(path);
site.setDomain(null);
site.setReverseProxyPrefix(null);

View File

@ -3,126 +3,53 @@ package com.lion.sns.util;
import cn.hutool.core.net.NetUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.system.oshi.CpuInfo;
import cn.hutool.system.oshi.OshiUtil;
import com.lion.sns.message.StatusMessage;
import com.lion.sns.message.PairMessage;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.Data;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.connector.ClientAbortException;
import org.springframework.http.HttpHeaders;
import oshi.hardware.*;
import oshi.software.os.OperatingSystem;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
@Slf4j
@Data
public class IoUtil {
static long ioRead;
static long ioWrite;
static long networkSend;
static long networkReceive;
static NetworkIF networkIF;
static List<HWDiskStore> diskStores;
static CpuInfo cpuInfo;
static GlobalMemory globalMemory;
static long send;
static long sendNow;
static long receive;
static long receiveNow;
static long read;
static long readNow;
static long write;
static long writeNow;
@Getter
static String ip;
static {
init();
}
public static void init(){
ScheduledExecutorService thread = Executors.newScheduledThreadPool(1);
List<NetworkIF> networkIFs = OshiUtil.getNetworkIFs();
cpuInfo = OshiUtil.getCpuInfo();
globalMemory = OshiUtil.getMemory();
for (NetworkIF nif : networkIFs)
if (nif.getName().startsWith("eth") || nif.getName().startsWith("ens")) {
networkIF = nif;
break;
}
if(networkIF == null)
log.error("网卡 不存在");
else{
send = networkIF.getBytesSent();
receive = networkIF.getBytesRecv();
try {
ip = getPublicIP();
}catch (IOException | URISyntaxException e){
log.info("当前机器网卡为内网ip且无法获取公网ip程序退出");
Runtime.getRuntime().exit(1);
}
diskStores = OshiUtil.getDiskStores();
for (HWDiskStore diskStore : diskStores) {
read += diskStore.getReadBytes();
write += diskStore.getWriteBytes();
}
thread.scheduleAtFixedRate(IoUtil::monitor, 0, 1, TimeUnit.SECONDS);
}
private static void monitor(){
networkIF.updateAttributes();
sendNow = networkIF.getBytesSent();
receiveNow = networkIF.getBytesRecv();
networkSend = sendNow - send;
networkReceive = receiveNow - receive;
send = sendNow;
receive = receiveNow;
writeNow = 0;
readNow = 0;
for (HWDiskStore diskStore : diskStores) {
diskStore.updateAttributes();
writeNow += diskStore.getWriteBytes();
readNow += diskStore.getReadBytes();
}
ioWrite = writeNow - write;
ioRead = readNow - read;
write = writeNow;
read = readNow;
}
public static PairMessage generatePairMessage(){
PairMessage pairMessage = new PairMessage();
String ip = networkIF.getIPv4addr()[0].split("/")[0];
String privateIPPattern = "(^10\\.)|(^172\\.1[6-9]\\.)|(^172\\.2[0-9]\\.)|(^172\\.3[0-1]\\.)|(^192\\.168\\.)";
if(Pattern.compile(privateIPPattern).matcher(ip).find())
try {
ip = getPublicIP();
}catch (IOException | URISyntaxException e){
log.info("当前机器网卡为内网ip且无法获取公网ip程序退出");
Runtime.getRuntime().exit(1);
}
String ip;
try {
ip = getPublicIP();
}catch (IOException | URISyntaxException e){
log.info("当前机器网卡为内网ip且无法获取公网ip程序退出");
Runtime.getRuntime().exit(1);
return null;
}
pairMessage.setIp(ip);
pairMessage.setHostname(NetUtil.getLocalHostName());
OperatingSystem os = OshiUtil.getOs();
pairMessage.setSystem(os.getFamily() + " " + os.getVersionInfo().toString());
pairMessage.setCpuArch(System.getProperty("os.arch"));
CentralProcessor processor = OshiUtil.getHardware().getProcessor();
pairMessage.setCpuName(processor.getProcessorIdentifier().getName().strip());
pairMessage.setCpuCore(processor.getPhysicalProcessorCount());
pairMessage.setCpuThread(processor.getLogicalProcessorCount());
return pairMessage;
}
@ -145,48 +72,6 @@ public class IoUtil {
return json.substring(startIndex + 1, endIndex);
}
public static StatusMessage generateLoadMessage(int id, String path){
StatusMessage statusMessage = new StatusMessage();
statusMessage.setId(id);
statusMessage.setTotalMemory(globalMemory.getTotal());
statusMessage.setUsedMemory(globalMemory.getTotal() - globalMemory.getAvailable());
statusMessage.setUsedMemoryPercentage(numberFormat((double) statusMessage.getUsedMemory() / statusMessage.getTotalMemory()));
File file = new File(path);
statusMessage.setTotalSpace(file.getTotalSpace());
statusMessage.setUsedSpace(file.getTotalSpace() - file.getFreeSpace());
statusMessage.setUsedSpacePercentage(numberFormat((double) statusMessage.getUsedSpace() / statusMessage.getTotalSpace()));
statusMessage.setSystemLoad(OshiUtil.getHardware().getProcessor().getSystemLoadAverage(3));
statusMessage.setUsedCpuPercentage(numberFormat(100 - OshiUtil.getCpuInfo().getFree()));
statusMessage.setIoRead(ioRead);
statusMessage.setIoWrite(ioWrite);
statusMessage.setNetworkReceive(networkReceive);
statusMessage.setNetworkSend(networkSend);
statusMessage.setSystemUpTime(OshiUtil.getOs().getSystemUptime());
statusMessage.setSystemBootTime(OshiUtil.getOs().getSystemBootTime());
statusMessage.setMessageId(0);
statusMessage.setMessageType(0);
return statusMessage;
}
public static double numberFormat(double number){
if(number <= 0)
return number;
if(number < 1)
return Double.parseDouble(String.format("%.1f", number * 100));
else
return Double.parseDouble(String.format("%.1f", number));
}
public static String getIp(){
return networkIF.getIPv4addr()[0].split("/")[0];
}
public static void export(HttpServletRequest request, HttpServletResponse response, String path) {
File file = new File(path);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,18 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SNS</title>
<script type="module" crossorigin src="/index.js"></script>
<link rel="stylesheet" href="/index.css">
</head>
<body>
<div class="dom"></div>
<div id="app">
</div>
</body>
</html>