Skip to content

Commit

Permalink
Merge pull request #470 from AnalogJ/beta
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ authored Apr 6, 2023
2 parents 8c65166 + 539c945 commit 4192ac7
Show file tree
Hide file tree
Showing 39 changed files with 8,873 additions and 28,582 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The frontend is written in Angular. If you're working on the frontend and can us
```bash
cd webapp/frontend
npm install
npm run start -- --deploy-url="/web/" --base-href="/web/" --port 4200
npm run start -- --serve-path="/web/" --port 4200
```
3. open your browser and visit [http://localhost:4200/web](http://localhost:4200/web)

Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ endif
# reduce logging, disable angular-cli analytics for ci environment
binary-frontend: export NPM_CONFIG_LOGLEVEL = warn
binary-frontend: export NG_CLI_ANALYTICS = false
binary-frontend: export NODE_OPTIONS = --openssl-legacy-provider
binary-frontend:
cd webapp/frontend
npm install -g @angular/[email protected]
Expand All @@ -108,7 +107,6 @@ binary-frontend:

.PHONY: binary-frontend-test-coverage
# reduce logging, disable angular-cli analytics for ci environment
binary-frontend-test-coverage: export NODE_OPTIONS = --openssl-legacy-provider
binary-frontend-test-coverage:
cd webapp/frontend
npm ci
Expand Down
21 changes: 21 additions & 0 deletions webapp/backend/pkg/database/scrutiny_repository_migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ func (sr *scrutinyRepository) Migrate(ctx context.Context) error {
SettingDataType: "bool",
SettingValueBool: false,
},
{
SettingKeyName: "line_stroke",
SettingKeyDescription: "Temperature chart line stroke ('smooth' | 'straight' | 'stepline')",
SettingDataType: "string",
SettingValueString: "smooth",
},

{
SettingKeyName: "metrics.notify_level",
Expand All @@ -348,6 +354,21 @@ func (sr *scrutinyRepository) Migrate(ctx context.Context) error {
return tx.Create(&defaultSettings).Error
},
},
{
ID: "m20221115214900", // add line_stroke setting.
Migrate: func(tx *gorm.DB) error {
//add line_stroke setting default.
var defaultSettings = []m20220716214900.Setting{
{
SettingKeyName: "line_stroke",
SettingKeyDescription: "Temperature chart line stroke ('smooth' | 'straight' | 'stepline')",
SettingDataType: "string",
SettingValueString: "smooth",
},
}
return tx.Create(&defaultSettings).Error
},
},
})

if err := m.Migrate(); err != nil {
Expand Down
1 change: 1 addition & 0 deletions webapp/backend/pkg/models/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Settings struct {
DashboardSort string `json:"dashboard_sort" mapstructure:"dashboard_sort"`
TemperatureUnit string `json:"temperature_unit" mapstructure:"temperature_unit"`
FileSizeSIUnits bool `json:"file_size_si_units" mapstructure:"file_size_si_units"`
LineStroke string `json:"line_stroke" mapstructure:"line_stroke"`

Metrics struct {
NotifyLevel int `json:"notify_level" mapstructure:"notify_level"`
Expand Down
2 changes: 0 additions & 2 deletions webapp/frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
Expand Down Expand Up @@ -91,7 +90,6 @@
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"defaultConfiguration": "production",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
Expand Down
20 changes: 10 additions & 10 deletions webapp/frontend/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ module.exports = function (config)
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client : {
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters : ['progress', 'kjhtml'],
port : 9876,
colors : true,
logLevel : config.LOG_INFO,
autoWatch : true,
browsers : ['Chrome'],
singleRun : false,
restartOnFileChange : true
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
Loading

0 comments on commit 4192ac7

Please sign in to comment.