191f277641dd6876b0e1c35350ebe34ffR430">430
                         android:paddingLeft="10dp"
431
+                        android:text="@string/box_status"
366 432
                         android:textColor="@color/dark_grey"
367
-                        android:textSize="16sp"
368
-                        />
433
+                        android:textSize="16sp" />
369 434
 
370 435
                     <TextView
371 436
                         android:id="@+id/tv_box_status"
372 437
                         android:layout_width="0dp"
373
-                        android:layout_weight="1"
374 438
                         android:layout_height="match_parent"
439
+                        android:layout_weight="1"
375 440
                         android:gravity="center_vertical|right"
376
-                        android:text="@string/connected_device"
377 441
                         android:paddingRight="10dp"
442
+                        android:text="@string/connected_device"
378 443
                         android:textColor="@color/grey"
379
-                        android:textSize="14sp"
380
-                        />
444
+                        android:textSize="14sp" />
381 445
                 </LinearLayout>
382 446
 
383 447
             </LinearLayout>
384 448
 
385 449
             <LinearLayout
386 450
                 android:id="@+id/layout_price_part"
387
-                android:layout_marginTop="8dp"
388 451
                 android:layout_width="match_parent"
389 452
                 android:layout_height="wrap_content"
453
+                android:layout_marginTop="8dp"
390 454
                 android:background="@color/background_white"
391 455
                 android:orientation="vertical">
392 456
 
@@ -394,15 +458,15 @@
394 458
                     android:id="@+id/layout_price_setting"
395 459
                     android:layout_width="match_parent"
396 460
                     android:layout_height="44dp"
397
-                    android:paddingRight="6dp"
398
-                    android:orientation="horizontal">
461
+                    android:orientation="horizontal"
462
+                    android:paddingRight="6dp">
399 463
 
400 464
                     <TextView
401 465
                         android:layout_width="wrap_content"
402 466
                         android:layout_height="wrap_content"
403 467
                         android:layout_gravity="center_vertical"
404
-                        android:text="@string/price_manage"
405 468
                         android:paddingLeft="10dp"
469
+                        android:text="@string/price_manage"
406 470
                         android:textColor="@color/dark_grey"
407 471
                         android:textSize="16sp" />
408 472
 
@@ -411,47 +475,47 @@
411 475
                         android:layout_width="0dp"
412 476
                         android:layout_height="wrap_content"
413 477
                         android:layout_gravity="center_vertical"
414
-                        android:text="@string/price_manage"
478
+                        android:layout_weight="1"
415 479
                         android:paddingLeft="10dp"
480
+                        android:text="@string/price_manage"
416 481
                         android:textColor="@color/grey"
417
-                        android:textSize="14sp"
418
-                        android:layout_weight="1"/>
482
+                        android:textSize="14sp" />
419 483
 
420 484
                     <ImageView
421 485
                         android:layout_width="10dp"
422 486
                         android:layout_height="18dp"
423 487
                         android:layout_gravity="center_vertical"
424
-                        android:src="@drawable/arrow_right"/>
488
+                        android:src="@drawable/arrow_right" />
425 489
 
426 490
                 </LinearLayout>
427 491
 
428 492
                 <View
429 493
                     android:layout_width="match_parent"
430 494
                     android:layout_height="1px"
431
-                    android:background="@color/text_hint_grey_color"/>
495
+                    android:background="@color/text_hint_grey_color" />
432 496
 
433 497
                 <LinearLayout
434 498
                     android:id="@+id/layout_price_introduction"
435 499
                     android:layout_width="match_parent"
436 500
                     android:layout_height="44dp"
437
-                    android:paddingRight="6dp"
438
-                    android:orientation="horizontal">
501
+                    android:orientation="horizontal"
502
+                    android:paddingRight="6dp">
439 503
 
440 504
                     <TextView
441 505
                         android:layout_width="0dp"
442 506
                         android:layout_height="wrap_content"
443 507
                         android:layout_gravity="center_vertical"
444
-                        android:text="@string/platform_price_rule"
508
+                        android:layout_weight="1"
445 509
                         android:paddingLeft="10dp"
510
+                        android:text="@string/platform_price_rule"
446 511
                         android:textColor="@color/dark_grey"
447
-                        android:textSize="16sp"
448
-                        android:layout_weight="1"/>
512
+                        android:textSize="16sp" />
449 513
 
450 514
                     <ImageView
451 515
                         android:layout_width="10dp"
452 516
                         android:layout_height="18dp"
453 517
                         android:layout_gravity="center_vertical"
454
-                        android:src="@drawable/arrow_right"/>
518
+                        android:src="@drawable/arrow_right" />
455 519
 
456 520
                 </LinearLayout>
457 521
 

+ 6 - 0
app/src/main/res/values/strings.xml

@@ -165,4 +165,10 @@
165 165
     <string name="can_not_delete">该照片已在上传队列,无法删除</string>
166 166
 
167 167
     <string name="sdcard_fail">手机sd卡错误</string>
168
+
169
+    <string name="upload_setting">上传延时设置</string>
170
+
171
+    <string name="upload_slow">长</string>
172
+    <string name="upload_normal">中</string>
173
+    <string name="upload_fast">短</string>
168 174
 </resources>

adminSystem - Gogs: Go Git Service

Nav apraksta

FFIB: 11e3a9652a first 8 gadi atpakaļ
..
CHANGELOG.md 11e3a9652a first 8 gadi atpakaļ
LICENSE 11e3a9652a first 8 gadi atpakaļ
README.md 11e3a9652a first 8 gadi atpakaļ
index.js 11e3a9652a first 8 gadi atpakaļ
package.json 11e3a9652a first 8 gadi atpakaļ

README.md

eslint-loader Build Status

eslint loader for webpack

Install

$ npm install eslint-loader --save-dev

Usage

In your webpack configuration

module.exports = {
  // ...
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "eslint-loader",
        options: {
          // eslint options (if necessary)
        }
      },
    ],
  },
  // ...
}

When using with transpiling loaders (like babel-loader), make sure they are in correct order (bottom to top). Otherwise files will be check after being processed by babel-loader

module.exports = {
  // ...
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: [
          "babel-loader",
          "eslint-loader",
        ],
      },
    ],
  },
  // ...
}

To be safe, you can use enforce: "pre" section to check source files, not modified by other loaders (like babel-loader)

module.exports = {
  // ...
  module: {
    rules: [
      {
        enforce: "pre",
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "eslint-loader",
      },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "babel-loader",
      },
    ],
  },
  // ...
}

Options

You can pass eslint options using standard webpack loader options.

Note that the config option you provide will be passed to the CLIEngine. This is a different set of options than what you'd specify in package.json or .eslintrc. See the eslint docs for more detail.

fix (default: false)

This option will enable ESLint autofix feature.

Be careful: this option might cause webpack to enter an infinite build loop if some issues cannot be fixed properly.

cache (default: false)

This option will enable caching of the linting results into a file. This is particularly useful in reducing linting time when doing a full build.

The cache file is written to the ./node_modules/.cache directory.

formatter (default: eslint stylish formatter)

Loader accepts a function that will have one argument: an array of eslint messages (object). The function must return the output as a string. You can use official eslint formatters.

module.exports = {
  entry: "...",
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "eslint-loader",
        options: {
          // several examples !

          // default value
          formatter: require("eslint/lib/formatters/stylish"),

          // community formatter
          formatter: require("eslint-friendly-formatter"),

          // custom formatter
          formatter: function(results) {
            // `results` format is available here
            // http://eslint.org/docs/developer-guide/nodejs-api.html#executeonfiles()

            // you should return a string
            // DO NOT USE console.*() directly !
            return "OUTPUT"
          }
        }
      },
    ],
  },
}

eslintPath (default: "eslint")

Path to eslint instance that will be used for linting.

module.exports = {
  entry: "...",
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "eslint-loader",
        options: {
          eslintPath: path.join(__dirname, "reusable-eslint-rules.js"),
        }
      },
    ],
  },
  }

Errors and Warning

By default the loader will auto adjust error reporting depending on eslint errors/warnings counts. You can still force this behavior by using emitError or emitWarning options:

emitError (default: false)

Loader will always return errors if this option is set to true.

module.exports = {
  entry: "...",
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "eslint-loader",
        options: {
          emitError: true,
        }
      },
    ],
  },
}
emitWarning (default: false)

Loader will always return warnings if option is set to true.

quiet (default: false)

Loader will process and report errors only and ignore warnings if this option is set to true

module.exports = {
  entry: "...",
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "eslint-loader",
        options: {
          quiet: true,
        }
      },
    ],
  },
}
failOnWarning (default: false)

Loader will cause the module build to fail if there are any eslint warnings.

module.exports = {
  entry: "...",
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "eslint-loader",
        options: {
          failOnWarning: true,
        }
      },
    ],
  },
}
failOnError (default: false)

Loader will cause the module build to fail if there are any eslint errors.

module.exports = {
  entry: "...",
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "eslint-loader",
        options: {
          failOnError: true,
        }
      },
    ],
  },
}
outputReport (default: false)

Write the output of the errors to a file, for example a checkstyle xml file for use for reporting on Jenkins CI

The filePath is relative to the webpack config: output.path You can pass in a different formatter for the output file, if none is passed in the default/configured formatter will be used

module.exports = {
  entry: "...",
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: "eslint-loader",
        options: {
          outputReport: {
            filePath: 'checkstyle.xml',
            formatter: require('eslint/lib/formatters/checkstyle')
          }
        }
      },
    ],
  },
}

Gotchas

NoErrorsPlugin

NoErrorsPlugin prevents webpack from outputting anything into a bundle. So even ESLint warnings will fail the build. No matter what error settings are used for eslint-loader.

So if you want to see ESLint warnings in console during development using WebpackDevServer remove NoErrorsPlugin from webpack config.

Defining configFile or using eslint -c path/.eslintrc

Bear in mind that when you define configFile, eslint doesn't automatically look for .eslintrc files in the directory of the file to be linted. More information is available in official eslint documentation in section Using Configuration Files. See #129.


Changelog

License