From a33160a45a14e3f426b3fa4cedbd216d66b64809 Mon Sep 17 00:00:00 2001 From: Chengxun Lee <24319042+bclswl0827@users.noreply.github.com> Date: Thu, 28 Dec 2023 19:43:19 +0800 Subject: [PATCH] Remove SQLite support due to incompatibility reason --- CHANGELOG.md | 7 +++++++ README.md | 2 +- VERSION | 2 +- driver/dao/engine.go | 14 -------------- driver/dao/open.go | 5 +++-- frontend/dist/asset-manifest.json | 16 ++++++++-------- frontend/dist/index.html | 2 +- frontend/dist/static/js/252.0f6c5ff7.chunk.js | 1 - frontend/dist/static/js/252.e70521e2.chunk.js | 1 + frontend/dist/static/js/253.b495b4ba.chunk.js | 1 + frontend/dist/static/js/253.e64c7cc8.chunk.js | 1 - frontend/dist/static/js/290.b863e121.chunk.js | 1 + frontend/dist/static/js/290.d405901a.chunk.js | 1 - frontend/dist/static/js/332.587820cf.chunk.js | 1 - frontend/dist/static/js/332.60fa82e5.chunk.js | 1 + frontend/dist/static/js/669.29bd1401.chunk.js | 1 - frontend/dist/static/js/669.daeb5973.chunk.js | 1 + frontend/dist/static/js/912.b91c9724.chunk.js | 1 - frontend/dist/static/js/912.edb28760.chunk.js | 1 + .../js/{main.b75096a0.js => main.0c991c67.js} | 4 ++-- ....LICENSE.txt => main.0c991c67.js.LICENSE.txt} | 0 frontend/src/.env | 4 ++-- frontend/src/src/components/Area.tsx | 8 ++++++-- frontend/src/src/components/Button.tsx | 4 +++- frontend/src/src/components/Card.tsx | 4 +++- frontend/src/src/components/Container.tsx | 4 +++- frontend/src/src/components/Label.tsx | 6 ++++-- frontend/src/src/components/MapBox.tsx | 8 +++++--- frontend/src/src/components/Scroller.tsx | 2 +- frontend/src/src/components/Sidebar.tsx | 2 +- go.mod | 5 ++--- go.sum | 7 ++----- utils/request/get.go | 2 ++ utils/request/post.go | 2 ++ 34 files changed, 65 insertions(+), 57 deletions(-) delete mode 100644 frontend/dist/static/js/252.0f6c5ff7.chunk.js create mode 100644 frontend/dist/static/js/252.e70521e2.chunk.js create mode 100644 frontend/dist/static/js/253.b495b4ba.chunk.js delete mode 100644 frontend/dist/static/js/253.e64c7cc8.chunk.js create mode 100644 frontend/dist/static/js/290.b863e121.chunk.js delete mode 100644 frontend/dist/static/js/290.d405901a.chunk.js delete mode 100644 frontend/dist/static/js/332.587820cf.chunk.js create mode 100644 frontend/dist/static/js/332.60fa82e5.chunk.js delete mode 100644 frontend/dist/static/js/669.29bd1401.chunk.js create mode 100644 frontend/dist/static/js/669.daeb5973.chunk.js delete mode 100644 frontend/dist/static/js/912.b91c9724.chunk.js create mode 100644 frontend/dist/static/js/912.edb28760.chunk.js rename frontend/dist/static/js/{main.b75096a0.js => main.0c991c67.js} (99%) rename frontend/dist/static/js/{main.b75096a0.js.LICENSE.txt => main.0c991c67.js.LICENSE.txt} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40f9795c..8bed5eaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ Starting from v2.2.5, all notable changes to this project will be documented in this file. +## v2.4.1 + + - Skip TLS verification for earthquake event data source API + - Remove SQLite support due to MIPS architecture incompatibility + - Make frontend className conditional rendering logic more predictable + - Correct frontend map anchor point offset + ## v2.4.0 - Optimization on CPU usage metrics calculation diff --git a/README.md b/README.md index 762cf515..69e49b08 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ AnyShake Observer is an open-source, cross-platform software that can be used to monitor, archive, and export seismic data from [AnyShake Explorer](https://github.com/anyshake/explorer) via serial port. It provides a user-friendly web-based interface to visualize and analyze the seismic data. For more professional users, it supports exporting the data to SAC or MiniSEED format for further analysis. -This software is written in Go and TypeScript, which means it can easily port to a variety of OS and CPU architectures, even embedded Linux devices, AnyShake Observer also supports PostgreSQL, MariaDB (MySQL), SQLite, and SQL Server as seismic data archiving engines. We're currently trying to integrate the SEEDLink server on this software (Using pure Go implementation). +This software is written in Go and TypeScript, which means it can easily port to a variety of OS and CPU architectures, even embedded Linux devices, AnyShake Observer also supports PostgreSQL, MariaDB (MySQL) and SQL Server as seismic data archiving engines. We're currently trying to integrate the SEEDLink server on this software (Using pure Go implementation). As of the release of the software documentation, AnyShake has successfully captured more than 40 earthquake events, the furthest captured earthquake event is [M 7.1 - 180 km NNE of Gili Air, Indonesia](https://earthquake.usgs.gov/earthquakes/eventpage/us7000krjx/executive), approximately 4,210 km, by the station located in Chongqing, China. diff --git a/VERSION b/VERSION index 8721bbc4..a3721209 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.4.0 +v2.4.1 diff --git a/driver/dao/engine.go b/driver/dao/engine.go index c5a2f8cd..a8e9a366 100644 --- a/driver/dao/engine.go +++ b/driver/dao/engine.go @@ -5,7 +5,6 @@ import ( "gorm.io/driver/mysql" "gorm.io/driver/postgres" - "gorm.io/driver/sqlite" "gorm.io/driver/sqlserver" "gorm.io/gorm" "gorm.io/gorm/logger" @@ -55,19 +54,6 @@ func (m *MariaDB) openDBConn(host string, port int, username, password, database }) } -type SQLite struct{} - -func (s *SQLite) isCompatible(engine string) bool { - return engine == "sqlite" || engine == "sqlite3" -} - -func (s *SQLite) openDBConn(host string, port int, username, password, database string) (*gorm.DB, error) { - return gorm.Open(sqlite.Open(database), &gorm.Config{ - Logger: logger.Default.LogMode(logger.Silent), - SkipDefaultTransaction: true, // Disable transaction to improve performance - }) -} - type SQLServer struct{} func (s *SQLServer) isCompatible(engine string) bool { diff --git a/driver/dao/open.go b/driver/dao/open.go index 9561a9ae..4f4231bc 100644 --- a/driver/dao/open.go +++ b/driver/dao/open.go @@ -8,8 +8,9 @@ import ( func Open(host string, port int, engine, username, password, database string) (*gorm.DB, error) { engines := []dbEngine{ - &PostgreSQL{}, &MariaDB{}, - &SQLite{}, &SQLServer{}, + &PostgreSQL{}, + &MariaDB{}, + &SQLServer{}, } for _, e := range engines { if e.isCompatible(engine) { diff --git a/frontend/dist/asset-manifest.json b/frontend/dist/asset-manifest.json index d2f31199..2c3c2e56 100644 --- a/frontend/dist/asset-manifest.json +++ b/frontend/dist/asset-manifest.json @@ -1,13 +1,13 @@ { "files": { "main.css": "/static/css/main.40ace055.css", - "main.js": "/static/js/main.b75096a0.js", + "main.js": "/static/js/main.0c991c67.js", "static/css/290.525e2941.chunk.css": "/static/css/290.525e2941.chunk.css", - "static/js/290.d405901a.chunk.js": "/static/js/290.d405901a.chunk.js", + "static/js/290.b863e121.chunk.js": "/static/js/290.b863e121.chunk.js", "static/js/735.26a45829.chunk.js": "/static/js/735.26a45829.chunk.js", - "static/js/252.0f6c5ff7.chunk.js": "/static/js/252.0f6c5ff7.chunk.js", - "static/js/253.e64c7cc8.chunk.js": "/static/js/253.e64c7cc8.chunk.js", - "static/js/332.587820cf.chunk.js": "/static/js/332.587820cf.chunk.js", + "static/js/252.e70521e2.chunk.js": "/static/js/252.e70521e2.chunk.js", + "static/js/253.b495b4ba.chunk.js": "/static/js/253.b495b4ba.chunk.js", + "static/js/332.60fa82e5.chunk.js": "/static/js/332.60fa82e5.chunk.js", "static/js/377.f0e1c66a.chunk.js": "/static/js/377.f0e1c66a.chunk.js", "static/js/453.30461b97.chunk.js": "/static/js/453.30461b97.chunk.js", "static/js/59.a77c052b.chunk.js": "/static/js/59.a77c052b.chunk.js", @@ -16,8 +16,8 @@ "static/js/165.41b9296d.chunk.js": "/static/js/165.41b9296d.chunk.js", "static/js/979.14e4e415.chunk.js": "/static/js/979.14e4e415.chunk.js", "static/js/822.ae40dac1.chunk.js": "/static/js/822.ae40dac1.chunk.js", - "static/js/912.b91c9724.chunk.js": "/static/js/912.b91c9724.chunk.js", - "static/js/669.29bd1401.chunk.js": "/static/js/669.29bd1401.chunk.js", + "static/js/912.edb28760.chunk.js": "/static/js/912.edb28760.chunk.js", + "static/js/669.daeb5973.chunk.js": "/static/js/669.daeb5973.chunk.js", "static/media/gear-solid.svg": "/static/media/gear-solid.bf34f9d52ff44a67baec8a0d4220d3a3.svg", "static/media/bug-solid.svg": "/static/media/bug-solid.7f781f9ddd35c29f11111e36602dcc87.svg", "static/media/earth-americas-solid.svg": "/static/media/earth-americas-solid.4105ee3951f1c7ac60331fccafc17c1f.svg", @@ -48,6 +48,6 @@ }, "entrypoints": [ "static/css/main.40ace055.css", - "static/js/main.b75096a0.js" + "static/js/main.0c991c67.js" ] } \ No newline at end of file diff --git a/frontend/dist/index.html b/frontend/dist/index.html index b5692a2e..7fa50e60 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -1 +1 @@ -
\ No newline at end of file + \ No newline at end of file diff --git a/frontend/dist/static/js/252.0f6c5ff7.chunk.js b/frontend/dist/static/js/252.0f6c5ff7.chunk.js deleted file mode 100644 index e4ee541b..00000000 --- a/frontend/dist/static/js/252.0f6c5ff7.chunk.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkobserver=self.webpackChunkobserver||[]).push([[252],{7486:function(e,t,r){r.d(t,{j:function(){return h},Z:function(){return p}});var n=r(5671),a=r(3144),s=r(136),o=r(9388),i=r(7313),c=r(5590);var l=r.p+"static/media/square-caret-up-solid.0573794ec033f5ce25c1076e3ac596e3.svg",u=r(6417),h=function(e){return e[e.COLLAPSE_DISABLE=0]="COLLAPSE_DISABLE",e[e.COLLAPSE_SHOW=1]="COLLAPSE_SHOW",e[e.COLLAPSE_HIDE=2]="COLLAPSE_HIDE",e}({}),d=function(e){(0,s.Z)(r,e);var t=(0,o.Z)(r);function r(e){var a;return(0,n.Z)(this,r),(a=t.call(this,e)).state={collapsed:!1},a}return(0,a.Z)(r,[{key:"componentDidMount",value:function(){var e=this.props.collapse||h.COLLAPSE_DISABLE;this.setState({collapsed:e===h.COLLAPSE_HIDE})}},{key:"render",value:function(){var e=this,t=this.state.collapsed,r=this.props,n=r.t,a=r.children,s=r.label,o=r.text,i=(this.props.collapse||h.COLLAPSE_DISABLE)!==h.COLLAPSE_DISABLE;return(0,u.jsxs)("div",{className:"mb-4 flex flex-col rounded-xl text-gray-700 shadow-lg",children:[(0,u.jsx)("div",{className:"mx-4 rounded-lg overflow-hidden shadow-lg",children:a}),(0,u.jsxs)("div",{className:"p-4",children:[(0,u.jsxs)("h6",{className:"text-md font-bold text-gray-800 flex ".concat(i&&"cursor-pointer select-none"),onClick:function(){return i&&e.setState({collapsed:!t})},children:[i&&(0,u.jsx)("img",{className:"mx-1 ".concat(t&&"rotate-180"),src:l,alt:""}),n(s.id,s.format)]}),o&&!t&&(0,u.jsx)("span",{className:"text-md",children:n(o.id,o.format).split("\n").map((function(e,t){return(0,u.jsxs)("p",{children:[e,(0,u.jsx)("br",{})]},t)}))})]})]})}}]),r}(i.Component),p=(0,c.Zh)()(d)},4595:function(e,t,r){var n=r(5671),a=r(3144),s=r(136),o=r(9388),i=r(7313),c=r(5590),l=r(6417),u=function(e){(0,s.Z)(r,e);var t=(0,o.Z)(r);function r(e){var a;return(0,n.Z)(this,r),(a=t.call(this,e)).state={isBusy:!1},a}return(0,a.Z)(r,[{key:"render",value:function(){var e=this.props,t=e.t,r=e.className,n=e.label,a=e.onClick;return(0,l.jsx)("button",{className:"w-full text-white font-medium text-sm shadow-lg rounded-lg py-2 ".concat(r),onClick:a,children:t(n.id,n.format)})}}]),r}(i.Component);t.Z=(0,c.Zh)()(u)},3387:function(e,t,r){var n=r(5671),a=r(3144),s=r(136),o=r(9388),i=r(7313),c=r(5590),l=r(6417),u=function(e){(0,s.Z)(r,e);var t=(0,o.Z)(r);function r(){return(0,n.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"render",value:function(){var e=this.props,t=e.t,r=e.className,n=e.label,a=e.sublabel,s=e.children,o=Array.isArray(s)?s:[s];return(0,l.jsx)("div",{className:"w-full h-full text-gray-800",children:(0,l.jsxs)("div",{className:"flex flex-col shadow-lg rounded-lg",children:[(0,l.jsxs)("div",{className:"px-4 py-3 font-bold",children:[a&&(0,l.jsx)("h6",{className:"text-gray-500 text-xs",children:t(a.id,a.format)}),(0,l.jsx)("h2",{className:"text-xl",children:t(n.id,n.format)})]}),(0,l.jsx)("div",{className:"p-4 m-2 flex flex-col justify-center gap-4 ".concat(r),children:o.map((function(e,t){return(0,l.jsx)("div",{children:e},t)}))})]})})}}]),r}(i.Component);t.Z=(0,c.Zh)()(u)},3676:function(e,t,r){var n=r(7762),a=r(5671),s=r(3144),o=r(136),i=r(9388),c=r(7313),l=r(5845),u=r(7548),h=r(1259),d=r.n(h),p=r(5590),f=r(6417);d()(l);var v=function(e){(0,o.Z)(r,e);var t=(0,i.Z)(r);function r(e){var n;(0,a.Z)(this,r),(n=t.call(this,e)).chartRef=(0,c.createRef)();var s=n.props,o=s.height,i=s.legend,l=s.tooltip,u=s.zooming,h=s.animation,d=s.lineWidth,p=s.tickInterval,f=s.tickPrecision,v=s.lineColor,m=s.backgroundColor;return n.state={accessibility:{enabled:!1},boost:{enabled:!0,seriesThreshold:3},chart:{zooming:u?{type:"x"}:{},marginTop:20,height:o,animation:h,backgroundColor:m},legend:{enabled:i,itemStyle:{color:"#fff"}},plotOptions:{series:{lineWidth:d,states:{hover:{enabled:!1}}}},xAxis:{labels:{style:{color:"#fff"},format:"{value:%H:%M:%S}"},type:"datetime",tickColor:"#fff",lineColor:v},yAxis:{labels:{style:{color:"#fff"},format:f?"{value:".concat(f,"f}"):"{value:0.2f}"},title:{text:""},opposite:!0,lineColor:v,tickInterval:p},tooltip:{enabled:l,followPointer:!0,followTouchMove:!0,xDateFormat:"%Y-%m-%d %H:%M:%S",padding:12},credits:{enabled:!1},time:{useUTC:!1},title:{text:""}},n}return(0,s.Z)(r,[{key:"componentDidUpdate",value:function(){var e=this.props,t=e.t,r=e.series,a=e.sort,s=e.height;l.setOptions({lang:{resetZoom:t("components.chart.reset_zoom"),resetZoomTitle:t("components.chart.reset_zoom_title")}});var o=this.chartRef.current;if(o){var i=o.chart;if(i){if(s!==i.chartHeight&&i.update({chart:{height:s}}),a)if(r.data)r.data.sort((function(e,t){return e[0]-t[0]}));else if(r.length)for(var c=0,u=r;c