Skip to content

Commit

Permalink
optimization interface
Browse files Browse the repository at this point in the history
  • Loading branch information
lixinyang123 committed Jun 26, 2024
1 parent 93f9228 commit de76d16
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 249 deletions.
52 changes: 5 additions & 47 deletions css/cloudshell.css
Original file line number Diff line number Diff line change
@@ -1,48 +1,6 @@
#systemList {
margin-top: 30px;
margin-bottom: 30px;
}

#forwardPorts {
margin-bottom: 20px;
}

.system {
cursor: pointer;
margin-bottom: 10px;
overflow: hidden;
}

.card-img {
transition: transform 0.2s ease-out;
}

.system:hover .card-img {
transform: scale(1.07);
}

#shell iframe {
height: 80vh;
width: 100%;
border: 0;
}

#fullScreenFrame {
height: 100vh;
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 100;
}

.exitFullScreen {
position: fixed;
bottom: 20px;
right: 40px;
z-index: 200;
visibility: hidden;
cursor: pointer;
visibility: visible;
color: white;
iframe {
margin-top: 8px;
position: fixed;
width: 100%;
height: calc(100vh - 58px);
}
79 changes: 0 additions & 79 deletions css/favourites.css

This file was deleted.

4 changes: 0 additions & 4 deletions css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ body {
cursor: pointer;
}

#content {
flex: 1;
}

#loading {
padding-top: 3rem;
padding-bottom: 1rem;
Expand Down
3 changes: 2 additions & 1 deletion css/proxyservice.css → css/webproxy.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#bg input {
height: 45px;
width: calc(100% - 45px);
background-color: white;
border: 0;
border-radius: 50px;
Expand All @@ -25,4 +24,6 @@
height: 45px;
border-radius: 50%;
float: right;
position: absolute;
right: -1px;
}
81 changes: 0 additions & 81 deletions js/favourites.js

This file was deleted.

62 changes: 31 additions & 31 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@ function logout() {
location.reload();
}

async function getUser() {

let access_token = localStorage.getItem("access_token");

if (!access_token) {
document.querySelector("#userName").onclick = login;
return;
}

let res = await fetch("https://api.github.com/user", {
headers: {
accept: 'application/json',
Authorization: `token ${localStorage.getItem("access_token")}`
}
});

if (res.status == 200) {
userInfo = await res.json();
showInfo();
}
else {
alert("登陆失败,请重新登录");
logout();
}
}
// async function getUser() {

// let access_token = localStorage.getItem("access_token");

// if (!access_token) {
// document.querySelector("#userName").onclick = login;
// return;
// }

// let res = await fetch("https://api.github.com/user", {
// headers: {
// accept: 'application/json',
// Authorization: `token ${localStorage.getItem("access_token")}`
// }
// });

// if (res.status == 200) {
// userInfo = await res.json();
// showInfo();
// }
// else {
// alert("登陆失败,请重新登录");
// logout();
// }
// }

function showInfo() {
document.querySelector("#userName").setAttribute("data-toggle", "dropdown");
Expand Down Expand Up @@ -200,17 +200,17 @@ async function init() {
}

//获取当前用户
getUser();
// getUser();

//获取当前地址
let href = window.location.href;

//判断是否授权登陆
if (href.includes("#login")) {
let access_token = location.href.substring(location.href.indexOf("?") + 1);
localStorage.setItem("access_token", access_token);
window.location.href = "/";
}
// if (href.includes("#login")) {
// let access_token = location.href.substring(location.href.indexOf("?") + 1);
// localStorage.setItem("access_token", access_token);
// window.location.href = "/";
// }

//导航到指定页面
if (href.includes("#")) {
Expand Down
1 change: 0 additions & 1 deletion js/proxyservice.js → js/webproxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function search() {

function setBackground(bgHref) {
document.querySelector("#bg").style.backgroundImage = `url("${bgHref}")`;
document.querySelector("#bg h1").style.color = "white";
}

function initBackground() {
Expand Down
4 changes: 3 additions & 1 deletion view/cloudshell.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<iframe id="cloudshell" src="https://cloudshell.conchbrain.club" style="width: 100%; height: calc(100vh - 58px);" frameborder="0"></iframe>
<link rel="stylesheet" href="/css/cloudshell.css" />

<iframe id="cloudshell" src="https://cloudshell.conchbrain.club" frameborder="0"></iframe>

<script>
document.querySelector('footer').setAttribute('hidden', 'hidden')
Expand Down
9 changes: 9 additions & 0 deletions view/dockerproxy.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ <h5>Pull Image:</h5>
docker pull docker.conchbrain.club/ubuntu
</pre>

<p class="alert alert-success">
Using default tag: latest
latest: Pulling from ubuntu
9c704ecd0c69: Pull complete
Digest: sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30
Status: Downloaded newer image for docker.conchbrain.club/ubuntu:latest
docker.conchbrain.club/ubuntu:latest
</p>

<hr />

<h5>Global:</h5>
Expand Down
2 changes: 1 addition & 1 deletion view/intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h1 class="mb-3">我们不能在这里什么也不做!!</h1>
<i>"我实在不敢相信你们居然相信一个贝壳说的话!!"---章鱼哥</i>
</p>
<a class="btn btn-outline-light btn-lg w-100 mt-3" onclick="alert('开发中...')"
href="javascript:void(0);">动手试一试</a>
href="javascript:void(0);">试一试</a>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit de76d16

Please sign in to comment.