diff --git a/.gitignore b/.gitignore index 088f7fb..18b28a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ play-with-docker node_modules + +.idea diff --git a/docker-compose.yml b/docker-compose.yml index 52b883d..4ccdde4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,8 @@ services: - $GOPATH/src:/go/src environment: GOOGLE_RECAPTCHA_DISABLED: "true" + DIND_IMAGE: "hub.c.163.com/bingohuang/dind:17.04.0-ce-vfs" + EXPIRY: "3h" pwd2: # pwd daemon container always needs to be named this way container_name: pwd2 @@ -37,3 +39,5 @@ services: - $GOPATH/src:/go/src environment: GOOGLE_RECAPTCHA_DISABLED: "true" + DIND_IMAGE: "hub.c.163.com/bingohuang/dind:17.04.0-ce-vfs" + EXPIRY: "3h" diff --git a/www/assets/163yun-logo.png b/www/assets/163yun-logo.png new file mode 100755 index 0000000..bb62f5a Binary files /dev/null and b/www/assets/163yun-logo.png differ diff --git a/www/assets/app.js b/www/assets/app.js index a4d9dc0..1837825 100644 --- a/www/assets/app.js +++ b/www/assets/app.js @@ -5,11 +5,11 @@ // Automatically redirects user to a new session when bypassing captcha. // Controller keeps code/logic separate from the HTML - app.controller("BypassController", ['$scope', '$log', '$http', '$location', '$timeout', function($scope, $log, $http, $location, $timeout) { - setTimeout(function() { - document.getElementById("welcomeFormBypass").submit(); - }, 500); - }]); + // app.controller("BypassController", ['$scope', '$log', '$http', '$location', '$timeout', function($scope, $log, $http, $location, $timeout) { + // setTimeout(function() { + // document.getElementById("welcomeFormBypass").submit(); + // }, 500); + // }]); app.controller('PlayController', ['$scope', '$log', '$http', '$location', '$timeout', '$mdDialog', '$window', 'TerminalService', 'KeyboardShortcutService', 'InstanceService', function($scope, $log, $http, $location, $timeout, $mdDialog, $window, TerminalService, KeyboardShortcutService, InstanceService) { $scope.sessionId = window.location.pathname.replace('/p/', ''); @@ -20,8 +20,8 @@ $scope.ttl = '--:--:--'; $scope.connected = true; $scope.isInstanceBeingCreated = false; - $scope.newInstanceBtnText = '+ Add new instance'; - $scope.deleteInstanceBtnText = 'Delete'; + $scope.newInstanceBtnText = '+ 创建工作台'; + $scope.deleteInstanceBtnText = '删除工作台'; $scope.isInstanceBeingDeleted = false; var selectedKeyboardShortcuts = KeyboardShortcutService.getCurrentShortcuts(); @@ -44,7 +44,7 @@ .clickOutsideToClose(true) .title(title) .textContent(content) - .ok('Got it!') + .ok('收到!') ); } @@ -83,7 +83,7 @@ $scope.showInstance(i); }, function(response) { if (response.status == 409) { - $scope.showAlert('Max instances reached', 'Maximum number of instances reached') + $scope.showAlert('工作台到达上限', '工作台最大个数是 5,已达上限') } }).finally(function() { updateNewInstanceBtnState(false); @@ -120,7 +120,7 @@ }); socket.on('session end', function() { - $scope.showAlert('Session timed out!', 'Your session has expired and all of your instances have been deleted.', '#sessionEnd') + $scope.showAlert('实验室关门啦!', '你的实验室关门了,所有工作台都已删除。', '#sessionEnd') $scope.isAlive = false; }); @@ -178,7 +178,7 @@ if (inst) $scope.showInstance(inst); }, function(response) { if (response.status == 404) { - document.write('session not found'); + document.write('该实验室没找到'); return } }); @@ -291,20 +291,20 @@ function updateNewInstanceBtnState(isInstanceBeingCreated) { if (isInstanceBeingCreated === true) { - $scope.newInstanceBtnText = '+ Creating...'; + $scope.newInstanceBtnText = '+ 创建中...'; $scope.isInstanceBeingCreated = true; } else { - $scope.newInstanceBtnText = '+ Add new instance'; + $scope.newInstanceBtnText = '+ 创建工作台'; $scope.isInstanceBeingCreated = false; } } function updateDeleteInstanceBtnState(isInstanceBeingDeleted) { if (isInstanceBeingDeleted === true) { - $scope.deleteInstanceBtnText = 'Deleting...'; + $scope.deleteInstanceBtnText = '删除中...'; $scope.isInstanceBeingDeleted = true; } else { - $scope.deleteInstanceBtnText = 'Delete'; + $scope.deleteInstanceBtnText = '删除工作台'; $scope.isInstanceBeingDeleted = false; } } @@ -424,14 +424,17 @@ function getAvailablePresets() { return [ - { name : "None", presets : [ - { description : "Toggle terminal fullscreen", command : "Alt+enter", altKey : true, keyCode : 13, action : function(context) { TerminalService.toggleFullscreen(context.terminal, resizeFunc); }} - ] }, + { + name : "None", + presets : [ + { description : "全屏终端", command : "Alt+enter", altKey : true, keyCode : 13, action : function(context) { TerminalService.toggleFullscreen(context.terminal, resizeFunc); }} + ] + }, { name : "Mac OSX", presets : [ - { description : "Clear terminal", command : "Cmd+K", metaKey : true, keyCode : 75, action : function(context) { context.terminal.clear(); }}, - { description : "Toggle terminal fullscreen", command : "Alt+enter", altKey : true, keyCode : 13, action : function(context) { TerminalService.toggleFullscreen(context.terminal, resizeFunc); }} + { description : "清空终端", command : "Cmd+K", metaKey : true, keyCode : 75, action : function(context) { context.terminal.clear(); }}, + { description : "全屏终端", command : "Alt+enter", altKey : true, keyCode : 13, action : function(context) { TerminalService.toggleFullscreen(context.terminal, resizeFunc); }} ] } ] diff --git a/www/assets/baidu-tongji.js b/www/assets/baidu-tongji.js new file mode 100644 index 0000000..492c0cc --- /dev/null +++ b/www/assets/baidu-tongji.js @@ -0,0 +1,7 @@ +var _hmt = _hmt || []; +(function() { + var hm = document.createElement("script"); + hm.src = "https://hm.baidu.com/hm.js?e917a968ccce0f45ca7b7405bae48d9a"; + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(hm, s); +})(); diff --git a/www/assets/style.css b/www/assets/style.css index 6bfdd36..77606a7 100644 --- a/www/assets/style.css +++ b/www/assets/style.css @@ -49,3 +49,9 @@ md-input-container .md-errors-spacer { .stats { min-height: 230px; } + +.footer__copyright { + font-size: 14px; + position:absolute; + bottom: 0; +} diff --git a/www/bypass.html b/www/bypass.html index 62f1037..7665d52 100644 --- a/www/bypass.html +++ b/www/bypass.html @@ -1,17 +1,19 @@ - Docker Playground + Docker 在线实验室 +
-

Welcome!

-

We're bypassing the Captcha and redirecting you now..

+

欢迎来到 Docker 在线实验室!

+

请点击开始,无需安装任何环境,在线体验 Docker!

- +
+
diff --git a/www/index.html b/www/index.html index 089e506..f450ad3 100644 --- a/www/index.html +++ b/www/index.html @@ -1,20 +1,21 @@ - Docker Playground + Docker 在线实验室 - + - + + + + + + + + + @@ -23,7 +24,7 @@

- Your session has expired. + 你的实验室关门了

@@ -31,7 +32,7 @@
-

No connection to server. Reconnecting...

+

和实验室管理员失去联系,呼叫中...

@@ -42,11 +43,14 @@ md-is-locked-open="$mdMedia('gt-sm')" md-whiteframe="4" layout="column"> + {{ttl}} - Close session + 关闭实验室
-

Instances

+

工作台

@@ -62,11 +66,15 @@
+ +
-

Add instances to your playground.

-

Sessions and all their instances are deleted after {{ttl}} hours.

+

在你的实验室中添加工作台(独立的 Docker 环境)

+

当前实验室和所属工作台将在 {{ttl}} 后删除

@@ -92,7 +100,7 @@
- + @@ -116,10 +124,10 @@ diff --git a/www/welcome.html b/www/welcome.html index 12117a5..751b9db 100644 --- a/www/welcome.html +++ b/www/welcome.html @@ -2,15 +2,16 @@ - Docker Playground + Docker 在线实验室 +
-

Welcome!

-

Before starting we need to verify you are a human

+

欢迎来到 Docker 在线实验室!

+

请先确认你不是机器人哦!