mirror of
https://github.com/Monibuca/plugin-ts.git
synced 2025-10-29 01:43:10 +08:00
first commit
This commit is contained in:
5
go.mod
5
go.mod
@@ -2,4 +2,7 @@ module github.com/Monibuca/plugin-ts
|
||||
|
||||
go 1.13
|
||||
|
||||
require github.com/Monibuca/engine/v2 v2.2.8
|
||||
require (
|
||||
github.com/Monibuca/engine/v3 v3.0.0-alpha3
|
||||
github.com/Monibuca/utils/v3 v3.0.0-alpha3
|
||||
)
|
||||
|
||||
37
go.sum
37
go.sum
@@ -1,38 +1,25 @@
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Monibuca/engine/v2 v2.2.7 h1:+aN2Kbmc6xszEjam/GT0C69yU7N7b5uvBrvdBrWNhWU=
|
||||
github.com/Monibuca/engine/v2 v2.2.7/go.mod h1:34EYjjV15G6myuHOKaJkO7y5tJ1Arq/NfC9Weacr2mc=
|
||||
github.com/Monibuca/engine/v2 v2.2.8 h1:0TbxvKOr4fViizoyrTJ/fs6MhgeFJtSlvLD7vd35zUE=
|
||||
github.com/Monibuca/engine/v2 v2.2.8/go.mod h1:34EYjjV15G6myuHOKaJkO7y5tJ1Arq/NfC9Weacr2mc=
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
|
||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/Monibuca/engine/v3 v3.0.0-alpha2 h1:11rWc6Qnp3kuVwGh8XDXqRivUSWMyv+Au6wZDgNHPSc=
|
||||
github.com/Monibuca/engine/v3 v3.0.0-alpha2/go.mod h1:K5FB3wk+iS/nPc+NS4XwObYQV4gtF6klEwDxaVM0BsQ=
|
||||
github.com/Monibuca/engine/v3 v3.0.0-alpha3 h1:NtFBMsu1nvEA09q64sW9xNzLdQ9RCKQXJlESM3GmGxU=
|
||||
github.com/Monibuca/engine/v3 v3.0.0-alpha3/go.mod h1:K5FB3wk+iS/nPc+NS4XwObYQV4gtF6klEwDxaVM0BsQ=
|
||||
github.com/Monibuca/utils/v3 v3.0.0-alpha3 h1:n4Sq7mS1Iz8oBj2BcV4sXgKbZgix0fFLvjAfXYoiXl0=
|
||||
github.com/Monibuca/utils/v3 v3.0.0-alpha3/go.mod h1:3xYmhQbgAZBHLyIMteUCd1va+1z/xnd72B585mCaT3c=
|
||||
github.com/funny/slab v0.0.0-20180511031532-b1fad5e5d478 h1:Db9StoJ6RZN3YttC0Pm0I4Y5izITRYch3RMbT59BYN0=
|
||||
github.com/funny/slab v0.0.0-20180511031532-b1fad5e5d478/go.mod h1:0j1+svBH8ABEIPdUP0AIg4qedsybnXGJBakCEw8cfoo=
|
||||
github.com/funny/utest v0.0.0-20161029064919-43870a374500 h1:Z0r1CZnoIWFB/Uiwh1BU5FYmuFe6L5NPi6XWQEmsTRg=
|
||||
github.com/funny/utest v0.0.0-20161029064919-43870a374500/go.mod h1:mUn39tBov9jKnTWV1RlOYoNzxdBFHiSzXWdY1FoNGGg=
|
||||
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
|
||||
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
|
||||
github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 h1:bqDmpDG49ZRnB5PcgP0RXtQvnMSgIF14M7CBd2shtXs=
|
||||
github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
||||
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8=
|
||||
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
||||
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
|
||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/shirou/gopsutil v2.20.1+incompatible h1:oIq9Cq4i84Hk8uQAUOG3eNdI/29hBawGrD5YRl6JRDY=
|
||||
github.com/shirou/gopsutil v2.20.1+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
|
||||
114
main.go
114
main.go
@@ -11,10 +11,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
. "github.com/Monibuca/engine/v2"
|
||||
"github.com/Monibuca/engine/v2/avformat"
|
||||
"github.com/Monibuca/engine/v2/avformat/mpegts"
|
||||
"github.com/Monibuca/engine/v2/util"
|
||||
. "github.com/Monibuca/engine/v3"
|
||||
"github.com/Monibuca/utils/v3"
|
||||
"github.com/Monibuca/utils/v3/codec"
|
||||
"github.com/Monibuca/utils/v3/codec/mpegts"
|
||||
)
|
||||
|
||||
var config = struct {
|
||||
@@ -26,7 +26,6 @@ var config = struct {
|
||||
func init() {
|
||||
InstallPlugin(&PluginConfig{
|
||||
Name: "TS",
|
||||
Type: PLUGIN_PUBLISHER,
|
||||
Config: &config,
|
||||
HotConfig: map[string]func(interface{}){
|
||||
"AutoPublish": func(value interface{}) {
|
||||
@@ -34,14 +33,16 @@ func init() {
|
||||
},
|
||||
},
|
||||
Run: func() {
|
||||
OnSubscribeHooks.AddHook(func(s *Subscriber) {
|
||||
http.HandleFunc("/ts/list", listTsDir)
|
||||
http.HandleFunc("/ts/publish", publishTsDir)
|
||||
onSubscribe := make(chan interface{}, 0)
|
||||
AddHook(HOOK_SUBSCRIBE, onSubscribe)
|
||||
for x := range onSubscribe {
|
||||
s := x.(*Subscriber)
|
||||
if config.AutoPublish && s.Publisher == nil {
|
||||
go new(TS).PublishDir(s.StreamPath)
|
||||
}
|
||||
})
|
||||
|
||||
http.HandleFunc("/ts/list", listTsDir)
|
||||
http.HandleFunc("/ts/publish", publishTsDir)
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -53,32 +54,20 @@ type TSDir struct {
|
||||
}
|
||||
type TS struct {
|
||||
Publisher
|
||||
*mpegts.MpegTsStream
|
||||
TSInfo
|
||||
//TsChan chan io.Reader
|
||||
lastDts uint64
|
||||
}
|
||||
type TSInfo struct {
|
||||
TotalPesCount int
|
||||
IsSplitFrame bool
|
||||
PTS uint64
|
||||
DTS uint64
|
||||
PesCount int
|
||||
BufferLength int
|
||||
StreamInfo *StreamInfo
|
||||
*mpegts.MpegTsStream `json:"-"`
|
||||
TotalPesCount int
|
||||
IsSplitFrame bool
|
||||
PTS uint64
|
||||
DTS uint64
|
||||
PesCount int
|
||||
BufferLength int //TsChan chan io.Reader
|
||||
lastDts uint64
|
||||
}
|
||||
|
||||
func (ts *TS) run() {
|
||||
//defer close(ts.TsChan)
|
||||
totalBuffer := cap(ts.TsPesPktChan)
|
||||
iframeHead := []byte{0x17, 0x01, 0, 0, 0}
|
||||
pframeHead := []byte{0x27, 0x01, 0, 0, 0}
|
||||
spsHead := []byte{0xE1, 0, 0}
|
||||
ppsHead := []byte{0x01, 0, 0}
|
||||
nalLength := []byte{0, 0, 0, 0}
|
||||
defer func(){
|
||||
ts.AVRing.Done()
|
||||
}()
|
||||
defer ts.Dispose()
|
||||
for {
|
||||
select {
|
||||
case <-ts.Done():
|
||||
@@ -97,7 +86,22 @@ func (ts *TS) run() {
|
||||
if frameLen > remainLen {
|
||||
break
|
||||
}
|
||||
ts.PushAudio(uint32(tsPesPkt.PesPkt.Header.Pts/90), data[:frameLen])
|
||||
payload := data[:frameLen]
|
||||
if ts.AudioTracks[0].RtmpTag == nil {
|
||||
if payload[0] == 0xFF && (payload[1]&0xF0) == 0xF0 {
|
||||
//将ADTS转换成ASC
|
||||
ts.AudioTracks[0].SoundFormat = 10
|
||||
ts.AudioTracks[0].SoundRate = codec.SamplingFrequencies[(payload[2]&0x3c)>>2]
|
||||
ts.AudioTracks[0].SoundType = ((payload[2] & 0x1) << 2) | ((payload[3] & 0xc0) >> 6)
|
||||
ts.AudioTracks[0].RtmpTag = codec.ADTSToAudioSpecificConfig(payload)
|
||||
ts.AudioTracks[0].Push(uint32(tsPesPkt.PesPkt.Header.Pts/90), payload[7:])
|
||||
} else {
|
||||
ts.AudioTracks[0].SoundFormat = 2
|
||||
ts.AudioTracks[0].Push(uint32(tsPesPkt.PesPkt.Header.Pts/90), payload)
|
||||
}
|
||||
} else if ts.AudioTracks[0].SoundFormat == 10 {
|
||||
ts.AudioTracks[0].Push(uint32(tsPesPkt.PesPkt.Header.Pts/90), payload[7:])
|
||||
}
|
||||
data = data[frameLen:remainLen]
|
||||
remainLen = remainLen - frameLen
|
||||
}
|
||||
@@ -115,62 +119,28 @@ func (ts *TS) run() {
|
||||
if ts.lastDts == 0 {
|
||||
ts.lastDts = dts
|
||||
}
|
||||
compostionTime := uint32((pts - dts) / 90)
|
||||
// compostionTime := uint32((pts - dts) / 90)
|
||||
t1 := time.Now()
|
||||
duration := time.Millisecond * time.Duration((dts-ts.lastDts)/90)
|
||||
ts.lastDts = dts
|
||||
nalus0 := bytes.SplitN(tsPesPkt.PesPkt.Payload, avformat.NALU_Delimiter2, -1)
|
||||
nalus0 := bytes.SplitN(tsPesPkt.PesPkt.Payload, codec.NALU_Delimiter2, -1)
|
||||
nalus := make([][]byte, 0)
|
||||
for _, v := range nalus0 {
|
||||
if len(v) == 0 {
|
||||
continue
|
||||
}
|
||||
nalus = append(nalus, bytes.SplitN(v, avformat.NALU_Delimiter1, -1)...)
|
||||
nalus = append(nalus, bytes.SplitN(v, codec.NALU_Delimiter1, -1)...)
|
||||
}
|
||||
r := bytes.NewBuffer([]byte{})
|
||||
for _, v := range nalus {
|
||||
vl := len(v)
|
||||
if vl == 0 {
|
||||
continue
|
||||
}
|
||||
isFirst := v[1]&0x80 == 0x80 //第一个分片
|
||||
switch v[0] & 0x1f {
|
||||
case avformat.NALU_SPS:
|
||||
r.Write(avformat.RTMP_AVC_HEAD)
|
||||
util.BigEndian.PutUint16(spsHead[1:], uint16(vl))
|
||||
_, err = r.Write(spsHead)
|
||||
case avformat.NALU_PPS:
|
||||
util.BigEndian.PutUint16(ppsHead[1:], uint16(vl))
|
||||
_, err = r.Write(ppsHead)
|
||||
_, err = r.Write(v)
|
||||
ts.PushVideo(0, r.Bytes())
|
||||
r = bytes.NewBuffer([]byte{})
|
||||
continue
|
||||
case avformat.NALU_IDR_Picture:
|
||||
if isFirst {
|
||||
util.BigEndian.PutUint24(iframeHead[2:], compostionTime)
|
||||
_, err = r.Write(iframeHead)
|
||||
}
|
||||
util.BigEndian.PutUint32(nalLength, uint32(vl))
|
||||
_, err = r.Write(nalLength)
|
||||
case avformat.NALU_Non_IDR_Picture:
|
||||
if isFirst {
|
||||
util.BigEndian.PutUint24(pframeHead[2:], compostionTime)
|
||||
_, err = r.Write(pframeHead)
|
||||
} else {
|
||||
ts.IsSplitFrame = true
|
||||
}
|
||||
util.BigEndian.PutUint32(nalLength, uint32(vl))
|
||||
_, err = r.Write(nalLength)
|
||||
default:
|
||||
continue
|
||||
}
|
||||
_, err = r.Write(v)
|
||||
ts.PushVideo(uint32(dts/90), v)
|
||||
}
|
||||
if MayBeError(err) {
|
||||
if utils.MayBeError(err) {
|
||||
return
|
||||
}
|
||||
ts.PushVideo(uint32(dts/90), r.Bytes())
|
||||
t2 := time.Since(t1)
|
||||
if duration != 0 && t2 < duration {
|
||||
if duration < time.Second {
|
||||
@@ -194,7 +164,6 @@ func (ts *TS) run() {
|
||||
func (ts *TS) Publish(streamPath string) (result bool) {
|
||||
if result = ts.Publisher.Publish(streamPath); result {
|
||||
ts.Type = "TS"
|
||||
ts.TSInfo.StreamInfo = &ts.Stream.StreamInfo
|
||||
ts.MpegTsStream = mpegts.NewMpegTsStream(config.BufferLength)
|
||||
go ts.run()
|
||||
}
|
||||
@@ -208,7 +177,6 @@ func (ts *TS) PublishDir(streamPath string) {
|
||||
}
|
||||
if ts.Publisher.Publish(strings.ReplaceAll(streamPath, "\\", "/")) {
|
||||
ts.Type = "TSFiles"
|
||||
ts.TSInfo.StreamInfo = &ts.Stream.StreamInfo
|
||||
ts.MpegTsStream = mpegts.NewMpegTsStream(0)
|
||||
go ts.run()
|
||||
for _, file := range files {
|
||||
|
||||
19
ui/dist/demo.html
vendored
19
ui/dist/demo.html
vendored
@@ -1,19 +0,0 @@
|
||||
<meta charset="utf-8">
|
||||
<title>plugin-ts demo</title>
|
||||
<script src="https://unpkg.com/vue"></script>
|
||||
<script src="./plugin-ts.umd.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="./plugin-ts.css">
|
||||
|
||||
|
||||
<div id="app">
|
||||
<demo></demo>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
components: {
|
||||
demo: plugin-ts
|
||||
}
|
||||
}).$mount('#app')
|
||||
</script>
|
||||
361
ui/dist/plugin-ts.common.js
vendored
361
ui/dist/plugin-ts.common.js
vendored
@@ -1,361 +0,0 @@
|
||||
module.exports =
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "b3d5":
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_id_478276ba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ccbd");
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_id_478276ba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_id_478276ba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* unused harmony reexport * */
|
||||
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_id_478276ba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "ccbd":
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "f6fd":
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
// document.currentScript polyfill by Adam Miller
|
||||
|
||||
// MIT license
|
||||
|
||||
(function(document){
|
||||
var currentScript = "currentScript",
|
||||
scripts = document.getElementsByTagName('script'); // Live NodeList collection
|
||||
|
||||
// If browser needs currentScript polyfill, add get currentScript() to the document object
|
||||
if (!(currentScript in document)) {
|
||||
Object.defineProperty(document, currentScript, {
|
||||
get: function(){
|
||||
|
||||
// IE 6-10 supports script readyState
|
||||
// IE 10+ support stack trace
|
||||
try { throw new Error(); }
|
||||
catch (err) {
|
||||
|
||||
// Find the second match for the "at" string to get file src url from stack.
|
||||
// Specifically works with the format of stack traces in IE.
|
||||
var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1];
|
||||
|
||||
// For all scripts on the page, if src matches or if ready state is interactive, return the script tag
|
||||
for(i in scripts){
|
||||
if(scripts[i].src == res || scripts[i].readyState == "interactive"){
|
||||
return scripts[i];
|
||||
}
|
||||
}
|
||||
|
||||
// If no match, return null
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})(document);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "fb15":
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
||||
// This file is imported into lib/wc client bundles.
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
if (true) {
|
||||
__webpack_require__("f6fd")
|
||||
}
|
||||
|
||||
var i
|
||||
if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
|
||||
__webpack_require__.p = i[1] // eslint-disable-line
|
||||
}
|
||||
}
|
||||
|
||||
// Indicate to webpack that this file can be concatenated
|
||||
/* harmony default export */ var setPublicPath = (null);
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1521356a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=template&id=478276ba&scoped=true&
|
||||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"layout"},[_vm._l((_vm.Streams),function(item){return _c('Badge',{key:item.StreamPath,staticClass:"room",attrs:{"count":item.TsCount},nativeOn:{"click":function($event){return _vm.publish(item)}}},[_c('Icon',{attrs:{"type":"ios-folder-open-outline","size":"100"}}),_c('div',{staticClass:"size"},[_vm._v(_vm._s(_vm.unitFormat(item.TotalSize)))]),_c('div',[_vm._v(_vm._s(item.StreamPath))])],1)}),(_vm.Streams.length==0)?_c('div',{staticClass:"empty"},[_c('Icon',{attrs:{"type":"md-wine","size":"50"}}),_vm._v("没有任何文件夹 ")],1):_vm._e()],2)}
|
||||
var staticRenderFns = []
|
||||
|
||||
|
||||
// CONCATENATED MODULE: ./src/App.vue?vue&type=template&id=478276ba&scoped=true&
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
/* harmony default export */ var Appvue_type_script_lang_js_ = ({
|
||||
data() {
|
||||
return {
|
||||
Streams: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
fetchlist() {
|
||||
this.ajax.getJSON(this.apiHost + "/ts/list").then(x => {
|
||||
this.Streams = x;
|
||||
});
|
||||
},
|
||||
publish(item) {
|
||||
this.$confirm("是否发布该目录", "提示").then(({result}) => {
|
||||
if (result)
|
||||
this.ajax
|
||||
.getJSON(
|
||||
this.apiHost +
|
||||
"/ts/publish?streamPath=" +
|
||||
item.StreamPath
|
||||
)
|
||||
.then(() => {
|
||||
this.$toast.success("已发布" + item.StreamPath);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchlist();
|
||||
}
|
||||
});
|
||||
|
||||
// CONCATENATED MODULE: ./src/App.vue?vue&type=script&lang=js&
|
||||
/* harmony default export */ var src_Appvue_type_script_lang_js_ = (Appvue_type_script_lang_js_);
|
||||
// EXTERNAL MODULE: ./src/App.vue?vue&type=style&index=0&id=478276ba&scoped=true&lang=css&
|
||||
var Appvue_type_style_index_0_id_478276ba_scoped_true_lang_css_ = __webpack_require__("b3d5");
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
||||
/* globals __VUE_SSR_CONTEXT__ */
|
||||
|
||||
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
||||
// This module is a runtime utility for cleaner component module output and will
|
||||
// be included in the final webpack user bundle.
|
||||
|
||||
function normalizeComponent (
|
||||
scriptExports,
|
||||
render,
|
||||
staticRenderFns,
|
||||
functionalTemplate,
|
||||
injectStyles,
|
||||
scopeId,
|
||||
moduleIdentifier, /* server only */
|
||||
shadowMode /* vue-cli only */
|
||||
) {
|
||||
// Vue.extend constructor export interop
|
||||
var options = typeof scriptExports === 'function'
|
||||
? scriptExports.options
|
||||
: scriptExports
|
||||
|
||||
// render functions
|
||||
if (render) {
|
||||
options.render = render
|
||||
options.staticRenderFns = staticRenderFns
|
||||
options._compiled = true
|
||||
}
|
||||
|
||||
// functional template
|
||||
if (functionalTemplate) {
|
||||
options.functional = true
|
||||
}
|
||||
|
||||
// scopedId
|
||||
if (scopeId) {
|
||||
options._scopeId = 'data-v-' + scopeId
|
||||
}
|
||||
|
||||
var hook
|
||||
if (moduleIdentifier) { // server build
|
||||
hook = function (context) {
|
||||
// 2.3 injection
|
||||
context =
|
||||
context || // cached call
|
||||
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
||||
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
||||
// 2.2 with runInNewContext: true
|
||||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
||||
context = __VUE_SSR_CONTEXT__
|
||||
}
|
||||
// inject component styles
|
||||
if (injectStyles) {
|
||||
injectStyles.call(this, context)
|
||||
}
|
||||
// register component module identifier for async chunk inferrence
|
||||
if (context && context._registeredComponents) {
|
||||
context._registeredComponents.add(moduleIdentifier)
|
||||
}
|
||||
}
|
||||
// used by ssr in case component is cached and beforeCreate
|
||||
// never gets called
|
||||
options._ssrRegister = hook
|
||||
} else if (injectStyles) {
|
||||
hook = shadowMode
|
||||
? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
|
||||
: injectStyles
|
||||
}
|
||||
|
||||
if (hook) {
|
||||
if (options.functional) {
|
||||
// for template-only hot-reload because in that case the render fn doesn't
|
||||
// go through the normalizer
|
||||
options._injectStyles = hook
|
||||
// register for functional component in vue file
|
||||
var originalRender = options.render
|
||||
options.render = function renderWithStyleInjection (h, context) {
|
||||
hook.call(context)
|
||||
return originalRender(h, context)
|
||||
}
|
||||
} else {
|
||||
// inject component registration as beforeCreate hook
|
||||
var existing = options.beforeCreate
|
||||
options.beforeCreate = existing
|
||||
? [].concat(existing, hook)
|
||||
: [hook]
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
exports: scriptExports,
|
||||
options: options
|
||||
}
|
||||
}
|
||||
|
||||
// CONCATENATED MODULE: ./src/App.vue
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* normalize component */
|
||||
|
||||
var component = normalizeComponent(
|
||||
src_Appvue_type_script_lang_js_,
|
||||
render,
|
||||
staticRenderFns,
|
||||
false,
|
||||
null,
|
||||
"478276ba",
|
||||
null
|
||||
|
||||
)
|
||||
|
||||
/* harmony default export */ var App = (component.exports);
|
||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
||||
|
||||
|
||||
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (App);
|
||||
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ })["default"];
|
||||
//# sourceMappingURL=plugin-ts.common.js.map
|
||||
1
ui/dist/plugin-ts.common.js.map
vendored
1
ui/dist/plugin-ts.common.js.map
vendored
File diff suppressed because one or more lines are too long
1
ui/dist/plugin-ts.css
vendored
1
ui/dist/plugin-ts.css
vendored
@@ -1 +0,0 @@
|
||||
.layout[data-v-478276ba]{padding-bottom:30px;display:flex;flex-wrap:wrap;padding:30px}.room[data-v-478276ba]{text-align:center}.room[data-v-478276ba]:hover{text-shadow:0 0 12px #4199d0;border-radius:10%;cursor:pointer}.size[data-v-478276ba]{color:#ffc107;position:absolute;top:40%;left:0;right:0}
|
||||
371
ui/dist/plugin-ts.umd.js
vendored
371
ui/dist/plugin-ts.umd.js
vendored
@@ -1,371 +0,0 @@
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define([], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["plugin-ts"] = factory();
|
||||
else
|
||||
root["plugin-ts"] = factory();
|
||||
})((typeof self !== 'undefined' ? self : this), function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ "b3d5":
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_id_478276ba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ccbd");
|
||||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_id_478276ba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_id_478276ba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* unused harmony reexport * */
|
||||
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_style_index_0_id_478276ba_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "ccbd":
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "f6fd":
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
// document.currentScript polyfill by Adam Miller
|
||||
|
||||
// MIT license
|
||||
|
||||
(function(document){
|
||||
var currentScript = "currentScript",
|
||||
scripts = document.getElementsByTagName('script'); // Live NodeList collection
|
||||
|
||||
// If browser needs currentScript polyfill, add get currentScript() to the document object
|
||||
if (!(currentScript in document)) {
|
||||
Object.defineProperty(document, currentScript, {
|
||||
get: function(){
|
||||
|
||||
// IE 6-10 supports script readyState
|
||||
// IE 10+ support stack trace
|
||||
try { throw new Error(); }
|
||||
catch (err) {
|
||||
|
||||
// Find the second match for the "at" string to get file src url from stack.
|
||||
// Specifically works with the format of stack traces in IE.
|
||||
var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1];
|
||||
|
||||
// For all scripts on the page, if src matches or if ready state is interactive, return the script tag
|
||||
for(i in scripts){
|
||||
if(scripts[i].src == res || scripts[i].readyState == "interactive"){
|
||||
return scripts[i];
|
||||
}
|
||||
}
|
||||
|
||||
// If no match, return null
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})(document);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "fb15":
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
// ESM COMPAT FLAG
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
||||
// This file is imported into lib/wc client bundles.
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
if (true) {
|
||||
__webpack_require__("f6fd")
|
||||
}
|
||||
|
||||
var i
|
||||
if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
|
||||
__webpack_require__.p = i[1] // eslint-disable-line
|
||||
}
|
||||
}
|
||||
|
||||
// Indicate to webpack that this file can be concatenated
|
||||
/* harmony default export */ var setPublicPath = (null);
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"1521356a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=template&id=478276ba&scoped=true&
|
||||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"layout"},[_vm._l((_vm.Streams),function(item){return _c('Badge',{key:item.StreamPath,staticClass:"room",attrs:{"count":item.TsCount},nativeOn:{"click":function($event){return _vm.publish(item)}}},[_c('Icon',{attrs:{"type":"ios-folder-open-outline","size":"100"}}),_c('div',{staticClass:"size"},[_vm._v(_vm._s(_vm.unitFormat(item.TotalSize)))]),_c('div',[_vm._v(_vm._s(item.StreamPath))])],1)}),(_vm.Streams.length==0)?_c('div',{staticClass:"empty"},[_c('Icon',{attrs:{"type":"md-wine","size":"50"}}),_vm._v("没有任何文件夹 ")],1):_vm._e()],2)}
|
||||
var staticRenderFns = []
|
||||
|
||||
|
||||
// CONCATENATED MODULE: ./src/App.vue?vue&type=template&id=478276ba&scoped=true&
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
/* harmony default export */ var Appvue_type_script_lang_js_ = ({
|
||||
data() {
|
||||
return {
|
||||
Streams: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
fetchlist() {
|
||||
this.ajax.getJSON(this.apiHost + "/ts/list").then(x => {
|
||||
this.Streams = x;
|
||||
});
|
||||
},
|
||||
publish(item) {
|
||||
this.$confirm("是否发布该目录", "提示").then(({result}) => {
|
||||
if (result)
|
||||
this.ajax
|
||||
.getJSON(
|
||||
this.apiHost +
|
||||
"/ts/publish?streamPath=" +
|
||||
item.StreamPath
|
||||
)
|
||||
.then(() => {
|
||||
this.$toast.success("已发布" + item.StreamPath);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchlist();
|
||||
}
|
||||
});
|
||||
|
||||
// CONCATENATED MODULE: ./src/App.vue?vue&type=script&lang=js&
|
||||
/* harmony default export */ var src_Appvue_type_script_lang_js_ = (Appvue_type_script_lang_js_);
|
||||
// EXTERNAL MODULE: ./src/App.vue?vue&type=style&index=0&id=478276ba&scoped=true&lang=css&
|
||||
var Appvue_type_style_index_0_id_478276ba_scoped_true_lang_css_ = __webpack_require__("b3d5");
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
||||
/* globals __VUE_SSR_CONTEXT__ */
|
||||
|
||||
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
||||
// This module is a runtime utility for cleaner component module output and will
|
||||
// be included in the final webpack user bundle.
|
||||
|
||||
function normalizeComponent (
|
||||
scriptExports,
|
||||
render,
|
||||
staticRenderFns,
|
||||
functionalTemplate,
|
||||
injectStyles,
|
||||
scopeId,
|
||||
moduleIdentifier, /* server only */
|
||||
shadowMode /* vue-cli only */
|
||||
) {
|
||||
// Vue.extend constructor export interop
|
||||
var options = typeof scriptExports === 'function'
|
||||
? scriptExports.options
|
||||
: scriptExports
|
||||
|
||||
// render functions
|
||||
if (render) {
|
||||
options.render = render
|
||||
options.staticRenderFns = staticRenderFns
|
||||
options._compiled = true
|
||||
}
|
||||
|
||||
// functional template
|
||||
if (functionalTemplate) {
|
||||
options.functional = true
|
||||
}
|
||||
|
||||
// scopedId
|
||||
if (scopeId) {
|
||||
options._scopeId = 'data-v-' + scopeId
|
||||
}
|
||||
|
||||
var hook
|
||||
if (moduleIdentifier) { // server build
|
||||
hook = function (context) {
|
||||
// 2.3 injection
|
||||
context =
|
||||
context || // cached call
|
||||
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
||||
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
||||
// 2.2 with runInNewContext: true
|
||||
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
||||
context = __VUE_SSR_CONTEXT__
|
||||
}
|
||||
// inject component styles
|
||||
if (injectStyles) {
|
||||
injectStyles.call(this, context)
|
||||
}
|
||||
// register component module identifier for async chunk inferrence
|
||||
if (context && context._registeredComponents) {
|
||||
context._registeredComponents.add(moduleIdentifier)
|
||||
}
|
||||
}
|
||||
// used by ssr in case component is cached and beforeCreate
|
||||
// never gets called
|
||||
options._ssrRegister = hook
|
||||
} else if (injectStyles) {
|
||||
hook = shadowMode
|
||||
? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
|
||||
: injectStyles
|
||||
}
|
||||
|
||||
if (hook) {
|
||||
if (options.functional) {
|
||||
// for template-only hot-reload because in that case the render fn doesn't
|
||||
// go through the normalizer
|
||||
options._injectStyles = hook
|
||||
// register for functional component in vue file
|
||||
var originalRender = options.render
|
||||
options.render = function renderWithStyleInjection (h, context) {
|
||||
hook.call(context)
|
||||
return originalRender(h, context)
|
||||
}
|
||||
} else {
|
||||
// inject component registration as beforeCreate hook
|
||||
var existing = options.beforeCreate
|
||||
options.beforeCreate = existing
|
||||
? [].concat(existing, hook)
|
||||
: [hook]
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
exports: scriptExports,
|
||||
options: options
|
||||
}
|
||||
}
|
||||
|
||||
// CONCATENATED MODULE: ./src/App.vue
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* normalize component */
|
||||
|
||||
var component = normalizeComponent(
|
||||
src_Appvue_type_script_lang_js_,
|
||||
render,
|
||||
staticRenderFns,
|
||||
false,
|
||||
null,
|
||||
"478276ba",
|
||||
null
|
||||
|
||||
)
|
||||
|
||||
/* harmony default export */ var App = (component.exports);
|
||||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
||||
|
||||
|
||||
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (App);
|
||||
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ })["default"];
|
||||
});
|
||||
//# sourceMappingURL=plugin-ts.umd.js.map
|
||||
1
ui/dist/plugin-ts.umd.js.map
vendored
1
ui/dist/plugin-ts.umd.js.map
vendored
File diff suppressed because one or more lines are too long
2
ui/dist/plugin-ts.umd.min.js
vendored
2
ui/dist/plugin-ts.umd.min.js
vendored
@@ -1,2 +0,0 @@
|
||||
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["plugin-ts"]=e():t["plugin-ts"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({b3d5:function(t,e,n){"use strict";var r=n("ccbd"),o=n.n(r);o.a},ccbd:function(t,e,n){},f6fd:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(r){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},fb15:function(t,e,n){"use strict";var r;(n.r(e),"undefined"!==typeof window)&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"layout"},[t._l(t.Streams,(function(e){return n("Badge",{key:e.StreamPath,staticClass:"room",attrs:{count:e.TsCount},nativeOn:{click:function(n){return t.publish(e)}}},[n("Icon",{attrs:{type:"ios-folder-open-outline",size:"100"}}),n("div",{staticClass:"size"},[t._v(t._s(t.unitFormat(e.TotalSize)))]),n("div",[t._v(t._s(e.StreamPath))])],1)})),0==t.Streams.length?n("div",{staticClass:"empty"},[n("Icon",{attrs:{type:"md-wine",size:"50"}}),t._v("没有任何文件夹 ")],1):t._e()],2)},i=[],s={data(){return{Streams:[]}},methods:{fetchlist(){this.ajax.getJSON(this.apiHost+"/ts/list").then(t=>{this.Streams=t})},publish(t){this.$confirm("是否发布该目录","提示").then(({result:e})=>{e&&this.ajax.getJSON(this.apiHost+"/ts/publish?streamPath="+t.StreamPath).then(()=>{this.$toast.success("已发布"+t.StreamPath)})})}},mounted(){this.fetchlist()}},a=s;n("b3d5");function u(t,e,n,r,o,i,s,a){var u,c="function"===typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=u):o&&(u=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),u)if(c.functional){c._injectStyles=u;var f=c.render;c.render=function(t,e){return u.call(e),f(t,e)}}else{var l=c.beforeCreate;c.beforeCreate=l?[].concat(l,u):[u]}return{exports:t,options:c}}var c=u(a,o,i,!1,null,"478276ba",null),f=c.exports;e["default"]=f}})["default"]}));
|
||||
//# sourceMappingURL=plugin-ts.umd.min.js.map
|
||||
1
ui/dist/plugin-ts.umd.min.js.map
vendored
1
ui/dist/plugin-ts.umd.min.js.map
vendored
File diff suppressed because one or more lines are too long
9560
ui/package-lock.json
generated
9560
ui/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"name": "dashboard",
|
||||
"version": "1.0.0",
|
||||
"description": "dashboard of ts plugin for monibuca",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "vue-cli-service build --target lib --name plugin-ts"
|
||||
},
|
||||
"author": "dexter",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@vue/cli-service": "^4.2.3",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<Badge @click.native="publish(item)" v-for="item in Streams" :key="item.StreamPath" :count="item.TsCount"
|
||||
class="room">
|
||||
<Icon type="ios-folder-open-outline" size="100" />
|
||||
<div class="size">{{unitFormat(item.TotalSize)}}</div>
|
||||
<div>{{item.StreamPath}}</div>
|
||||
</Badge>
|
||||
<div v-if="Streams.length==0" class="empty">
|
||||
<Icon type="md-wine" size="50" />没有任何文件夹
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
Streams: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
fetchlist() {
|
||||
this.ajax.getJSON(this.apiHost + "/ts/list").then(x => {
|
||||
this.Streams = x;
|
||||
});
|
||||
},
|
||||
publish(item) {
|
||||
this.$confirm("是否发布该目录", "提示").then(({result}) => {
|
||||
if (result)
|
||||
this.ajax
|
||||
.getJSON(
|
||||
this.apiHost +
|
||||
"/ts/publish?streamPath=" +
|
||||
item.StreamPath
|
||||
)
|
||||
.then(() => {
|
||||
this.$toast.success("已发布" + item.StreamPath);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchlist();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.layout {
|
||||
padding-bottom: 30px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 30px;
|
||||
}
|
||||
.room {
|
||||
text-align: center;
|
||||
}
|
||||
.room:hover {
|
||||
text-shadow: 0 0 12px #4199d0;
|
||||
border-radius: 10%;
|
||||
cursor: pointer;
|
||||
}
|
||||
.size {
|
||||
color: #ffc107;
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user