Compare commits

..

No commits in common. 'master' and 'ykf' have entirely different histories.
master ... ykf

@ -18,7 +18,7 @@
<header class="top-navigation"> <header class="top-navigation">
<div class="container"> <div class="container">
<a class="logo" aria-label="MDN homepage"><svg id="mdn-docs-logo" x="0" y="0" viewBox="0 0 694.9 10.4" style="enable-background:new 0 0 694.9 104.4" role="img"><title>MDN Web Docs</title> <a class="logo" aria-label="MDN homepage"><svg id="mdn-docs-logo" x="0" y="0" viewBox="0 0 694.9 10.4" style="enable-background:new 0 0 694.9 104.4" role="img"><title>MDN Web Docs</title>
<button title="Open main menu" type="button" class="button action has-icon main-menu-toggle" aria-haspopup="true" aria-label="Open main menu" aria-expanded="true"><span class="button-wrap"><span class="icon icon-menu "></span><span class="visually-hidden"><a href="MainPageUI.html">Open main menu</a></span></span></button> <button title="Open main menu" type="button" class="button action has-icon main-menu-toggle" aria-haspopup="true" aria-label="Open main menu" aria-expanded="true"><span class="button-wrap"><span class="icon icon-menu "></span><span class="visually-hidden">Open main menu</span></span></button>
</div> </div>
</header> </header>
<body> <body>

@ -20,9 +20,6 @@
<style> <style>
/* 让页面所有元素的padding和margin都设置为0 */ /* 让页面所有元素的padding和margin都设置为0 */
/*{margin:0;padding:0;box-sizing:border-box;}*/ /*{margin:0;padding:0;box-sizing:border-box;}*/
h3{
right: 0;
}
.wrapper { .wrapper {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
@ -57,7 +54,7 @@ input{
letter-spacing:2px; letter-spacing:2px;
} }
.imgBox{ .imgBox{
padding-top: 180px; padding-top: 80px;
border-top: 2px solid cadetblue; border-top: 2px solid cadetblue;
width: 100%; width: 100%;
height: 450px; height: 450px;
@ -68,14 +65,14 @@ input{
height: 450px; height: 450px;
margin: 0 auto; margin: 0 auto;
padding-top: 30px; padding-top: 30px;
}
}
.img1{ .img1{
display: block; display: block;
} }
.img2{ .img2{
display: none display: block;
} }
.img3{ .img3{
@ -107,8 +104,7 @@ form button{
} }
</style> </style>
</head> </head>
<body>
<body style="background-image:url('./assets/images/R-C\ \(1\).png'); background-repeat:no-repeat; background-position:center center; background-attachment:fixed; background-size:cover;">
<div class="wrapper"> <div class="wrapper">
<div class="box1"> <div class="box1">
<div class="headtop"></div> <div class="headtop"></div>
@ -129,11 +125,11 @@ form button{
</div> </div>
<div class="imgBox"> <div class="imgBox">
<img class="img-slide img1" <img class="img-slide img1"
src="./assets/images/img1.jpg" src="./assets/images/bg.png"
alt="1" alt="1"
/> />
<img class="img-slide img2" <img class="img-slide img2"
src="./assets/images/img2.jpg" src="./assets/images/dove.png"
alt="2" alt="2"
/> />
</div> </div>
@ -153,6 +149,6 @@ function ChangeImg() {
a[index].style.display='block'; a[index].style.display='block';
} }
//设置定时器,每隔两秒切换一张图片 //设置定时器,每隔两秒切换一张图片
setInterval(ChangeImg,8000); setInterval(ChangeImg,2000);
</script> </script>
</html> </html>

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 173 KiB

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Before

Width:  |  Height:  |  Size: 155 KiB

After

Width:  |  Height:  |  Size: 155 KiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Before

Width:  |  Height:  |  Size: 740 KiB

After

Width:  |  Height:  |  Size: 740 KiB

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 516 B

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@ -1,9 +0,0 @@
FROM openjdk:23-slim-bullseye
WORKDIR /opt/app
ARG JAR_FILE=target/spring-boot-web.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT [ "java","-jar","app.jar" ]
EXPOSE 8080

@ -1,15 +0,0 @@
构建docker镜像
```shell
docker build -t nudt-demo:1.0 .
```
运行docker镜像
```shell
docker run -d -p 8080:8080 -e demo.server.name=test1 nudt-demo:1.0
```
注意哦,其中`demo.server.name`是容器的名称,可自定义,例如,要启动两个容器实例,可执行:
```shell
docker run -d --network nudt --network-alias server1 -p 8080:8080 -e demo.server.name=server1 nudt-demo:1.0
docker run -d --network nudt --network-alias server2 -p 8081:8080 -e demo.server.name=server2 nudt-demo:1.0
```
其中,`--network nudt`表示将当前容器加入名为nudt的网络如果该网络不存在需要提前使用`docker network create nudt`命令创建网络;`--network-alias <alias-name>`表示将当前容器的网络主机名设置为`alias-name`

@ -1,66 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<relativePath/>
</parent>
<groupId>edu.nudt</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<finalName>spring-boot-web</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -1,27 +0,0 @@
package edu.nudt.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.beans.factory.annotation.Value;
@SpringBootApplication
@Controller
public class DemoApplication {
@Value("${demo.server.name}")
private String serverName;
@GetMapping("/")
public String index(final Model model) {
model.addAttribute("title", "Backend Server: " + serverName);
model.addAttribute("msg", "欢迎来到分布式计算的世界!");
return "index";
}
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}

@ -1,3 +0,0 @@
spring.application.name=demo
demo.server.name="001"

@ -1,26 +0,0 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"/>
<link data-th-href="@{/css/main.css?{id}(id=${timestamp})}" rel="stylesheet">
<title>Hello Docker + Spring Boot</title>
</head>
<body>
<!-- <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#">Mkyong.com</div></a>
</nav> -->
<main role="main" class="container">
<div class="starter-template">
<h1 th:text="${title}">Default title.</h1>
<p th:text="${msg}">Default text.</p>
</div>
</main>
<script data-th-src="@{/js/main.js}"></script>
</body>
</html>

@ -1,13 +0,0 @@
package edu.nudt.demo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class DemoApplicationTests {
@Test
void contextLoads() {
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save