Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

video_log
anke1460 5 years ago
commit 428b899d57

@ -9,7 +9,7 @@ class Admins::DashboardsController < Admins::BaseController
shixun_tomcat = edu_setting('cloud_bridge')
uri = "#{shixun_tomcat}/bridge/monitor/getPodsInfo"
res = interface_post uri, params, 502, "数据接口延迟"
res = interface_get uri, 502, "数据接口延迟"
if res['code'] == 0
@pod_num = res['sum'] || 0
end

@ -448,6 +448,25 @@ class ApplicationController < ActionController::Base
end
end
# 无参类型处理
def interface_get(uri, status, message)
begin
uid_logger_dubug("--uri_exec: url is #{uri}")
uri = URI.parse(URI.encode(uri.strip))
res = Net::HTTP.get(uri)
uid_logger_dubug("--uri_exec: .....res is #{res}")
res = JSON.parse(res)
if (res && res['code'] != 0)
tip_exception(status, message)
else
res
end
rescue Exception => e
uid_logger("--uri_exec: exception #{e.message}")
raise Educoder::TipException.new(message)
end
end
# json格式请求
def interface_json_post(uri, params, status, message)
begin

@ -65,33 +65,35 @@
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="card card-stats mb-4 mb-xl-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">当前在线用户数</h5>
<span class="h2 font-weight-bold mb-0"><%= UserOnline.count %></span>
<h5 class="card-title text-uppercase text-muted mb-0">30天内新增用户数</h5>
<span class="h2 font-weight-bold mb-0"><%= @new_user_count %></span>
</div>
<div class="col-auto">
<div class="icon icon-shape rounded-circle shadow">
<i class="fa fa-users"></i>
<i class="fa fa-user-plus"></i>
</div>
</div>
</div>
<!-- <p class="mt-3 mb-0 text-muted text-sm">-->
<!-- <span class="text-success mr-2"><i class="fas fa-arrow-up"></i> 12%</span>-->
<!-- <span class="text-nowrap">Since last month</span>-->
<!-- </p>-->
</div>
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="col-xl-3 col-lg-6" style="padding-top: 15px;">
<div class="card card-stats mb-4 mb-xl-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">当前Pod总数</h5>
<span class="h2 font-weight-bold mb-0"><%= @pod_num.to_i %></span>
<h5 class="card-title text-uppercase text-muted mb-0">当前在线用户数</h5>
<span class="h2 font-weight-bold mb-0"><%= UserOnline.count %></span>
</div>
<div class="col-auto">
<div class="icon icon-shape rounded-circle shadow">
@ -104,27 +106,25 @@
</div>
</div>
<div class="col-xl-3 col-lg-6">
<div class="col-xl-3 col-lg-6" style="padding-top: 15px;">
<div class="card card-stats mb-4 mb-xl-0">
<div class="card-body">
<div class="row">
<div class="col">
<h5 class="card-title text-uppercase text-muted mb-0">30天内新增用户数</h5>
<span class="h2 font-weight-bold mb-0"><%= @new_user_count %></span>
<h5 class="card-title text-uppercase text-muted mb-0">当前Pod总数</h5>
<span class="h2 font-weight-bold mb-0"><%= @pod_num.to_i %></span>
</div>
<div class="col-auto">
<div class="icon icon-shape rounded-circle shadow">
<i class="fa fa-user-plus"></i>
<i class="fa fa-users"></i>
</div>
</div>
</div>
<!-- <p class="mt-3 mb-0 text-muted text-sm">-->
<!-- <span class="text-success mr-2"><i class="fas fa-arrow-up"></i> 12%</span>-->
<!-- <span class="text-nowrap">Since last month</span>-->
<!-- </p>-->
</div>
</div>
</div>
</div>
</div>
</div>

@ -38,6 +38,7 @@ module Educoderplus
origins '*'
# location of your api
resource '/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put]
resource 'http://outin-396971199eed11e991a100163e1c7426.oss-cn-shanghai.aliyuncs.com/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put]
end
end
end

@ -5138,6 +5138,15 @@
"readable-stream": "^2.3.6"
}
},
"flv.js": {
"version": "1.5.0",
"resolved": "https://registry.npm.taobao.org/flv.js/download/flv.js-1.5.0.tgz",
"integrity": "sha1-+lm+1DkdcENc+odArEDsAHDvmK4=",
"requires": {
"es6-promise": "^4.2.5",
"webworkify": "^1.5.0"
}
},
"fmin": {
"version": "0.0.2",
"resolved": "https://registry.npm.taobao.org/fmin/download/fmin-0.0.2.tgz",
@ -14598,17 +14607,6 @@
}
}
},
"react-flv-player": {
"version": "1.0.9",
"resolved": "https://registry.npm.taobao.org/react-flv-player/download/react-flv-player-1.0.9.tgz",
"integrity": "sha1-PYPwacfuoALt9rqlXB+JFZvHyWk=",
"requires": {
"babel-preset-react": "^6.24.1",
"object-assign": "^4.1.1",
"prop-types": "^15.6.0",
"react": "^16.8.6"
}
},
"react-hot-loader": {
"version": "4.8.3",
"resolved": "http://registry.npm.taobao.org/react-hot-loader/download/react-hot-loader-4.8.3.tgz",
@ -18422,6 +18420,11 @@
"resolved": "http://registry.npm.taobao.org/websocket-extensions/download/websocket-extensions-0.1.3.tgz",
"integrity": "sha1-XS/yKXcAPsaHpLhwc9+7rBRszyk="
},
"webworkify": {
"version": "1.5.0",
"resolved": "https://registry.npm.taobao.org/webworkify/download/webworkify-1.5.0.tgz",
"integrity": "sha1-c0rYendN5uvdVG4dPgJ9pbj0pCw="
},
"whatwg-encoding": {
"version": "1.0.5",
"resolved": "http://registry.npm.taobao.org/whatwg-encoding/download/whatwg-encoding-1.0.5.tgz",

@ -39,6 +39,7 @@
"eslint-plugin-react": "7.4.0",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.5",
"flv.js": "^1.5.0",
"fs-extra": "3.0.1",
"html-webpack-plugin": "2.29.0",
"immutability-helper": "^2.6.6",
@ -78,7 +79,6 @@
"react-cookies": "^0.1.1",
"react-dev-utils": "^5.0.0",
"react-dom": "^16.9.0",
"react-flv-player": "^1.0.9",
"react-hot-loader": "^4.0.0",
"react-infinite-scroller": "^1.2.4",
"react-loadable": "^5.3.1",

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="utf-8">
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
@ -12,12 +13,15 @@
<meta name=”Keywords” Content=”翻转课堂,高效课堂创建,教学模式″>
<meta name=”Keywords” Content=”实训项目,python教程,C语言入门,java书,php后端开发,app前端开发,数据库技术″>
<meta name=”Keywords” Content=”在线竞赛,计算机应用大赛,编程大赛,大学生计算机设计大赛,全国高校绿色计算机大赛″>
<meta name=”Description” Content=”EduCoder是信息技术类实践教学平台。EduCoder涵盖了计算机、大数据、云计算、人工智能、软件工程、物联网等专业课程。超10000个实训案例及22000个技能评测点建立学、练、评、测一体化实验环境。”>
<meta name=”Description” Content=”EduCoder实践课程旨在于通过企业级实战实训案例帮助众多程序员提升各项业务能力。解决学生、学员、企业员工等程序设计能力、算法设计能力、问题求解能力、应用开发能力、系统运维能力等。”>
<meta name=”Description” Content=”EduCoder翻转课堂教学模式颠覆了传统教学模式让教师与学生的关系由“权威”变成了“伙伴”。将学习的主动权转交给学生使学生可个性化化学学生的学习主体得到了彰显。”>
<meta name=”Description”
Content=”EduCoder是信息技术类实践教学平台。EduCoder涵盖了计算机、大数据、云计算、人工智能、软件工程、物联网等专业课程。超10000个实训案例及22000个技能评测点建立学、练、评、测一体化实验环境。”>
<meta name=”Description”
Content=”EduCoder实践课程旨在于通过企业级实战实训案例帮助众多程序员提升各项业务能力。解决学生、学员、企业员工等程序设计能力、算法设计能力、问题求解能力、应用开发能力、系统运维能力等。”>
<meta name=”Description”
Content=”EduCoder翻转课堂教学模式颠覆了传统教学模式让教师与学生的关系由“权威”变成了“伙伴”。将学习的主动权转交给学生使学生可个性化化学学生的学习主体得到了彰显。”>
<meta name=”Description” Content=”EduCoder实训项目为单个知识点关卡实践训练帮助学生巩固单一弱点强化学习。 >
<meta name=”Description” Content=”EduCoder实践教学平台各类大赛为进一步提高各类学生综合运用高级语言程序设计能力培养创新意识和实践探索精神发掘优秀软件人才。 >
<!-- <meta name="viewport" id="viewport" content="width=device-width, initial-scale=0.3, maximum-scale=0.3, user-scalable=no">-->
<!-- <meta name="viewport" id="viewport" content="width=device-width, initial-scale=0.3, maximum-scale=0.3, user-scalable=no">-->
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=0.3, maximum-scale=0.3">
<meta name="theme-color" content="#000000">
@ -27,7 +31,7 @@
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<!-- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">-->
<!-- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">-->
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
@ -37,15 +41,15 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<!-- <title>EduCoder</title>-->
<!-- <title>EduCoder</title>-->
<!--react-ssr-head-->
<script type="text/javascript">
window.__isR = true;
// 不支持ie9 ie10
if (
( navigator.userAgent.indexOf('MSIE 9') != -1
|| navigator.userAgent.indexOf('MSIE 10') != -1 )
(navigator.userAgent.indexOf('MSIE 9') != -1
|| navigator.userAgent.indexOf('MSIE 10') != -1)
&&
location.pathname.indexOf("/compatibility") == -1) {
debugger;
@ -103,8 +107,9 @@
user-select: none;
</style>
</head>
<body>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
@ -136,44 +141,13 @@
<div id="picture_display" style="display: none;"></div>
<!-- js css合并 文件优先级的问题 -->
<script type="text/javascript" src="/js/js_min_all.js"></script>
<!-- <script type="text/javascript" src="/js/js_min_all_2.js"></script> -->
<!--
<script type="text/javascript" src="/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="/js/editormd/underscore.min.js"></script>
<script type="text/javascript" src="/js/editormd/marked.min.js"></script>
<script type="text/javascript" src="/js/editormd/prettify.min.js"></script>
<script type="text/javascript" src="/js/editormd/raphael.min.js"></script>
<script type="text/javascript" src="/js/editormd/sequence-diagram.min.js"></script>
<script type="text/javascript" src="/js/editormd/flowchart.min.js"></script>
<script type="text/javascript" src="/js/editormd/jquery.flowchart.min.js"></script>
<script type="text/javascript" src="/js/editormd/editormd.min.js"></script>
-->
<!-- codemirror addon -->
<!--
<script type="text/javascript" src="/js/codemirror/codemirror.js"></script>
<script type="text/javascript" src="/js/codemirror/mode/javascript.js"></script>
<script type="text/javascript" src="/js/diff_match_patch.js"></script>
<script type="text/javascript" src="/js/merge.js"></script>
<script type="text/javascript" src="/js/edu_tpi.js"></script>
-->
<!-- testbdweb.trustie.net testbdweb.educoder.net -->
<script type="text/javascript" src="/js/flv.min.js"></script>
<!-- 在tpi js里加载这3个脚本 -->
<script>
(function() { // Scoping function to avoid globals
(function () { // Scoping function to avoid globals
var href = location.href;
if(window.location.port === "3007"){
if (window.location.port === "3007") {
if (href.indexOf('/tasks/') != -1) {
document.write('<script type="text/javascript" src="https://newweb.educoder.net/assets/kindeditor/kindeditor.js"><\/script>');
// build.js中会将这个url附加一个前缀 react/build
@ -183,7 +157,7 @@
document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>');
}
}else{
} else {
if (href.indexOf('/tasks/') != -1) {
document.write('<script type="text/javascript" src="/assets/kindeditor/kindeditor.js"><\/script>');
// build.js中会将这个url附加一个前缀 react/build
@ -203,10 +177,11 @@
<script type="text/javascript" src="https://testeduplus2.educoder.net/javascripts/educoder/edu_application.js"></script> -->
<script type="text/javascript" src="https://cdn.bootcss.com/quill/1.3.7/quill.core.min.js"></script>
<!-- <script>-->
<!-- document.body.addEventListener('touchmove', function (e) {-->
<!-- e.preventDefault(); //阻止默认的处理方式(阻止下拉滑动的效果)-->
<!-- }, {passive: false});-->
<!-- </script>-->
</body>
<!-- <script>-->
<!-- document.body.addEventListener('touchmove', function (e) {-->
<!-- e.preventDefault(); //阻止默认的处理方式(阻止下拉滑动的效果)-->
<!-- }, {passive: false});-->
<!-- </script>-->
</body>
</html>

File diff suppressed because one or more lines are too long

@ -209,7 +209,9 @@ function generateNewIndexJsp() {
} else if (window.location.host == 'www.educoder.net') {
_host = 'https://ali-cdn.educoder.net/react/build/'
}
document.write('<script type="text/javascript" src="' + _host + 'js/js_min_all.js"><\\/script>');
document.write('<script type="text/javascript" src="' + _host + 'js/flv.min.js"><\\/script>');
document.write('<script type="text/javascript" src="' + _host + 'static/js/main.${matchResult[1]}.js"><\\/script>');
})()
</script>

@ -0,0 +1,37 @@
import React, { useEffect, useRef } from 'react'
export default ({ url }) => {
const ref = useRef()
useEffect(() => {
let player = null
if (window.flvjs.isSupported) {
player = window.flvjs.createPlayer({
type: 'flv',
volume: 0.8,
cors: true,
url,
muted: false
})
if (ref.current) {
player.attachMediaElement(ref.current)
player.load()
player.play()
}
}
return () => {
if (player) {
player.unload()
player.pause()
player.destroy()
player = null
}
}
}, [url, ref.current])
return (
<video ref={ref} controls autoPlay={true} muted={false} className="flv-player"></video>
)
}

@ -1,5 +1,5 @@
import React, { Fragment } from 'react'
import { ReactFlvPlayer } from 'react-flv-player'
import ReactFlvPlayer from './flv-player'
export default ({ src }) => {
const suf = src.split('.').pop()

@ -74,7 +74,10 @@ function VideoUploadList (props) {
clearInput()
return;
}
if (file.size >(parseInt(MAX_FILE_SIZE) * 1024 * 1024)) {
if(props&&props.user.admin===true||props&&props.user.business===true){
}else if (file.size >(parseInt(MAX_FILE_SIZE) * 1024 * 1024)) {
// 超过500m TODO
clearInput()
showNotification(`视频大小超过${MAX_FILE_SIZE}M`)

Loading…
Cancel
Save