├── .github └── workflows │ └── build.yml ├── LICENSE ├── Parted.Makefile ├── README.md ├── applications └── luci-app-diskman │ ├── Makefile │ ├── Makefile.old │ ├── depends.lst │ ├── luasrc │ ├── controller │ │ └── diskman.lua │ ├── model │ │ ├── cbi │ │ │ └── diskman │ │ │ │ ├── btrfs.lua │ │ │ │ ├── disks.lua │ │ │ │ └── partition.lua │ │ └── diskman.lua │ └── view │ │ └── diskman │ │ ├── cbi │ │ ├── disabled_button.htm │ │ ├── format_button.htm │ │ ├── inlinebutton.htm │ │ ├── xnullsection.htm │ │ └── xsimpleform.htm │ │ ├── disk_info.htm │ │ ├── partition_info.htm │ │ └── smart_detail.htm │ └── po │ ├── pl │ └── diskman.po │ ├── templates │ └── diskman.pot │ ├── zh-cn │ └── diskman.po │ ├── zh-tw │ └── diskman.po │ ├── zh_Hans │ └── zh_Hant └── doc ├── disk_info.png └── partitions_info.png /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | # Sequence of patterns matched against refs/tags 4 | tags: 5 | - '*' # Tag events 6 | 7 | name: Upload Release Asset 8 | 9 | jobs: 10 | build: 11 | name: Upload Release Asset 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: checkout codes 15 | uses: actions/checkout@v1 16 | - name: build 17 | id: build_ipk 18 | run: | 19 | TAG=${GITHUB_REF#refs/tags/} 20 | echo ::set-output name=tag_name::${TAG} 21 | mkdir -p /tmp/luci-app-diskman/usr/lib/lua/luci /tmp/luci-app-diskman/www/ 22 | [ -d $GITHUB_WORKSPACE/applications/luci-app-diskman/luasrc ] && cp -R $GITHUB_WORKSPACE/applications/luci-app-diskman/luasrc/* /tmp/luci-app-diskman/usr/lib/lua/luci/ 23 | [ -d $GITHUB_WORKSPACE/applications/luci-app-diskman/root ] && cp -R $GITHUB_WORKSPACE/applications/luci-app-diskman/root/* /tmp/luci-app-diskman/ 24 | [ -d $GITHUB_WORKSPACE/applications/luci-app-diskman/htdocs ] && cp -R $GITHUB_WORKSPACE/applications/luci-app-diskman/htdocs/* /tmp/luci-app-diskman/www/ 25 | [ -d $GITHUB_WORKSPACE/applications/luci-app-diskman/po ] && sudo -E apt-get -y install gcc make && \ 26 | mkdir -p /tmp/po2lmo && mkdir -p /tmp/luci-app-diskman/usr/lib/lua/luci/i18n/ && \ 27 | wget -O /tmp/po2lmo/po2lmo.c https://raw.githubusercontent.com/openwrt/luci/openwrt-18.06/modules/luci-base/src/po2lmo.c && \ 28 | wget -O /tmp/po2lmo/Makefile https://raw.githubusercontent.com/openwrt/luci/openwrt-18.06/modules/luci-base/src/Makefile && \ 29 | wget -O /tmp/po2lmo/template_lmo.h https://raw.githubusercontent.com/openwrt/luci/openwrt-18.06/modules/luci-base/src/template_lmo.h && \ 30 | wget -O /tmp/po2lmo/template_lmo.c https://raw.githubusercontent.com/openwrt/luci/openwrt-18.06/modules/luci-base/src/template_lmo.c && \ 31 | cd /tmp/po2lmo && make po2lmo && \ 32 | ./po2lmo $GITHUB_WORKSPACE/applications/luci-app-diskman/po/zh-cn/diskman.po /tmp/luci-app-diskman/usr/lib/lua/luci/i18n/diskman.zh-cn.lmo && \ 33 | ./po2lmo $GITHUB_WORKSPACE/applications/luci-app-diskman/po/zh-tw/diskman.po /tmp/luci-app-diskman/usr/lib/lua/luci/i18n/diskman.zh-tw.lmo && \ 34 | ./po2lmo $GITHUB_WORKSPACE/applications/luci-app-diskman/po/pl/diskman.po /tmp/luci-app-diskman/usr/lib/lua/luci/i18n/diskman.pl.lmo 35 | mkdir -p /tmp/luci-app-diskman/CONTROL 36 | cat >/tmp/luci-app-diskman/CONTROL/control < 42 | Section: base 43 | Priority: optional 44 | Description: Disk Manager interface for LuCI 45 | Source: http://github.com/lisaac/luci-app-diskman 46 | EOF 47 | cat >/tmp/luci-app-diskman/CONTROL/postinst < 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published by 637 | the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . -------------------------------------------------------------------------------- /Parted.Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2019 OpenWrt.org 3 | # 4 | # This is free software, licensed under the GNU General Public License v2. 5 | # See /LICENSE for more information. 6 | # 7 | include $(TOPDIR)/rules.mk 8 | 9 | PKG_NAME:=parted 10 | PKG_VERSION:=3.3 11 | PKG_RELEASE:=1 12 | 13 | PKG_BUILD_DIR:=$(BUILD_DIR)/parted-$(PKG_VERSION) 14 | PKG_SOURCE:=parted-$(PKG_VERSION).tar.xz 15 | PKG_SOURCE_URL:=@GNU/parted 16 | PKG_MD5SUM:=090655d05f3c471aa8e15a27536889ec 17 | 18 | include $(INCLUDE_DIR)/package.mk 19 | define Package/parted 20 | SECTION:=utils 21 | CATEGORY:=Utilities 22 | SUBMENU:=Disc 23 | TITLE:=parted Partition editor 24 | URL:=http://www.gnu.org/software/parted/index.shtml 25 | DEPENDS:= +libuuid +libreadline +libncurses +libblkid 26 | endef 27 | 28 | define Package/parted/description 29 | parted Partition editor 30 | http://www.gnu.org/software/parted/index.shtml 31 | endef 32 | 33 | define Build/Configure 34 | $(call Build/Configure/Default, \ 35 | --without-readline \ 36 | --disable-device-mapper \ 37 | --disable-nls \ 38 | ) 39 | endef 40 | 41 | define Package/parted/install 42 | $(INSTALL_DIR) $(1)/usr/sbin 43 | $(INSTALL_DIR) $(1)/usr/lib 44 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/libparted/.libs/*.so* $(1)/usr/lib/ 45 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/libparted/fs/.libs/*.so* $(1)/usr/lib/ 46 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/parted/.libs/parted $(1)/usr/sbin/ 47 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/partprobe/.libs/partprobe $(1)/usr/sbin/ 48 | endef 49 | 50 | $(eval $(call BuildPackage,parted)) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Luci-app-diskman 2 | 3 | [![GitHub release (latest by date)](https://img.shields.io/github/v/release/lisaac/luci-app-diskman?style=flat-square)](https://github.com/lisaac/luci-app-diskman/releases) 4 | [![GitHub stars](https://img.shields.io/github/stars/lisaac/luci-app-diskman?style=flat-square)](https://github.com/lisaac/luci-app-diskman/stargazers) 5 | [![GitHub forks](https://img.shields.io/github/forks/lisaac/luci-app-diskman?style=flat-square)](https://github.com/lisaac/luci-app-diskman/network/members) 6 | [![License](https://img.shields.io/github/license/lisaac/luci-app-diskman?style=flat-square)](https://github.com/lisaac/luci-app-diskman/blob/master/LICENSE) 7 | [![Telegram Group](https://img.shields.io/badge/telegam-group-_?style=flat-square)](https://t.me/joinchat/G5mqjhrlU9S8TMkXeBmj0w) 8 | - A Simple Disk Manager for LuCI, support disk partition and format, support raid / btrfs-raid / btrfs-snapshot 9 | - 一个简单的磁盘管理 LuCI 插件,支持磁盘分区、格式化,支持 RAID / btrfs-raid / btrfs-快照管理 10 | - [Download / 下载 ipk](https://github.com/lisaac/luci-app-diskman/releases) 11 | 12 | ## Depends / 依赖 13 | - luci-compat 14 | - luci-lib-ipkg 15 | - [parted](https://github.com/lisaac/luci-app-diskman/blob/master/Parted.Makefile) 16 | - blkid 17 | - smartmontools 18 | - e2fsprogs 19 | - btrfs-progs (Optional) 20 | - lsblk (Optional) 21 | - mdadm (Optional) 22 | - kmod-md-raid456 (Optional) 23 | - kmod-md-linear (Optional) 24 | 25 | ## Compile / 编译 26 | ``` bash 27 | mkdir -p package/luci-app-diskman && \ 28 | wget https://raw.githubusercontent.com/lisaac/luci-app-diskman/master/applications/luci-app-diskman/Makefile -O package/luci-app-diskman/Makefile 29 | mkdir -p package/parted && \ 30 | wget https://raw.githubusercontent.com/lisaac/luci-app-diskman/master/Parted.Makefile -O package/parted/Makefile 31 | 32 | #compile package only 33 | make package/luci-app-diskman/compile V=99 34 | 35 | #compile 36 | make menuconfig 37 | #choose LuCI ---> 3. Applications ---> <*> luci-app-diskman..... Disk Manager interface for LuCI ----> save 38 | make V=99 39 | 40 | ``` 41 | 42 | ## Screenshot / 截图 43 | - Disk Info 44 | ![](https://raw.githubusercontent.com/lisaac/luci-app-diskman/master/doc/disk_info.png) 45 | - Partitions Info 46 | ![](https://raw.githubusercontent.com/lisaac/luci-app-diskman/master/doc/partitions_info.png) 47 | 48 | ## Thanks / 谢致 49 | - [luci-app-diskmanager](http://eko.one.pl/forum/viewtopic.php?id=18669) 50 | - [luci-app-smartinfo](https://github.com/animefansxj/luci-app-smartinfo) 51 | - Chinese translation by [锤子](https://www.right.com.cn/forum/space-uid-311750.html) 52 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/rules.mk 2 | 3 | PKG_NAME:=luci-app-diskman 4 | LUCI_NAME:=luci-app-diskman 5 | PKG_VERSION:=0.2.13 6 | PKG_RELEASE:=1 7 | PKG_MAINTAINER:=lisaac 8 | PKG_LICENSE:=AGPL-3.0 9 | 10 | LUCI_TITLE:=Disk Manager interface for LuCI 11 | 12 | LUCI_DEPENDS:=+luci-compat +luci-lib-ipkg +e2fsprogs +parted +smartmontools +blkid \ 13 | +kmod-fs-vfat +dosfstools +kmod-fs-msdos +kmod-nls-base +kmod-nls-utf8 +kmod-nls-cp932 +kmod-nls-cp936 +kmod-nls-cp950 \ 14 | +kmod-fs-exfat +exfat-mkfs +exfat-fsck \ 15 | +kmod-fs-ntfs \ 16 | +kmod-fs-btrfs \ 17 | +PACKAGE_$(PKG_NAME)_INCLUDE_ntfs_3g_utils:ntfs-3g-utils \ 18 | +PACKAGE_$(PKG_NAME)_INCLUDE_btrfs_progs:btrfs-progs \ 19 | +PACKAGE_$(PKG_NAME)_INCLUDE_lsblk:lsblk \ 20 | +PACKAGE_$(PKG_NAME)_INCLUDE_mdadm:mdadm \ 21 | +PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_raid456:mdadm \ 22 | +PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_raid456:kmod-md-raid456 \ 23 | +PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_linears:mdadm \ 24 | +PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_linears:kmod-md-linear 25 | 26 | LUCI_DESCRIPTION:=Disk Manager interface for LuCI 27 | 28 | define Package/$(PKG_NAME)/config 29 | config PACKAGE_$(PKG_NAME)_INCLUDE_ntfs_3g_utils 30 | depends on PACKAGE_$(PKG_NAME) 31 | bool "Include ntfs-3g-utils" 32 | default y 33 | config PACKAGE_$(PKG_NAME)_INCLUDE_btrfs_progs 34 | depends on PACKAGE_$(PKG_NAME) 35 | bool "Include btrfs-progs" 36 | default y 37 | config PACKAGE_$(PKG_NAME)_INCLUDE_lsblk 38 | depends on PACKAGE_$(PKG_NAME) 39 | bool "Include lsblk" 40 | default y 41 | config PACKAGE_$(PKG_NAME)_INCLUDE_mdadm 42 | depends on PACKAGE_$(PKG_NAME) 43 | bool "Include mdadm" 44 | default n 45 | config PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_raid456 46 | depends on PACKAGE_$(PKG_NAME)_INCLUDE_mdadm 47 | bool "Include kmod-md-raid456" 48 | default n 49 | config PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_linears 50 | depends on PACKAGE_$(PKG_NAME)_INCLUDE_mdadm 51 | bool "Include kmod-md-linear" 52 | default n 53 | endef 54 | 55 | include $(TOPDIR)/feeds/luci/luci.mk 56 | 57 | # call BuildPackage - OpenWrt buildroot signature 58 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/Makefile.old: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/rules.mk 2 | 3 | PKG_NAME:=luci-app-diskman 4 | PKG_VERSION:=v0.2.11 5 | PKG_RELEASE:=beta 6 | PKG_MAINTAINER:=lisaac 7 | PKG_LICENSE:=AGPL-3.0 8 | 9 | PKG_SOURCE_PROTO:=git 10 | PKG_SOURCE_URL:=https://github.com/lisaac/luci-app-diskman.git 11 | PKG_SOURCE_VERSION:=$(PKG_VERSION) 12 | 13 | PKG_SOURCE_SUBDIR:=$(PKG_NAME) 14 | PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_SOURCE_VERSION).tar.gz 15 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)/applications/luci-app-diskman 16 | 17 | include $(INCLUDE_DIR)/package.mk 18 | 19 | define Package/$(PKG_NAME)/config 20 | config PACKAGE_$(PKG_NAME)_INCLUDE_ntfs_3g_utils 21 | depends on PACKAGE_$(PKG_NAME) 22 | bool "Include ntfs-3g-utils" 23 | default y 24 | config PACKAGE_$(PKG_NAME)_INCLUDE_btrfs_progs 25 | depends on PACKAGE_$(PKG_NAME) 26 | bool "Include btrfs-progs" 27 | default y 28 | config PACKAGE_$(PKG_NAME)_INCLUDE_lsblk 29 | depends on PACKAGE_$(PKG_NAME) 30 | bool "Include lsblk" 31 | default y 32 | config PACKAGE_$(PKG_NAME)_INCLUDE_mdadm 33 | depends on PACKAGE_$(PKG_NAME) 34 | bool "Include mdadm" 35 | default n 36 | config PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_raid456 37 | depends on PACKAGE_$(PKG_NAME)_INCLUDE_mdadm 38 | bool "Include kmod-md-raid456" 39 | default n 40 | config PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_linears 41 | depends on PACKAGE_$(PKG_NAME)_INCLUDE_mdadm 42 | bool "Include kmod-md-linear" 43 | default n 44 | endef 45 | 46 | define Package/$(PKG_NAME) 47 | SECTION:=luci 48 | CATEGORY:=LuCI 49 | SUBMENU:=3. Applications 50 | TITLE:=Disk Manager interface for LuCI 51 | PKGARCH:=all 52 | DEPENDS:=+e2fsprogs +parted +smartmontools +blkid \ 53 | +kmod-fs-vfat +dosfstools +kmod-fs-msdos +kmod-nls-base +kmod-nls-utf8 +kmod-nls-cp932 +kmod-nls-cp936 +kmod-nls-cp950 \ 54 | +kmod-fs-exfat +exfat-mkfs +exfat-fsck \ 55 | +kmod-fs-ntfs \ 56 | +kmod-fs-btrfs \ 57 | +PACKAGE_$(PKG_NAME)_INCLUDE_ntfs_3g_utils:ntfs-3g-utils \ 58 | +PACKAGE_$(PKG_NAME)_INCLUDE_btrfs_progs:btrfs-progs \ 59 | +PACKAGE_$(PKG_NAME)_INCLUDE_lsblk:lsblk \ 60 | +PACKAGE_$(PKG_NAME)_INCLUDE_mdadm:mdadm \ 61 | +PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_raid456:mdadm \ 62 | +PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_raid456:kmod-md-raid456 \ 63 | +PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_linears:mdadm \ 64 | +PACKAGE_$(PKG_NAME)_INCLUDE_kmod_md_linears:kmod-md-linear 65 | endef 66 | 67 | define Package/$(PKG_NAME)/description 68 | Disk Manager interface for LuCI 69 | endef 70 | 71 | define Build/Prepare 72 | tar -xzvf $(DL_DIR)/$(PKG_SOURCE) -C $(BUILD_DIR) 73 | endef 74 | 75 | define Build/Compile 76 | endef 77 | 78 | define Package/$(PKG_NAME)/postinst 79 | #!/bin/sh 80 | rm -fr /tmp/luci-indexcache /tmp/luci-modulecache 81 | endef 82 | 83 | define Package/$(PKG_NAME)/install 84 | # $(INSTALL_DIR) $(1)/ 85 | # cp -pR $(PKG_BUILD_DIR)/root/* $(1)/ 86 | # $(INSTALL_DIR) $(1)/www 87 | # cp -pR $(PKG_BUILD_DIR)/htdoc/* $(1)/www 88 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci 89 | cp -pR $(PKG_BUILD_DIR)/luasrc/* $(1)/usr/lib/lua/luci/ 90 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n 91 | $$(foreach po,$$(shell find $(PKG_BUILD_DIR)/po/*/*.po), \ 92 | po2lmo $$(po) \ 93 | $(1)/usr/lib/lua/luci/i18n/diskman.$$(shell echo $$(po) | awk -F'/' '{print $$$$(NF-1)}').lmo;) 94 | #po2lmo $(PKG_BUILD_DIR)/po/zh-cn/diskman.po $(1)/usr/lib/lua/luci/i18n/diskman.zh-cn.lmo 95 | endef 96 | 97 | $(eval $(call BuildPackage,$(PKG_NAME))) 98 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/depends.lst: -------------------------------------------------------------------------------- 1 | e2fsprogs parted smartmontools blkid mdadm btrfs-progs util-linux -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/controller/diskman.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | LuCI - Lua Configuration Interface 3 | Copyright 2019 lisaac 4 | ]]-- 5 | 6 | require "luci.util" 7 | module("luci.controller.diskman",package.seeall) 8 | 9 | function index() 10 | -- check all used executables in disk management are existed 11 | local CMD = {"parted", "blkid", "smartctl"} 12 | local executables_all_existed = true 13 | for _, cmd in ipairs(CMD) do 14 | local command = luci.sys.exec("/usr/bin/which " .. cmd) 15 | if not command:match(cmd) then 16 | executables_all_existed = false 17 | break 18 | end 19 | end 20 | 21 | if not executables_all_existed then return end 22 | -- entry(path, target, title, order) 23 | -- set leaf attr to true to pass argument throughe url (e.g. admin/system/disk/partition/sda) 24 | entry({"admin", "system", "diskman"}, alias("admin", "system", "diskman", "disks"), _("Disk Man"), 55) 25 | entry({"admin", "system", "diskman", "disks"}, form("diskman/disks"), nil).leaf = true 26 | entry({"admin", "system", "diskman", "partition"}, form("diskman/partition"), nil).leaf = true 27 | entry({"admin", "system", "diskman", "btrfs"}, form("diskman/btrfs"), nil).leaf = true 28 | entry({"admin", "system", "diskman", "format_partition"}, call("format_partition"), nil).leaf = true 29 | entry({"admin", "system", "diskman", "get_disk_info"}, call("get_disk_info"), nil).leaf = true 30 | entry({"admin", "system", "diskman", "mk_p_table"}, call("mk_p_table"), nil).leaf = true 31 | entry({"admin", "system", "diskman", "smartdetail"}, call("smart_detail"), nil).leaf = true 32 | entry({"admin", "system", "diskman", "smartattr"}, call("smart_attr"), nil).leaf = true 33 | end 34 | 35 | function format_partition() 36 | local partation_name = luci.http.formvalue("partation_name") 37 | local fs = luci.http.formvalue("file_system") 38 | if not partation_name then 39 | luci.http.status(500, "Partition NOT found!") 40 | luci.http.write_json("Partition NOT found!") 41 | return 42 | elseif not nixio.fs.access("/dev/"..partation_name) then 43 | luci.http.status(500, "Partition NOT found!") 44 | luci.http.write_json("Partition NOT found!") 45 | return 46 | elseif not fs then 47 | luci.http.status(500, "no file system") 48 | luci.http.write_json("no file system") 49 | return 50 | end 51 | local dm = require "luci.model.diskman" 52 | code, msg = dm.format_partition(partation_name, fs) 53 | luci.http.status(code, msg) 54 | luci.http.write_json(msg) 55 | end 56 | 57 | function get_disk_info(dev) 58 | if not dev then 59 | luci.http.status(500, "no device") 60 | luci.http.write_json("no device") 61 | return 62 | elseif not nixio.fs.access("/dev/"..dev) then 63 | luci.http.status(500, "no device") 64 | luci.http.write_json("no device") 65 | return 66 | end 67 | local dm = require "luci.model.diskman" 68 | local device_info = dm.get_disk_info(dev) 69 | luci.http.status(200, "ok") 70 | luci.http.prepare_content("application/json") 71 | luci.http.write_json(device_info) 72 | end 73 | 74 | function mk_p_table() 75 | local p_table = luci.http.formvalue("p_table") 76 | local dev = luci.http.formvalue("dev") 77 | if not dev then 78 | luci.http.status(500, "no device") 79 | luci.http.write_json("no device") 80 | return 81 | elseif not nixio.fs.access("/dev/"..dev) then 82 | luci.http.status(500, "no device") 83 | luci.http.write_json("no device") 84 | return 85 | end 86 | local dm = require "luci.model.diskman" 87 | if p_table == "GPT" or p_table == "MBR" then 88 | p_table = p_table == "MBR" and "msdos" or "gpt" 89 | local res = luci.sys.call(dm.command.parted .. " -s /dev/" .. dev .. " mktable ".. p_table) 90 | if res == 0 then 91 | luci.http.status(200, "ok") 92 | else 93 | luci.http.status(500, "command exec error") 94 | end 95 | luci.http.prepare_content("application/json") 96 | luci.http.write_json({code=res}) 97 | else 98 | luci.http.status(404, "not support") 99 | luci.http.prepare_content("application/json") 100 | luci.http.write_json({code="1"}) 101 | end 102 | end 103 | 104 | function smart_detail(dev) 105 | luci.template.render("diskman/smart_detail", {dev=dev}) 106 | end 107 | 108 | function smart_attr(dev) 109 | local attr = { } 110 | local dm = require "luci.model.diskman" 111 | local cmd = io.popen(dm.command.smartctl .. " -H -A -i /dev/%s" % dev) 112 | if cmd then 113 | local content = cmd:read("*all") 114 | local ln 115 | cmd:close() 116 | if content:match("NVMe Version:")then 117 | for ln in string.gmatch(content,'[^\r\n]+') do 118 | if ln:match("^(.-):%s+(.+)") then 119 | local key, value = ln:match("^(.-):%s+(.+)") 120 | attr[#attr+1]= { 121 | key = key, 122 | value = value 123 | } 124 | end 125 | end 126 | else 127 | for ln in string.gmatch(content,'[^\r\n]+') do 128 | if ln:match("^.*%d+%s+.+%s+.+%s+.+%s+.+%s+.+%s+.+%s+.+%s+.+%s+.+") then 129 | local id,attrbute,flag,value,worst,thresh,type,updated,raw = ln:match("^%s*(%d+)%s+([%a%p]+)%s+(%w+)%s+(%d+)%s+(%d+)%s+(%d+)%s+([%a%p]+)%s+(%a+)%s+[%w%p]+%s+(.+)") 130 | id= "%x" % id 131 | if not id:match("^%w%w") then 132 | id = "0%s" % id 133 | end 134 | attr[#attr+1]= { 135 | id = id:upper(), 136 | attrbute = attrbute, 137 | flag = flag, 138 | value = value, 139 | worst = worst, 140 | thresh = thresh, 141 | type = type, 142 | updated = updated, 143 | raw = raw 144 | } 145 | end 146 | end 147 | end 148 | end 149 | luci.http.prepare_content("application/json") 150 | luci.http.write_json(attr) 151 | end -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | LuCI - Lua Configuration Interface 3 | Copyright 2019 lisaac 4 | ]]-- 5 | 6 | require "luci.util" 7 | require("luci.tools.webadmin") 8 | local dm = require "luci.model.diskman" 9 | local uuid = arg[1] 10 | 11 | if not uuid then luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman")) end 12 | 13 | -- mount subv=/ to tempfs 14 | mount_point = "/tmp/.btrfs_tmp" 15 | nixio.fs.mkdirr(mount_point) 16 | luci.util.exec(dm.command.umount .. " "..mount_point .. " >/dev/null 2>&1") 17 | luci.util.exec(dm.command.mount .. " -t btrfs -o subvol=/ UUID="..uuid.." "..mount_point) 18 | 19 | m = SimpleForm("btrfs", translate("Btrfs"), translate("Manage Btrfs")) 20 | m.template = "diskman/cbi/xsimpleform" 21 | m.redirect = luci.dispatcher.build_url("admin/system/diskman") 22 | m.submit = false 23 | m.reset = false 24 | 25 | -- info 26 | local btrfs_info = dm.get_btrfs_info(mount_point) 27 | local table_btrfs_info = m:section(Table, {btrfs_info}, translate("Btrfs Info")) 28 | table_btrfs_info:option(DummyValue, "uuid", translate("UUID")) 29 | table_btrfs_info:option(DummyValue, "members", translate("Members")) 30 | table_btrfs_info:option(DummyValue, "data_raid_level", translate("Data")) 31 | table_btrfs_info:option(DummyValue, "metadata_raid_lavel", translate("Metadata")) 32 | table_btrfs_info:option(DummyValue, "size_formated", translate("Size")) 33 | table_btrfs_info:option(DummyValue, "used_formated", translate("Used")) 34 | table_btrfs_info:option(DummyValue, "free_formated", translate("Free Space")) 35 | table_btrfs_info:option(DummyValue, "usage", translate("Usage")) 36 | local v_btrfs_label = table_btrfs_info:option(Value, "label", translate("Label")) 37 | local value_btrfs_label = "" 38 | v_btrfs_label.write = function(self, section, value) 39 | value_btrfs_label = value or "" 40 | end 41 | local btn_update_label = table_btrfs_info:option(Button, "_update_label") 42 | btn_update_label.inputtitle = translate("Update") 43 | btn_update_label.inputstyle = "edit" 44 | btn_update_label.write = function(self, section, value) 45 | local cmd = dm.command.btrfs .. " filesystem label " .. mount_point .. " " .. value_btrfs_label 46 | local res = luci.util.exec(cmd) 47 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman/btrfs/" .. uuid)) 48 | end 49 | -- subvolume 50 | local subvolume_list = dm.get_btrfs_subv(mount_point) 51 | subvolume_list["_"] = { ID = 0 } 52 | table_subvolume = m:section(Table, subvolume_list, translate("SubVolumes")) 53 | table_subvolume:option(DummyValue, "id", translate("ID")) 54 | table_subvolume:option(DummyValue, "top_level", translate("Top Level")) 55 | table_subvolume:option(DummyValue, "uuid", translate("UUID")) 56 | table_subvolume:option(DummyValue, "otime", translate("Otime")) 57 | table_subvolume:option(DummyValue, "snapshots", translate("Snapshots")) 58 | local v_path = table_subvolume:option(Value, "path", translate("Path")) 59 | v_path.forcewrite = true 60 | v_path.render = function(self, section, scope) 61 | if subvolume_list[section].ID == 0 then 62 | self.template = "cbi/value" 63 | self.placeholder = "/my_subvolume" 64 | self.forcewrite = true 65 | Value.render(self, section, scope) 66 | else 67 | self.template = "cbi/dvalue" 68 | DummyValue.render(self, section, scope) 69 | end 70 | end 71 | local value_path 72 | v_path.write = function(self, section, value) 73 | value_path = value 74 | end 75 | local btn_set_default = table_subvolume:option(Button, "_subv_set_default", translate("Set Default")) 76 | btn_set_default.forcewrite = true 77 | btn_set_default.inputstyle = "edit" 78 | btn_set_default.template = "diskman/cbi/disabled_button" 79 | btn_set_default.render = function(self, section, scope) 80 | if subvolume_list[section].default_subvolume then 81 | self.view_disabled = true 82 | self.inputtitle = translate("Set Default") 83 | elseif subvolume_list[section].ID == 0 then 84 | self.template = "cbi/dvalue" 85 | else 86 | self.inputtitle = translate("Set Default") 87 | self.view_disabled = false 88 | end 89 | Button.render(self, section, scope) 90 | end 91 | btn_set_default.write = function(self, section, value) 92 | local cmd 93 | if value == translate("Set Default") then 94 | cmd = dm.command.btrfs .. " subvolume set-default " .. mount_point..subvolume_list[section].path 95 | else 96 | cmd = dm.command.btrfs .. " subvolume set-default " .. mount_point.."/" 97 | end 98 | local res = luci.util.exec(cmd.. " 2>&1") 99 | if res and (res:match("ERR") or res:match("not enough arguments")) then 100 | m.errmessage = res 101 | else 102 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman/btrfs/" .. uuid)) 103 | end 104 | end 105 | local btn_remove = table_subvolume:option(Button, "_subv_remove") 106 | btn_remove.template = "diskman/cbi/disabled_button" 107 | btn_remove.forcewrite = true 108 | btn_remove.render = function(self, section, scope) 109 | if subvolume_list[section].ID == 0 then 110 | btn_remove.inputtitle = translate("Create") 111 | btn_remove.inputstyle = "add" 112 | self.view_disabled = false 113 | elseif subvolume_list[section].path == "/" or subvolume_list[section].default_subvolume then 114 | btn_remove.inputtitle = translate("Delete") 115 | btn_remove.inputstyle = "remove" 116 | self.view_disabled = true 117 | else 118 | btn_remove.inputtitle = translate("Delete") 119 | btn_remove.inputstyle = "remove" 120 | self.view_disabled = false 121 | end 122 | Button.render(self, section, scope) 123 | end 124 | 125 | btn_remove.write = function(self, section, value) 126 | local cmd 127 | if value == translate("Delete") then 128 | cmd = dm.command.btrfs .. " subvolume delete " .. mount_point .. subvolume_list[section].path 129 | elseif value == translate("Create") then 130 | if value_path and value_path:match("^/") then 131 | cmd = dm.command.btrfs .. " subvolume create " .. mount_point .. value_path 132 | else 133 | m.errmessage = translate("Please input Subvolume Path, Subvolume must start with '/'") 134 | return 135 | end 136 | end 137 | local res = luci.util.exec(cmd.. " 2>&1") 138 | if res and (res:match("ERR") or res:match("not enough arguments")) then 139 | m.errmessage = luci.util.pcdata(res) 140 | else 141 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman/btrfs/" .. uuid)) 142 | end 143 | end 144 | -- snapshot 145 | -- local snapshot_list = dm.get_btrfs_subv(mount_point, 1) 146 | -- table_snapshot = m:section(Table, snapshot_list, translate("Snapshots")) 147 | -- table_snapshot:option(DummyValue, "id", translate("ID")) 148 | -- table_snapshot:option(DummyValue, "top_level", translate("Top Level")) 149 | -- table_snapshot:option(DummyValue, "uuid", translate("UUID")) 150 | -- table_snapshot:option(DummyValue, "otime", translate("Otime")) 151 | -- table_snapshot:option(DummyValue, "path", translate("Path")) 152 | -- local snp_remove = table_snapshot:option(Button, "_snp_remove") 153 | -- snp_remove.inputtitle = translate("Delete") 154 | -- snp_remove.inputstyle = "remove" 155 | -- snp_remove.write = function(self, section, value) 156 | -- local cmd = dm.command.btrfs .. " subvolume delete " .. mount_point .. snapshot_list[section].path 157 | -- local res = luci.util.exec(cmd.. " 2>&1") 158 | -- if res and (res:match("ERR") or res:match("not enough arguments")) then 159 | -- m.errmessage = luci.util.pcdata(res) 160 | -- else 161 | -- luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman/btrfs/" .. uuid)) 162 | -- end 163 | -- end 164 | 165 | -- new snapshots 166 | local s_snapshot = m:section(SimpleSection, translate("New Snapshot")) 167 | local value_sorce, value_dest, value_readonly 168 | local v_sorce = s_snapshot:option(Value, "_source", translate("Source Path"), translate("The source path for create the snapshot")) 169 | v_sorce.placeholder = "/data" 170 | v_sorce.forcewrite = true 171 | v_sorce.write = function(self, section, value) 172 | value_sorce = value 173 | end 174 | 175 | local v_readonly = s_snapshot:option(Flag, "_readonly", translate("Readonly"), translate("The path where you want to store the snapshot")) 176 | v_readonly.forcewrite = true 177 | v_readonly.rmempty = false 178 | v_readonly.disabled = 0 179 | v_readonly.enabled = 1 180 | v_readonly.default = 1 181 | v_readonly.write = function(self, section, value) 182 | value_readonly = value 183 | end 184 | local v_dest = s_snapshot:option(Value, "_dest", translate("Destination Path (optional)")) 185 | v_dest.forcewrite = true 186 | v_dest.placeholder = "/.snapshot/202002051538" 187 | v_dest.write = function(self, section, value) 188 | value_dest = value 189 | end 190 | local btn_snp_create = s_snapshot:option(Button, "_snp_create") 191 | btn_snp_create.title = " " 192 | btn_snp_create.inputtitle = translate("New Snapshot") 193 | btn_snp_create.inputstyle = "add" 194 | btn_snp_create.write = function(self, section, value) 195 | if value_sorce and value_sorce:match("^/") then 196 | if not value_dest then value_dest = "/.snapshot"..value_sorce.."/"..os.date("%Y%m%d%H%M%S") end 197 | nixio.fs.mkdirr(mount_point..value_dest:match("(.-)[^/]+$")) 198 | local cmd = dm.command.btrfs .. " subvolume snapshot" .. (value_readonly == 1 and " -r " or " ") .. mount_point..value_sorce .. " " .. mount_point..value_dest 199 | local res = luci.util.exec(cmd .. " 2>&1") 200 | if res and (res:match("ERR") or res:match("not enough arguments")) then 201 | m.errmessage = luci.util.pcdata(res) 202 | else 203 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman/btrfs/" .. uuid)) 204 | end 205 | else 206 | m.errmessage = translate("Please input Source Path of snapshot, Source Path must start with '/'") 207 | end 208 | end 209 | 210 | return m 211 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | LuCI - Lua Configuration Interface 3 | Copyright 2019 lisaac 4 | ]]-- 5 | 6 | require "luci.util" 7 | require("luci.tools.webadmin") 8 | local dm = require "luci.model.diskman" 9 | 10 | -- Use (non-UCI) SimpleForm since we have no related config file 11 | m = SimpleForm("diskman", translate("DiskMan"), translate("Manage Disks over LuCI.")) 12 | m.template = "diskman/cbi/xsimpleform" 13 | m:append(Template("diskman/disk_info")) 14 | -- disable submit and reset button 15 | m.submit = false 16 | m.reset = false 17 | -- rescan disks 18 | rescan = m:section(SimpleSection) 19 | rescan_button = rescan:option(Button, "_rescan") 20 | rescan_button.inputtitle= translate("Rescan Disks") 21 | rescan_button.template = "diskman/cbi/inlinebutton" 22 | rescan_button.inputstyle = "add" 23 | rescan_button.forcewrite = true 24 | rescan_button.write = function(self, section, value) 25 | luci.util.exec("echo '- - -' | tee /sys/class/scsi_host/host*/scan > /dev/null") 26 | if dm.command.mdadm then 27 | luci.util.exec(dm.command.mdadm .. " --assemble --scan") 28 | end 29 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman")) 30 | end 31 | 32 | -- disks 33 | local disks = dm.list_devices() 34 | d = m:section(Table, disks, translate("Disks")) 35 | d.config = "disk" 36 | -- option(type, id(key of table), text) 37 | d:option(DummyValue, "path", translate("Path")) 38 | d:option(DummyValue, "model", translate("Model")) 39 | d:option(DummyValue, "sn", translate("Serial Number")) 40 | d:option(DummyValue, "size_formated", translate("Size")) 41 | d:option(DummyValue, "temp", translate("Temp")) 42 | -- d:option(DummyValue, "sec_size", translate("Sector Size ")) 43 | d:option(DummyValue, "p_table", translate("Partition Table")) 44 | d:option(DummyValue, "sata_ver", translate("SATA Version")) 45 | -- d:option(DummyValue, "rota_rate", translate("Rotation Rate")) 46 | d:option(DummyValue, "health_status", translate("Health") .. "
" .. translate("Status")) 47 | -- d:option(DummyValue, "status", translate("Status")) 48 | 49 | -- local btn_eject = d:option(Button, "_eject") 50 | -- btn_eject.template = "diskman/cbi/disabled_button" 51 | -- btn_eject.inputstyle = "remove" 52 | -- btn_eject.inputtitle = translate("Eject") 53 | -- btn_eject.forcewrite = true 54 | -- btn_eject.write = function(self, section, value) 55 | -- local dev = section 56 | -- local disk_info = dm.get_disk_info(dev, true) 57 | -- if disk_info.p_table:match("Raid") then 58 | -- m.errmessage = translate("Unsupported raid reject!") 59 | -- return 60 | -- end 61 | -- for i, p in ipairs(disk_info.partitions) do 62 | -- if p.mount_point ~= "-" then 63 | -- m.errmessage = p.name .. translate("is in use! please unmount it first!") 64 | -- return 65 | -- end 66 | -- end 67 | -- if disk_info.type:match("md") then 68 | -- luci.util.exec(dm.command.mdadm .. " --stop /dev/" .. dev) 69 | -- luci.util.exec(dm.command.mdadm .. " --remove /dev/" .. dev) 70 | -- for _, disk in ipairs(disk_info.members) do 71 | -- luci.util.exec(dm.command.mdadm .. " --zero-superblock " .. disk) 72 | -- end 73 | -- dm.gen_mdadm_config() 74 | -- else 75 | -- luci.util.exec("echo 1 > /sys/block/" .. dev .. "/device/delete") 76 | -- end 77 | -- luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman")) 78 | -- end 79 | 80 | d.extedit = luci.dispatcher.build_url("admin/system/diskman/partition/%s") 81 | 82 | -- raid devices 83 | if dm.command.mdadm then 84 | local raid_devices = dm.list_raid_devices() 85 | -- raid_devices = diskmanager.getRAIDdevices() 86 | if next(raid_devices) ~= nil then 87 | local r = m:section(Table, raid_devices, translate("RAID Devices")) 88 | r.config = "_raid" 89 | r:option(DummyValue, "path", translate("Path")) 90 | r:option(DummyValue, "level", translate("RAID mode")) 91 | r:option(DummyValue, "size_formated", translate("Size")) 92 | r:option(DummyValue, "p_table", translate("Partition Table")) 93 | r:option(DummyValue, "status", translate("Status")) 94 | r:option(DummyValue, "members_str", translate("Members")) 95 | r:option(DummyValue, "active", translate("Active")) 96 | r.extedit = luci.dispatcher.build_url("admin/system/diskman/partition/%s") 97 | end 98 | end 99 | 100 | -- btrfs devices 101 | if dm.command.btrfs then 102 | btrfs_devices = dm.list_btrfs_devices() 103 | if next(btrfs_devices) ~= nil then 104 | local table_btrfs = m:section(Table, btrfs_devices, translate("Btrfs")) 105 | table_btrfs:option(DummyValue, "uuid", translate("UUID")) 106 | table_btrfs:option(DummyValue, "label", translate("Label")) 107 | table_btrfs:option(DummyValue, "members", translate("Members")) 108 | -- sieze is error, since there is RAID 109 | -- table_btrfs:option(DummyValue, "size_formated", translate("Size")) 110 | table_btrfs:option(DummyValue, "used_formated", translate("Usage")) 111 | table_btrfs.extedit = luci.dispatcher.build_url("admin/system/diskman/btrfs/%s") 112 | end 113 | end 114 | 115 | -- mount point 116 | local mount_point = dm.get_mount_points() 117 | local _mount_point = {} 118 | table.insert( mount_point, { device = 0 } ) 119 | local table_mp = m:section(Table, mount_point, translate("Mount Point")) 120 | local v_device = table_mp:option(Value, "device", translate("Device")) 121 | v_device.render = function(self, section, scope) 122 | if mount_point[section].device == 0 then 123 | self.template = "cbi/value" 124 | self.forcewrite = true 125 | for dev, info in pairs(disks) do 126 | for i, v in ipairs(info.partitions) do 127 | self:value("/dev/".. v.name, "/dev/".. v.name .. " ".. v.size_formated) 128 | end 129 | end 130 | Value.render(self, section, scope) 131 | else 132 | self.template = "cbi/dvalue" 133 | DummyValue.render(self, section, scope) 134 | end 135 | end 136 | v_device.write = function(self, section, value) 137 | _mount_point.device = value and value:gsub("%s+", "") or "" 138 | end 139 | local v_fs = table_mp:option(Value, "fs", translate("File System")) 140 | v_fs.render = function(self, section, scope) 141 | if mount_point[section].device == 0 then 142 | self.template = "cbi/value" 143 | self:value("auto", "auto") 144 | self.default = "auto" 145 | self.forcewrite = true 146 | Value.render(self, section, scope) 147 | else 148 | self.template = "cbi/dvalue" 149 | DummyValue.render(self, section, scope) 150 | end 151 | end 152 | v_fs.write = function(self, section, value) 153 | _mount_point.fs = value and value:gsub("%s+", "") or "" 154 | end 155 | local v_mount_option = table_mp:option(Value, "mount_options", translate("Mount Options")) 156 | v_mount_option.render = function(self, section, scope) 157 | if mount_point[section].device == 0 then 158 | self.template = "cbi/value" 159 | self.placeholder = "rw,noauto" 160 | self.forcewrite = true 161 | Value.render(self, section, scope) 162 | else 163 | self.template = "cbi/dvalue" 164 | local mp = mount_point[section].mount_options 165 | mount_point[section].mount_options = nil 166 | local length = 0 167 | for k in mp:gmatch("([^,]+)") do 168 | mount_point[section].mount_options = mount_point[section].mount_options and (mount_point[section].mount_options .. ",") or "" 169 | if length > 20 then 170 | mount_point[section].mount_options = mount_point[section].mount_options.. "
" 171 | length = 0 172 | end 173 | mount_point[section].mount_options = mount_point[section].mount_options .. k 174 | length = length + #k 175 | end 176 | self.rawhtml = true 177 | -- mount_point[section].mount_options = #mount_point[section].mount_options > 50 and mount_point[section].mount_options:sub(1,50) .. "..." or mount_point[section].mount_options 178 | DummyValue.render(self, section, scope) 179 | end 180 | end 181 | v_mount_option.write = function(self, section, value) 182 | _mount_point.mount_options = value and value:gsub("%s+", "") or "" 183 | end 184 | local v_mount_point = table_mp:option(Value, "mount_point", translate("Mount Point")) 185 | v_mount_point.render = function(self, section, scope) 186 | if mount_point[section].device == 0 then 187 | self.template = "cbi/value" 188 | self.placeholder = "/media/diskX" 189 | self.forcewrite = true 190 | Value.render(self, section, scope) 191 | else 192 | self.template = "cbi/dvalue" 193 | local new_mp = "" 194 | local v_mp_d 195 | for v_mp_d in self["section"]["data"][section]["mount_point"]:gmatch('[^/]+') do 196 | if #v_mp_d > 12 then 197 | new_mp = new_mp .. "/" .. v_mp_d:sub(1,7) .. ".." .. v_mp_d:sub(-4) 198 | else 199 | new_mp = new_mp .."/".. v_mp_d 200 | end 201 | end 202 | self["section"]["data"][section]["mount_point"] = ''..new_mp..'' 203 | self.rawhtml = true 204 | DummyValue.render(self, section, scope) 205 | end 206 | end 207 | v_mount_point.write = function(self, section, value) 208 | _mount_point.mount_point = value 209 | end 210 | local btn_umount = table_mp:option(Button, "_mount", translate("Mount")) 211 | btn_umount.forcewrite = true 212 | btn_umount.render = function(self, section, scope) 213 | if mount_point[section].device == 0 then 214 | self.inputtitle = translate("Mount") 215 | btn_umount.inputstyle = "add" 216 | else 217 | self.inputtitle = translate("Umount") 218 | btn_umount.inputstyle = "remove" 219 | end 220 | Button.render(self, section, scope) 221 | end 222 | btn_umount.write = function(self, section, value) 223 | local res 224 | if value == translate("Mount") then 225 | if not _mount_point.mount_point or not _mount_point.device then return end 226 | luci.util.exec("mkdir -p ".. _mount_point.mount_point) 227 | res = luci.util.exec(dm.command.mount .. " ".. _mount_point.device .. (_mount_point.fs and (" -t ".. _mount_point.fs )or "") .. (_mount_point.mount_options and (" -o " .. _mount_point.mount_options.. " ") or " ").._mount_point.mount_point .. " 2>&1") 228 | elseif value == translate("Umount") then 229 | res = luci.util.exec(dm.command.umount .. " "..mount_point[section].mount_point .. " 2>&1") 230 | end 231 | if res:match("^mount:") or res:match("^umount:") then 232 | m.errmessage = luci.util.pcdata(res) 233 | else 234 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman")) 235 | end 236 | end 237 | 238 | if dm.command.mdadm or dm.command.btrfs then 239 | local creation_section = m:section(TypedSection, "_creation") 240 | creation_section.cfgsections=function() 241 | return {translate("Creation")} 242 | end 243 | creation_section:tab("raid", translate("RAID"), translate("RAID Creation")) 244 | creation_section:tab("btrfs", translate("Btrfs"), translate("Multiple Devices Btrfs Creation")) 245 | 246 | -- raid functions 247 | if dm.command.mdadm then 248 | 249 | local rname, rmembers, rlevel 250 | local r_name = creation_section:taboption("raid", Value, "_rname", translate("Raid Name")) 251 | r_name.placeholder = dm.find_free_md_device() 252 | r_name.write = function(self, section, value) 253 | rname = value 254 | end 255 | local r_level = creation_section:taboption("raid", ListValue, "_rlevel", translate("Raid Level")) 256 | local valid_raid = luci.util.exec("grep -m1 'Personalities :' /proc/mdstat") 257 | if valid_raid:match("%[linear%]") then 258 | r_level:value("linear", "Linear") 259 | end 260 | if valid_raid:match("%[raid5%]") then 261 | r_level:value("5", "Raid 5") 262 | end 263 | if valid_raid:match("%[raid6%]") then 264 | r_level:value("6", "Raid 6") 265 | end 266 | if valid_raid:match("%[raid1%]") then 267 | r_level:value("1", "Raid 1") 268 | end 269 | if valid_raid:match("%[raid0%]") then 270 | r_level:value("0", "Raid 0") 271 | end 272 | if valid_raid:match("%[raid10%]") then 273 | r_level:value("10", "Raid 10") 274 | end 275 | r_level.write = function(self, section, value) 276 | rlevel = value 277 | end 278 | local r_member = creation_section:taboption("raid", DynamicList, "_rmember", translate("Raid Member")) 279 | for dev, info in pairs(disks) do 280 | if not info.inuse and #info.partitions == 0 then 281 | r_member:value(info.path, info.path.. " ".. info.size_formated) 282 | end 283 | for i, v in ipairs(info.partitions) do 284 | if not v.inuse then 285 | r_member:value("/dev/".. v.name, "/dev/".. v.name .. " ".. v.size_formated) 286 | end 287 | end 288 | end 289 | r_member.write = function(self, section, value) 290 | rmembers = value 291 | end 292 | local r_create = creation_section:taboption("raid", Button, "_rcreate") 293 | r_create.render = function(self, section, scope) 294 | self.title = " " 295 | self.inputtitle = translate("Create Raid") 296 | self.inputstyle = "add" 297 | Button.render(self, section, scope) 298 | end 299 | r_create.write = function(self, section, value) 300 | -- mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdb6 /dev/sdc5 301 | local res = dm.create_raid(rname, rlevel, rmembers) 302 | if res and res:match("^ERR") then 303 | m.errmessage = luci.util.pcdata(res) 304 | return 305 | end 306 | dm.gen_mdadm_config() 307 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman")) 308 | end 309 | end 310 | 311 | -- btrfs 312 | if dm.command.btrfs then 313 | local blabel, bmembers, blevel 314 | local btrfs_label = creation_section:taboption("btrfs", Value, "_blabel", translate("Btrfs Label")) 315 | btrfs_label.write = function(self, section, value) 316 | blabel = value 317 | end 318 | local btrfs_level = creation_section:taboption("btrfs", ListValue, "_blevel", translate("Btrfs Raid Level")) 319 | btrfs_level:value("single", "Single") 320 | btrfs_level:value("raid0", "Raid 0") 321 | btrfs_level:value("raid1", "Raid 1") 322 | btrfs_level:value("raid10", "Raid 10") 323 | btrfs_level.write = function(self, section, value) 324 | blevel = value 325 | end 326 | 327 | local btrfs_member = creation_section:taboption("btrfs", DynamicList, "_bmember", translate("Btrfs Member")) 328 | for dev, info in pairs(disks) do 329 | if not info.inuse and #info.partitions == 0 then 330 | btrfs_member:value(info.path, info.path.. " ".. info.size_formated) 331 | end 332 | for i, v in ipairs(info.partitions) do 333 | if not v.inuse then 334 | btrfs_member:value("/dev/".. v.name, "/dev/".. v.name .. " ".. v.size_formated) 335 | end 336 | end 337 | end 338 | btrfs_member.write = function(self, section, value) 339 | bmembers = value 340 | end 341 | local btrfs_create = creation_section:taboption("btrfs", Button, "_bcreate") 342 | btrfs_create.render = function(self, section, scope) 343 | self.title = " " 344 | self.inputtitle = translate("Create Btrfs") 345 | self.inputstyle = "add" 346 | Button.render(self, section, scope) 347 | end 348 | btrfs_create.write = function(self, section, value) 349 | -- mkfs.btrfs -L label -d blevel /dev/sda /dev/sdb 350 | local res = dm.create_btrfs(blabel, blevel, bmembers) 351 | if res and res:match("^ERR") then 352 | m.errmessage = luci.util.pcdata(res) 353 | return 354 | end 355 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman")) 356 | end 357 | end 358 | end 359 | 360 | return m 361 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | LuCI - Lua Configuration Interface 3 | Copyright 2019 lisaac 4 | ]]-- 5 | 6 | require "luci.util" 7 | require("luci.tools.webadmin") 8 | local dm = require "luci.model.diskman" 9 | local dev = arg[1] 10 | 11 | if not dev then 12 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman")) 13 | elseif not nixio.fs.access("/dev/"..dev) then 14 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman")) 15 | end 16 | 17 | m = SimpleForm("partition", translate("Partition Management"), translate("Partition Disk over LuCI.")) 18 | m.template = "diskman/cbi/xsimpleform" 19 | m.redirect = luci.dispatcher.build_url("admin/system/diskman") 20 | m:append(Template("diskman/partition_info")) 21 | -- disable submit and reset button 22 | m.submit = false 23 | m.reset = false 24 | 25 | local disk_info = dm.get_disk_info(dev, true) 26 | local format_cmd = dm.get_format_cmd() 27 | 28 | s = m:section(Table, {disk_info}, translate("Device Info")) 29 | -- s:option(DummyValue, "key") 30 | -- s:option(DummyValue, "value") 31 | s:option(DummyValue, "path", translate("Path")) 32 | s:option(DummyValue, "model", translate("Model")) 33 | s:option(DummyValue, "sn", translate("Serial Number")) 34 | s:option(DummyValue, "size_formated", translate("Size")) 35 | s:option(DummyValue, "sec_size", translate("Sector Size")) 36 | local dv_p_table = s:option(ListValue, "p_table", translate("Partition Table")) 37 | dv_p_table.render = function(self, section, scope) 38 | -- create table only if not used by raid and no partitions on disk 39 | if not disk_info.p_table:match("Raid") and (#disk_info.partitions == 0 or (#disk_info.partitions == 1 and disk_info.partitions[1].number == -1) or (disk_info.p_table:match("LOOP") and not disk_info.partitions[1].inuse)) then 40 | self:value(disk_info.p_table, disk_info.p_table) 41 | self:value("GPT", "GPT") 42 | self:value("MBR", "MBR") 43 | self.default = disk_info.p_table 44 | ListValue.render(self, section, scope) 45 | else 46 | self.template = "cbi/dvalue" 47 | DummyValue.render(self, section, scope) 48 | end 49 | end 50 | if disk_info.type:match("md") then 51 | s:option(DummyValue, "level", translate("Level")) 52 | s:option(DummyValue, "members_str", translate("Members")) 53 | else 54 | s:option(DummyValue, "temp", translate("Temp")) 55 | s:option(DummyValue, "sata_ver", translate("SATA Version")) 56 | s:option(DummyValue, "rota_rate", translate("Rotation Rate")) 57 | end 58 | s:option(DummyValue, "status", translate("Status")) 59 | local btn_health = s:option(Button, "health", translate("Health")) 60 | btn_health.render = function(self, section, scope) 61 | if disk_info.health then 62 | self.inputtitle = disk_info.health 63 | if disk_info.health == "PASSED" then 64 | self.inputstyle = "add" 65 | else 66 | self.inputstyle = "remove" 67 | end 68 | Button.render(self, section, scope) 69 | else 70 | self.template = "cbi/dvalue" 71 | DummyValue.render(self, section, scope) 72 | end 73 | end 74 | 75 | local btn_eject = s:option(Button, "_eject") 76 | btn_eject.template = "diskman/cbi/disabled_button" 77 | btn_eject.inputstyle = "remove" 78 | btn_eject.render = function(self, section, scope) 79 | for i, p in ipairs(disk_info.partitions) do 80 | if p.mount_point ~= "-" then 81 | self.view_disabled = true 82 | break 83 | end 84 | end 85 | if disk_info.p_table:match("Raid") then 86 | self.view_disabled = true 87 | end 88 | if disk_info.type:match("md") then 89 | btn_eject.inputtitle = translate("Remove") 90 | else 91 | btn_eject.inputtitle = translate("Eject") 92 | end 93 | Button.render(self, section, scope) 94 | end 95 | btn_eject.forcewrite = true 96 | btn_eject.write = function(self, section, value) 97 | for i, p in ipairs(disk_info.partitions) do 98 | if p.mount_point ~= "-" then 99 | m.errmessage = p.name .. translate("is in use! please unmount it first!") 100 | return 101 | end 102 | end 103 | if disk_info.type:match("md") then 104 | luci.util.exec(dm.command.mdadm .. " --stop /dev/" .. dev) 105 | luci.util.exec(dm.command.mdadm .. " --remove /dev/" .. dev) 106 | for _, disk in ipairs(disk_info.members) do 107 | luci.util.exec(dm.command.mdadm .. " --zero-superblock " .. disk) 108 | end 109 | dm.gen_mdadm_config() 110 | else 111 | luci.util.exec("echo 1 > /sys/block/" .. dev .. "/device/delete") 112 | end 113 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman")) 114 | end 115 | -- eject: echo 1 > /sys/block/(device)/device/delete 116 | -- rescan: echo '- - -' | tee /sys/class/scsi_host/host*/scan > /dev/null 117 | 118 | 119 | -- partitions info 120 | if not disk_info.p_table:match("Raid") then 121 | s_partition_table = m:section(Table, disk_info.partitions, translate("Partitions Info"), translate("Default 2048 sector alignment, support +size{b,k,m,g,t} in End Sector")) 122 | 123 | -- s_partition_table:option(DummyValue, "number", translate("Number")) 124 | s_partition_table:option(DummyValue, "name", translate("Name")) 125 | local val_sec_start = s_partition_table:option(Value, "sec_start", translate("Start Sector")) 126 | val_sec_start.render = function(self, section, scope) 127 | -- could create new partition 128 | if disk_info.partitions[section].number == -1 and disk_info.partitions[section].size > 1 * 1024 * 1024 then 129 | self.template = "cbi/value" 130 | Value.render(self, section, scope) 131 | else 132 | self.template = "cbi/dvalue" 133 | DummyValue.render(self, section, scope) 134 | end 135 | end 136 | local val_sec_end = s_partition_table:option(Value, "sec_end", translate("End Sector")) 137 | val_sec_end.render = function(self, section, scope) 138 | -- could create new partition 139 | if disk_info.partitions[section].number == -1 and disk_info.partitions[section].size > 1 * 1024 * 1024 then 140 | self.template = "cbi/value" 141 | Value.render(self, section, scope) 142 | else 143 | self.template = "cbi/dvalue" 144 | DummyValue.render(self, section, scope) 145 | end 146 | end 147 | val_sec_start.forcewrite = true 148 | val_sec_start.write = function(self, section, value) 149 | disk_info.partitions[section]._sec_start = value 150 | end 151 | val_sec_end.forcewrite = true 152 | val_sec_end.write = function(self, section, value) 153 | disk_info.partitions[section]._sec_end = value 154 | end 155 | s_partition_table:option(DummyValue, "size_formated", translate("Size")) 156 | if disk_info.p_table == "MBR" then 157 | s_partition_table:option(DummyValue, "type", translate("Type")) 158 | end 159 | s_partition_table:option(DummyValue, "used_formated", translate("Used")) 160 | s_partition_table:option(DummyValue, "free_formated", translate("Free Space")) 161 | s_partition_table:option(DummyValue, "usage", translate("Usage")) 162 | local dv_mount_point = s_partition_table:option(DummyValue, "mount_point", translate("Mount Point")) 163 | dv_mount_point.rawhtml = true 164 | dv_mount_point.render = function(self, section, scope) 165 | local new_mp = "" 166 | local v_mp_d 167 | for line in self["section"]["data"][section]["mount_point"]:gmatch("[^%s]+") do 168 | if line == '-' then 169 | new_mp = line 170 | break 171 | end 172 | for v_mp_d in line:gmatch('[^/]+') do 173 | if #v_mp_d > 12 then 174 | new_mp = new_mp .. "/" .. v_mp_d:sub(1,7) .. ".." .. v_mp_d:sub(-4) 175 | else 176 | new_mp = new_mp .."/".. v_mp_d 177 | end 178 | end 179 | new_mp = '' ..new_mp ..'' .. "
" 180 | end 181 | self["section"]["data"][section]["mount_point"] = new_mp 182 | DummyValue.render(self, section, scope) 183 | end 184 | local val_fs = s_partition_table:option(Value, "fs", translate("File System")) 185 | val_fs.forcewrite = true 186 | val_fs.partitions = disk_info.partitions 187 | for k, v in pairs(format_cmd) do 188 | val_fs.format_cmd = val_fs.format_cmd and (val_fs.format_cmd .. "," .. k) or k 189 | end 190 | 191 | val_fs.write = function(self, section, value) 192 | disk_info.partitions[section]._fs = value 193 | end 194 | val_fs.render = function(self, section, scope) 195 | -- use listvalue when partition not mounted 196 | if disk_info.partitions[section].mount_point == "-" and disk_info.partitions[section].number ~= -1 and disk_info.partitions[section].type ~= "extended" then 197 | self.template = "diskman/cbi/format_button" 198 | self.inputstyle = "reset" 199 | self.inputtitle = disk_info.partitions[section].fs == "raw" and translate("Format") or disk_info.partitions[section].fs 200 | Button.render(self, section, scope) 201 | -- self:reset_values() 202 | -- self.keylist = {} 203 | -- self.vallist = {} 204 | -- for k, v in pairs(format_cmd) do 205 | -- self:value(k,k) 206 | -- end 207 | -- self.default = disk_info.partitions[section].fs 208 | else 209 | -- self:reset_values() 210 | -- self.keylist = {} 211 | -- self.vallist = {} 212 | self.template = "cbi/dvalue" 213 | DummyValue.render(self, section, scope) 214 | end 215 | end 216 | -- btn_format = s_partition_table:option(Button, "_format") 217 | -- btn_format.template = "diskman/cbi/format_button" 218 | -- btn_format.partitions = disk_info.partitions 219 | -- btn_format.render = function(self, section, scope) 220 | -- if disk_info.partitions[section].mount_point == "-" and disk_info.partitions[section].number ~= -1 and disk_info.partitions[section].type ~= "extended" then 221 | -- self.inputtitle = translate("Format") 222 | -- self.template = "diskman/cbi/disabled_button" 223 | -- self.view_disabled = false 224 | -- self.inputstyle = "reset" 225 | -- for k, v in pairs(format_cmd) do 226 | -- self:depends("val_fs", "k") 227 | -- end 228 | -- -- elseif disk_info.partitions[section].mount_point ~= "-" and disk_info.partitions[section].number ~= -1 then 229 | -- -- self.inputtitle = "Format" 230 | -- -- self.template = "diskman/cbi/disabled_button" 231 | -- -- self.view_disabled = true 232 | -- -- self.inputstyle = "reset" 233 | -- else 234 | -- self.inputtitle = "" 235 | -- self.template = "cbi/dvalue" 236 | -- end 237 | -- Button.render(self, section, scope) 238 | -- end 239 | -- btn_format.forcewrite = true 240 | -- btn_format.write = function(self, section, value) 241 | -- local partition_name = "/dev/".. disk_info.partitions[section].name 242 | -- if not nixio.fs.access(partition_name) then 243 | -- m.errmessage = translate("Partition NOT found!") 244 | -- return 245 | -- end 246 | -- local fs = disk_info.partitions[section]._fs 247 | -- if not format_cmd[fs] then 248 | -- m.errmessage = translate("Filesystem NOT support!") 249 | -- return 250 | -- end 251 | -- local cmd = format_cmd[fs].cmd .. " " .. format_cmd[fs].option .. " " .. partition_name 252 | -- local res = luci.util.exec(cmd .. " 2>&1") 253 | -- if res and res:lower():match("error+") then 254 | -- m.errmessage = luci.util.pcdata(res) 255 | -- else 256 | -- luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman/partition/" .. dev)) 257 | -- end 258 | -- end 259 | 260 | local btn_action = s_partition_table:option(Button, "_action") 261 | btn_action.forcewrite = true 262 | btn_action.template = "diskman/cbi/disabled_button" 263 | btn_action.render = function(self, section, scope) 264 | -- if partition is mounted or the size < 1mb, then disable the add action 265 | if disk_info.partitions[section].mount_point ~= "-" or (disk_info.partitions[section].type ~= "extended" and disk_info.partitions[section].number == -1 and disk_info.partitions[section].size <= 1 * 1024 * 1024) then 266 | self.view_disabled = true 267 | -- self.inputtitle = "" 268 | -- self.template = "cbi/dvalue" 269 | elseif disk_info.partitions[section].type == "extended" and next(disk_info.partitions[section]["logicals"]) ~= nil then 270 | self.view_disabled = true 271 | else 272 | -- self.template = "diskman/cbi/disabled_button" 273 | self.view_disabled = false 274 | end 275 | if disk_info.partitions[section].number ~= -1 then 276 | self.inputtitle = translate("Remove") 277 | self.inputstyle = "remove" 278 | else 279 | self.inputtitle = translate("New") 280 | self.inputstyle = "add" 281 | end 282 | Button.render(self, section, scope) 283 | end 284 | btn_action.write = function(self, section, value) 285 | if value == translate("New") then 286 | local start_sec = disk_info.partitions[section]._sec_start and tonumber(disk_info.partitions[section]._sec_start) or tonumber(disk_info.partitions[section].sec_start) 287 | local end_sec = disk_info.partitions[section]._sec_end 288 | 289 | if start_sec then 290 | -- for sector alignment 291 | local align = tonumber(disk_info.phy_sec) / tonumber(disk_info.logic_sec) 292 | align = (align < 2048) and 2048 293 | if start_sec < 2048 then 294 | start_sec = "2048" .. "s" 295 | elseif math.fmod( start_sec, align ) ~= 0 then 296 | start_sec = tostring(start_sec + align - math.fmod( start_sec, align )) .. "s" 297 | else 298 | start_sec = start_sec .. "s" 299 | end 300 | else 301 | m.errmessage = translate("Invalid Start Sector!") 302 | return 303 | end 304 | -- support +size format for End sector 305 | local end_size, end_unit = end_sec:match("^+(%d-)([bkmgtsBKMGTS])$") 306 | if tonumber(end_size) and end_unit then 307 | local unit ={ 308 | B=1, 309 | S=512, 310 | K=1024, 311 | M=1048576, 312 | G=1073741824, 313 | T=1099511627776 314 | } 315 | end_unit = end_unit:upper() 316 | end_sec = tostring(tonumber(end_size) * unit[end_unit] / unit["S"] + tonumber(start_sec:sub(1,-2)) - 1 ) .. "s" 317 | elseif tonumber(end_sec) then 318 | end_sec = end_sec .. "s" 319 | else 320 | m.errmessage = translate("Invalid End Sector!") 321 | return 322 | end 323 | local part_type = "primary" 324 | 325 | if disk_info.p_table == "MBR" and disk_info["extended_partition_index"] then 326 | if tonumber(disk_info.partitions[disk_info["extended_partition_index"]].sec_start) <= tonumber(start_sec:sub(1,-2)) and tonumber(disk_info.partitions[disk_info["extended_partition_index"]].sec_end) >= tonumber(end_sec:sub(1,-2)) then 327 | part_type = "logical" 328 | if tonumber(start_sec:sub(1,-2)) - tonumber(disk_info.partitions[section].sec_start) < 2048 then 329 | start_sec = tonumber(start_sec:sub(1,-2)) + 2048 330 | start_sec = start_sec .."s" 331 | end 332 | end 333 | elseif disk_info.p_table == "GPT" then 334 | -- AUTOMATIC FIX GPT PARTITION TABLE 335 | -- Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 16123870 blocks) or continue with the current setting? 336 | local cmd = ' printf "ok\nfix\n" | parted ---pretend-input-tty /dev/'.. dev ..' print' 337 | luci.util.exec(cmd .. " 2>&1") 338 | end 339 | 340 | -- partiton 341 | local cmd = dm.command.parted .. " -s -a optimal /dev/" .. dev .. " mkpart " .. part_type .." " .. start_sec .. " " .. end_sec 342 | local res = luci.util.exec(cmd .. " 2>&1") 343 | if res and res:lower():match("error+") then 344 | m.errmessage = luci.util.pcdata(res) 345 | else 346 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman/partition/" .. dev)) 347 | end 348 | elseif value == translate("Remove") then 349 | -- remove partition 350 | local number = tostring(disk_info.partitions[section].number) 351 | if (not number) or (number == "") then 352 | m.errmessage = translate("Partition not exists!") 353 | return 354 | end 355 | local cmd = dm.command.parted .. " -s /dev/" .. dev .. " rm " .. number 356 | local res = luci.util.exec(cmd .. " 2>&1") 357 | if res and res:lower():match("error+") then 358 | m.errmessage = luci.util.pcdata(res) 359 | else 360 | luci.http.redirect(luci.dispatcher.build_url("admin/system/diskman/partition/" .. dev)) 361 | end 362 | end 363 | end 364 | end 365 | 366 | return m -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/model/diskman.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | LuCI - Lua Configuration Interface 3 | Copyright 2019 lisaac 4 | ]]-- 5 | 6 | require "luci.util" 7 | local ver = require "luci.version" 8 | 9 | local CMD = {"parted", "mdadm", "blkid", "smartctl", "df", "btrfs", "lsblk"} 10 | 11 | local d = {command ={}} 12 | for _, cmd in ipairs(CMD) do 13 | local command = luci.sys.exec("/usr/bin/which " .. cmd) 14 | d.command[cmd] = command:match("^.+"..cmd) or nil 15 | end 16 | 17 | d.command.mount = nixio.fs.access("/usr/bin/mount") and "/usr/bin/mount" or "/bin/mount" 18 | d.command.umount = nixio.fs.access("/usr/bin/umount") and "/usr/bin/umount" or "/bin/umount" 19 | 20 | local proc_mounts = nixio.fs.readfile("/proc/mounts") or "" 21 | local mounts = luci.util.exec(d.command.mount .. " 2>/dev/null") or "" 22 | local swaps = nixio.fs.readfile("/proc/swaps") or "" 23 | local df = luci.sys.exec(d.command.df .. " 2>/dev/null") or "" 24 | 25 | function byte_format(byte) 26 | local suff = {"B", "KB", "MB", "GB", "TB"} 27 | for i=1, 5 do 28 | if byte > 1024 and i < 5 then 29 | byte = byte / 1024 30 | else 31 | return string.format("%.2f %s", byte, suff[i]) 32 | end 33 | end 34 | end 35 | 36 | local get_smart_info = function(device) 37 | local section 38 | local smart_info = {} 39 | for _, line in ipairs(luci.util.execl(d.command.smartctl .. " -H -A -i -n standby -f brief /dev/" .. device)) do 40 | local attrib, val 41 | if section == 1 then 42 | attrib, val = line:match "^(.-):%s+(.+)" 43 | elseif section == 2 and smart_info.nvme_ver then 44 | attrib, val = line:match("^(.-):%s+(.+)") 45 | if not smart_info.health then smart_info.health = line:match(".-overall%-health.-: (.+)") end 46 | elseif section == 2 then 47 | attrib, val = line:match("^([0-9 ]+)%s+[^ ]+%s+[POSRCK-]+%s+[0-9-]+%s+[0-9-]+%s+[0-9-]+%s+[0-9-]+%s+([0-9-]+)") 48 | if not smart_info.health then smart_info.health = line:match(".-overall%-health.-: (.+)") end 49 | else 50 | attrib = line:match "^=== START OF (.*) SECTION ===" 51 | if attrib and attrib:match("INFORMATION") then 52 | section = 1 53 | elseif attrib and attrib:match("SMART DATA") then 54 | section = 2 55 | elseif not smart_info.status then 56 | val = line:match "^Device is in (.*) mode" 57 | if val then smart_info.status = val end 58 | end 59 | end 60 | 61 | if not attrib then 62 | if section ~= 2 then section = 0 end 63 | elseif (attrib == "Power mode is") or 64 | (attrib == "Power mode was") then 65 | smart_info.status = val:match("(%S+)") 66 | -- elseif attrib == "Sector Sizes" then 67 | -- -- 512 bytes logical, 4096 bytes physical 68 | -- smart_info.phy_sec = val:match "([0-9]*) bytes physical" 69 | -- smart_info.logic_sec = val:match "([0-9]*) bytes logical" 70 | -- elseif attrib == "Sector Size" then 71 | -- -- 512 bytes logical/physical 72 | -- smart_info.phy_sec = val:match "([0-9]*)" 73 | -- smart_info.logic_sec = smart_info.phy_sec 74 | elseif attrib == "Serial Number" then 75 | smart_info.sn = val 76 | elseif attrib == "194" or attrib == "Temperature" then 77 | if val ~= "-" then 78 | smart_info.temp = (val:match("(%d+)") or "?") .. "°C" 79 | end 80 | elseif attrib == "Rotation Rate" then 81 | smart_info.rota_rate = val 82 | elseif attrib == "SATA Version is" then 83 | smart_info.sata_ver = val 84 | elseif attrib == "NVMe Version" then 85 | smart_info.nvme_ver = val 86 | end 87 | end 88 | return smart_info 89 | end 90 | 91 | local parse_parted_info = function(keys, line) 92 | -- parse the output of parted command (machine parseable format) 93 | -- /dev/sda:5860533168s:scsi:512:4096:gpt:ATA ST3000DM001-1ER1:; 94 | -- 1:34s:2047s:2014s:free; 95 | -- 1:2048s:1073743872s:1073741825s:ext4:primary:; 96 | local result = {} 97 | local values = {} 98 | 99 | for value in line:gmatch("(.-)[:;]") do table.insert(values, value) end 100 | for i = 1,#keys do 101 | result[keys[i]] = values[i] or "" 102 | end 103 | return result 104 | end 105 | 106 | local is_raid_member = function(partition) 107 | -- check if inuse as raid member 108 | if nixio.fs.access("/proc/mdstat") then 109 | for _, result in ipairs(luci.util.execl("grep md /proc/mdstat | sed 's/[][]//g'")) do 110 | local md, buf 111 | md, buf = result:match("(md.-):(.+)") 112 | if buf:match(partition) then 113 | return "Raid Member: ".. md 114 | end 115 | end 116 | end 117 | return nil 118 | end 119 | 120 | local get_mount_point = function(partition) 121 | local mount_point 122 | for m in mounts:gmatch("/dev/"..partition.." on ([^ ]*)") do 123 | mount_point = (mount_point and (mount_point .. " ") or "") .. m 124 | end 125 | if mount_point then return mount_point end 126 | -- result = luci.sys.exec('cat /proc/mounts | awk \'{if($1=="/dev/'.. partition ..'") print $2}\'') 127 | -- if result ~= "" then return result end 128 | 129 | if swaps:match("\n/dev/" .. partition .."%s") then return "swap" end 130 | -- result = luci.sys.exec("cat /proc/swaps | grep /dev/" .. partition) 131 | -- if result ~= "" then return "swap" end 132 | 133 | return is_raid_member(partition) 134 | 135 | end 136 | 137 | -- return used, free, usage 138 | local get_partition_usage = function(partition) 139 | if not nixio.fs.access("/dev/"..partition) then return false end 140 | local used, free, usage = df:match("\n/dev/" .. partition .. "%s+%d+%s+(%d+)%s+(%d+)%s+(%d+)%%%s-") 141 | 142 | usage = usage and (usage .. "%") or "-" 143 | used = used and (tonumber(used) * 1024) or 0 144 | free = free and (tonumber(free) * 1024) or 0 145 | 146 | return used, free, usage 147 | end 148 | 149 | local get_parted_info = function(device) 150 | if not device then return end 151 | local result = {partitions={}} 152 | local DEVICE_INFO_KEYS = { "path", "size", "type", "logic_sec", "phy_sec", "p_table", "model", "flags" } 153 | local PARTITION_INFO_KEYS = { "number", "sec_start", "sec_end", "size", "fs", "tag_name", "flags" } 154 | local partition_temp 155 | local partitions_temp = {} 156 | local disk_temp 157 | 158 | for line in luci.util.execi(d.command.parted .. " -s -m /dev/" .. device .. " unit s print free", "r") do 159 | if line:find("^/dev/"..device..":.+") then 160 | disk_temp = parse_parted_info(DEVICE_INFO_KEYS, line) 161 | disk_temp.partitions = {} 162 | if disk_temp["size"] then 163 | local length = disk_temp["size"]:gsub("^(%d+)s$", "%1") 164 | local newsize = tostring(tonumber(length)*tonumber(disk_temp["logic_sec"])) 165 | disk_temp["size"] = newsize 166 | end 167 | if disk_temp["p_table"] == "msdos" then 168 | disk_temp["p_table"] = "MBR" 169 | else 170 | disk_temp["p_table"] = disk_temp["p_table"]:upper() 171 | end 172 | elseif line:find("^%d-:.+") then 173 | partition_temp = parse_parted_info(PARTITION_INFO_KEYS, line) 174 | -- use human-readable form instead of sector number 175 | if partition_temp["size"] then 176 | local length = partition_temp["size"]:gsub("^(%d+)s$", "%1") 177 | local newsize = (tonumber(length) * tonumber(disk_temp["logic_sec"])) 178 | partition_temp["size"] = newsize 179 | partition_temp["size_formated"] = byte_format(newsize) 180 | end 181 | partition_temp["number"] = tonumber(partition_temp["number"]) or -1 182 | if partition_temp["fs"] == "free" then 183 | partition_temp["number"] = -1 184 | partition_temp["fs"] = "Free Space" 185 | partition_temp["name"] = "-" 186 | elseif device:match("sd") or device:match("sata") or device:match("vd") then 187 | partition_temp["name"] = device..partition_temp["number"] 188 | elseif device:match("mmcblk") or device:match("md") or device:match("nvme") then 189 | partition_temp["name"] = device.."p"..partition_temp["number"] 190 | end 191 | if partition_temp["number"] > 0 and partition_temp["fs"] == "" and d.command.lsblk then 192 | partition_temp["fs"] = (luci.util.exec(d.command.lsblk .. " /dev/" .. partition_temp["name"] .. " -no fstype") or ""):match("([^%s]+)") or "" 193 | end 194 | partition_temp["fs"] = partition_temp["fs"] == "" and "raw" or partition_temp["fs"] 195 | partition_temp["sec_start"] = partition_temp["sec_start"] and partition_temp["sec_start"]:sub(1,-2) 196 | partition_temp["sec_end"] = partition_temp["sec_end"] and partition_temp["sec_end"]:sub(1,-2) 197 | partition_temp["mount_point"] = partition_temp["name"]~="-" and get_mount_point(partition_temp["name"]) or "-" 198 | if partition_temp["mount_point"]~="-" then 199 | partition_temp["used"], partition_temp["free"], partition_temp["usage"] = get_partition_usage(partition_temp["name"]) 200 | partition_temp["used_formated"] = partition_temp["used"] and byte_format(partition_temp["used"]) or "-" 201 | partition_temp["free_formated"] = partition_temp["free"] and byte_format(partition_temp["free"]) or "-" 202 | else 203 | partition_temp["used"], partition_temp["free"], partition_temp["usage"] = 0,0,"-" 204 | partition_temp["used_formated"] = "-" 205 | partition_temp["free_formated"] = "-" 206 | end 207 | -- if disk_temp["p_table"] == "MBR" and (partition_temp["number"] < 4) and (partition_temp["number"] > 0) then 208 | -- local real_size_sec = tonumber(nixio.fs.readfile("/sys/block/"..device.."/"..partition_temp["name"].."/size")) * tonumber(disk_temp.phy_sec) 209 | -- if real_size_sec ~= partition_temp["size"] then 210 | -- disk_temp["extended_partition_index"] = partition_temp["number"] 211 | -- partition_temp["type"] = "extended" 212 | -- partition_temp["size"] = real_size_sec 213 | -- partition_temp["fs"] = "-" 214 | -- partition_temp["logicals"] = {} 215 | -- else 216 | -- partition_temp["type"] = "primary" 217 | -- end 218 | -- end 219 | 220 | table.insert(partitions_temp, partition_temp) 221 | end 222 | end 223 | if disk_temp and disk_temp["p_table"] == "MBR" then 224 | for i, p in ipairs(partitions_temp) do 225 | if disk_temp["extended_partition_index"] and p["number"] > 4 then 226 | if tonumber(p["sec_end"]) <= tonumber(partitions_temp[disk_temp["extended_partition_index"]]["sec_end"]) and tonumber(p["sec_start"]) >= tonumber(partitions_temp[disk_temp["extended_partition_index"]]["sec_start"]) then 227 | p["type"] = "logical" 228 | table.insert(partitions_temp[disk_temp["extended_partition_index"]]["logicals"], i) 229 | end 230 | elseif (p["number"] <= 4) and (p["number"] > 0) then 231 | local s = nixio.fs.readfile("/sys/block/"..device.."/"..p["name"].."/size") 232 | if s then 233 | local real_size_sec = tonumber(s) * tonumber(disk_temp.logic_sec) 234 | -- if size not equal, it's an extended 235 | if real_size_sec ~= p["size"] then 236 | disk_temp["extended_partition_index"] = i 237 | p["type"] = "extended" 238 | p["size"] = real_size_sec 239 | p["fs"] = "-" 240 | p["logicals"] = {} 241 | else 242 | p["type"] = "primary" 243 | end 244 | else 245 | -- if not found in "/sys/block" 246 | p["type"] = "primary" 247 | end 248 | end 249 | end 250 | end 251 | result = disk_temp or result 252 | result.partitions = partitions_temp 253 | 254 | return result 255 | end 256 | 257 | local mddetail = function(mdpath) 258 | local detail = {} 259 | local path = mdpath:match("^/dev/md%d+$") 260 | if path then 261 | local mdadm = io.popen(d.command.mdadm .. " --detail "..path, "r") 262 | for line in mdadm:lines() do 263 | local key, value = line:match("^%s*(.+) : (.+)") 264 | if key then 265 | detail[key] = value 266 | end 267 | end 268 | mdadm:close() 269 | end 270 | return detail 271 | end 272 | 273 | -- return {{device="", mount_points="", fs="", mount_options="", dump="", pass=""}..} 274 | d.get_mount_points = function() 275 | local mount 276 | local res = {} 277 | local h ={"device", "mount_point", "fs", "mount_options", "dump", "pass"} 278 | for mount in proc_mounts:gmatch("[^\n]+") do 279 | local device = mount:match("^([^%s]+)%s+.+") 280 | -- only show /dev/xxx device 281 | if device and device:match("/dev/") then 282 | res[#res+1] = {} 283 | local i = 0 284 | for v in mount:gmatch("[^%s]+") do 285 | i = i + 1 286 | res[#res][h[i]] = v 287 | end 288 | end 289 | end 290 | return res 291 | end 292 | 293 | d.get_disk_info = function(device, wakeup) 294 | --[[ return: 295 | { 296 | path, model, sn, size, size_mounted, flags, type, temp, p_table, logic_sec, phy_sec, sec_size, sata_ver, rota_rate, status, health, 297 | partitions = { 298 | 1 = { number, name, sec_start, sec_end, size, size_mounted, fs, tag_name, type, flags, mount_point, usage, used, free, used_formated, free_formated}, 299 | 2 = { number, name, sec_start, sec_end, size, size_mounted, fs, tag_name, type, flags, mount_point, usage, used, free, used_formated, free_formated}, 300 | ... 301 | } 302 | --raid devices only 303 | level, members, members_str 304 | } 305 | --]] 306 | if not device then return end 307 | local disk_info 308 | local smart_info = get_smart_info(device) 309 | 310 | -- check if divice is the member of raid 311 | smart_info["p_table"] = is_raid_member(device..'0') 312 | -- if status is not active(standby), only check smart_info. 313 | -- if only weakup == true, weakup the disk and check parted_info. 314 | if smart_info.status ~= "STANDBY" or wakeup or (smart_info["p_table"] and not smart_info["p_table"]:match("Raid")) or device:match("^md") then 315 | disk_info = get_parted_info(device) 316 | disk_info["sec_size"] = disk_info["logic_sec"] .. "/" .. disk_info["phy_sec"] 317 | disk_info["size_formated"] = byte_format(tonumber(disk_info["size"])) 318 | -- if status is standby, after get part info, the disk is weakuped, then get smart_info again for more informations 319 | if smart_info.status ~= "ACTIVE" then smart_info = get_smart_info(device) end 320 | else 321 | disk_info = {} 322 | end 323 | 324 | for k, v in pairs(smart_info) do 325 | disk_info[k] = v 326 | end 327 | 328 | if disk_info.type and disk_info.type:match("md") then 329 | local raid_info = d.list_raid_devices()[disk_info["path"]:match("/dev/(.+)")] 330 | for k, v in pairs(raid_info) do 331 | disk_info[k] = v 332 | end 333 | end 334 | return disk_info 335 | end 336 | 337 | d.list_raid_devices = function() 338 | local fs = require "nixio.fs" 339 | 340 | local raid_devices = {} 341 | if not fs.access("/proc/mdstat") then return raid_devices end 342 | local mdstat = io.open("/proc/mdstat", "r") 343 | for line in mdstat:lines() do 344 | 345 | -- md1 : active raid1 sdb2[1] sda2[0] 346 | -- md127 : active raid5 sdh1[6] sdg1[4] sdf1[3] sde1[2] sdd1[1] sdc1[0] 347 | local device_info = {} 348 | local mdpath, list = line:match("^(md%d+) : (.+)") 349 | if mdpath then 350 | local members = {} 351 | for member in string.gmatch(list, "%S+") do 352 | member_path = member:match("^(%S+)%[%d+%]") 353 | if member_path then 354 | member = '/dev/'..member_path 355 | end 356 | table.insert(members, member) 357 | end 358 | local active = table.remove(members, 1) 359 | local level = "-" 360 | if active == "active" then 361 | level = table.remove(members, 1) 362 | end 363 | 364 | local size = tonumber(fs.readfile(string.format("/sys/class/block/%s/size", mdpath))) 365 | local ss = tonumber(fs.readfile(string.format("/sys/class/block/%s/queue/logical_block_size", mdpath))) 366 | 367 | device_info["path"] = "/dev/"..mdpath 368 | device_info["size"] = size*ss 369 | device_info["size_formated"] = byte_format(size*ss) 370 | device_info["active"] = active:upper() 371 | device_info["level"] = level 372 | device_info["members"] = members 373 | device_info["members_str"] = table.concat(members, ", ") 374 | 375 | -- Get more info from output of mdadm --detail 376 | local detail = mddetail(device_info["path"]) 377 | device_info["status"] = detail["State"]:upper() 378 | 379 | raid_devices[mdpath] = device_info 380 | end 381 | end 382 | mdstat:close() 383 | 384 | return raid_devices 385 | end 386 | 387 | -- Collect Devices information 388 | --[[ return: 389 | { 390 | sda={ 391 | path, model, inuse, size_formated, 392 | partitions={ 393 | { name, inuse, size_formated } 394 | ... 395 | } 396 | } 397 | .. 398 | } 399 | --]] 400 | d.list_devices = function() 401 | local fs = require "nixio.fs" 402 | 403 | -- get all device names (sdX and mmcblkX) 404 | local target_devnames = {} 405 | for dev in fs.dir("/dev") do 406 | if dev:match("^sd[a-z]$") 407 | or dev:match("^mmcblk%d+$") 408 | or dev:match("^sata[a-z]$") 409 | or dev:match("^nvme%d+n%d+$") 410 | or dev:match("^vd[a-z]$") 411 | then 412 | table.insert(target_devnames, dev) 413 | end 414 | end 415 | 416 | local devices = {} 417 | for i, bname in pairs(target_devnames) do 418 | local device_info = {} 419 | local device = "/dev/" .. bname 420 | local size = tonumber(fs.readfile(string.format("/sys/class/block/%s/size", bname)) or "0") 421 | local ss = tonumber(fs.readfile(string.format("/sys/class/block/%s/queue/logical_block_size", bname)) or "0") 422 | local model = fs.readfile(string.format("/sys/class/block/%s/device/model", bname)) 423 | local partitions = {} 424 | for part in nixio.fs.glob("/sys/block/" .. bname .."/" .. bname .. "*") do 425 | local pname = nixio.fs.basename(part) 426 | local psize = byte_format(tonumber(nixio.fs.readfile(part .. "/size"))*ss) 427 | local mount_point = get_mount_point(pname) 428 | if mount_point then device_info["inuse"] = true end 429 | table.insert(partitions, {name = pname, size_formated = psize, inuse = mount_point}) 430 | end 431 | 432 | device_info["path"] = device 433 | device_info["size_formated"] = byte_format(size*ss) 434 | device_info["model"] = model 435 | device_info["partitions"] = partitions 436 | -- true or false 437 | device_info["inuse"] = device_info["inuse"] or get_mount_point(bname) 438 | 439 | local udevinfo = {} 440 | if luci.sys.exec("which udevadm") ~= "" then 441 | local udevadm = io.popen("udevadm info --query=property --name="..device) 442 | for attr in udevadm:lines() do 443 | local k, v = attr:match("(%S+)=(%S+)") 444 | udevinfo[k] = v 445 | end 446 | udevadm:close() 447 | 448 | device_info["info"] = udevinfo 449 | if udevinfo["ID_MODEL"] then device_info["model"] = udevinfo["ID_MODEL"] end 450 | end 451 | devices[bname] = device_info 452 | end 453 | -- luci.util.perror(luci.util.serialize_json(devices)) 454 | return devices 455 | end 456 | 457 | -- get formart cmd 458 | d.get_format_cmd = function() 459 | local AVAILABLE_FMTS = { 460 | ext2 = { cmd = "mkfs.ext2", option = "-F -E lazy_itable_init=1" }, 461 | ext3 = { cmd = "mkfs.ext3", option = "-F -E lazy_itable_init=1" }, 462 | ext4 = { cmd = "mkfs.ext4", option = "-F -E lazy_itable_init=1" }, 463 | fat32 = { cmd = "mkfs.fat", option = "-F 32" }, 464 | exfat = { cmd = "mkfs.exfat", option = "" }, 465 | hfsplus = { cmd = "mkhfs", option = "-f" }, 466 | ntfs = { cmd = "mkfs.ntfs", option = "-f" }, 467 | swap = { cmd = "mkswap", option = "" }, 468 | btrfs = { cmd = "mkfs.btrfs", option = "-f" } 469 | } 470 | result = {} 471 | for fmt, obj in pairs(AVAILABLE_FMTS) do 472 | local cmd = luci.sys.exec("/usr/bin/which " .. obj["cmd"]) 473 | if cmd:match(obj["cmd"]) then 474 | result[fmt] = { cmd = cmd:match("^.+"..obj["cmd"]) ,option = obj["option"] } 475 | end 476 | end 477 | return result 478 | end 479 | 480 | d.find_free_md_device = function() 481 | for num=0,127 do 482 | local md = io.open("/dev/md"..tostring(num), "r") 483 | if md == nil then 484 | return "/dev/md"..tostring(num) 485 | else 486 | io.close(md) 487 | end 488 | end 489 | return nil 490 | end 491 | 492 | d.create_raid = function(rname, rlevel, rmembers) 493 | local mb = {} 494 | for _, v in ipairs(rmembers) do 495 | mb[v]=v 496 | end 497 | rmembers = {} 498 | for _, v in pairs(mb) do 499 | table.insert(rmembers, v) 500 | end 501 | if type(rname) == "string" then 502 | if rname:match("^md%d-%s+") then 503 | rname = "/dev/"..rname:match("^(md%d-)%s+") 504 | elseif rname:match("^/dev/md%d-%s+") then 505 | rname = "/dev/"..rname:match("^(/dev/md%d-)%s+") 506 | elseif not rname:match("/") then 507 | rname = "/dev/md/".. rname 508 | else 509 | return "ERR: Invalid raid name" 510 | end 511 | else 512 | rname = d.find_free_md_device() 513 | if rname == nil then return "ERR: Cannot find free md device" end 514 | end 515 | 516 | if rlevel == "5" or rlevel == "6" then 517 | if #rmembers < 3 then return "ERR: Not enough members" end 518 | end 519 | if rlevel == "10" then 520 | if #rmembers < 4 then return "ERR: Not enough members" end 521 | end 522 | if #rmembers < 2 then return "ERR: Not enough members" end 523 | local cmd = d.command.mdadm .. " --create "..rname.." --run --assume-clean --homehost=any --level=" .. rlevel .. " --raid-devices=" .. #rmembers .. " " .. table.concat(rmembers, " ") 524 | local res = luci.util.exec(cmd) 525 | return res 526 | end 527 | 528 | d.gen_mdadm_config = function() 529 | if not nixio.fs.access("/etc/config/mdadm") then return end 530 | local uci = require "luci.model.uci" 531 | local x = uci.cursor() 532 | -- delete all array sections 533 | x:foreach("mdadm", "array", function(s) x:delete("mdadm",s[".name"]) end) 534 | local cmd = d.command.mdadm .. " -D -s" 535 | --ARRAY /dev/md1 metadata=1.2 name=any:1 UUID=f998ae14:37621b27:5c49e850:051f6813 536 | --ARRAY /dev/md3 metadata=1.2 name=any:3 UUID=c068c141:4b4232ca:f48cbf96:67d42feb 537 | for _, v in ipairs(luci.util.execl(cmd)) do 538 | local device, uuid = v:match("^ARRAY%s-([^%s]+)%s-[^%s]-%s-[^%s]-%s-UUID=([^%s]+)%s-") 539 | if device and uuid then 540 | local section_name = x:add("mdadm", "array") 541 | x:set("mdadm", section_name, "device", device) 542 | x:set("mdadm", section_name, "uuid", uuid) 543 | end 544 | end 545 | x:commit("mdadm") 546 | -- enable mdadm 547 | luci.util.exec("/etc/init.d/mdadm enable") 548 | end 549 | 550 | -- list btrfs filesystem device 551 | -- {uuid={uuid, label, members, size, used}...} 552 | d.list_btrfs_devices = function() 553 | local btrfs_device = {} 554 | if not d.command.btrfs then return btrfs_device end 555 | local line, _uuid 556 | for _, line in ipairs(luci.util.execl(d.command.btrfs .. " filesystem show -d --raw")) 557 | do 558 | local label, uuid = line:match("^Label:%s+([^%s]+)%s+uuid:%s+([^%s]+)") 559 | if label and uuid then 560 | _uuid = uuid 561 | local _label = label:match("^'([^']+)'") 562 | btrfs_device[_uuid] = {label = _label or label, uuid = uuid} 563 | -- table.insert(btrfs_device, {label = label, uuid = uuid}) 564 | end 565 | local used = line:match("Total devices[%w%s]+used%s+(%d+)$") 566 | if used then 567 | btrfs_device[_uuid]["used"] = tonumber(used) 568 | btrfs_device[_uuid]["used_formated"] = byte_format(tonumber(used)) 569 | end 570 | local size, device = line:match("devid[%w.%s]+size%s+(%d+)[%w.%s]+path%s+([^%s]+)$") 571 | if size and device then 572 | btrfs_device[_uuid]["size"] = btrfs_device[_uuid]["size"] and btrfs_device[_uuid]["size"] + tonumber(size) or tonumber(size) 573 | btrfs_device[_uuid]["size_formated"] = byte_format(btrfs_device[_uuid]["size"]) 574 | btrfs_device[_uuid]["members"] = btrfs_device[_uuid]["members"] and btrfs_device[_uuid]["members"]..", "..device or device 575 | end 576 | end 577 | return btrfs_device 578 | end 579 | 580 | d.create_btrfs = function(blabel, blevel, bmembers) 581 | -- mkfs.btrfs -L label -d blevel /dev/sda /dev/sdb 582 | if not d.command.btrfs or type(bmembers) ~= "table" or next(bmembers) == nil then return "ERR no btrfs support or no members" end 583 | local label = blabel and " -L " .. blabel or "" 584 | local cmd = "mkfs.btrfs -f " .. label .. " -d " .. blevel .. " " .. table.concat(bmembers, " ") 585 | return luci.util.exec(cmd) 586 | end 587 | 588 | -- get btrfs info 589 | -- {uuid, label, members, data_raid_level,metadata_raid_lavel, size, used, size_formated, used_formated, free, free_formated, usage} 590 | d.get_btrfs_info = function(m_point) 591 | local btrfs_info = {} 592 | if not m_point or not d.command.btrfs then return btrfs_info end 593 | local cmd = d.command.btrfs .. " filesystem show --raw " .. m_point 594 | local _, line, uuid, _label, members 595 | for _, line in ipairs(luci.util.execl(cmd)) do 596 | if not uuid and not _label then 597 | _label, uuid = line:match("^Label:%s+([^%s]+)%s+uuid:%s+([^s]+)") 598 | else 599 | local mb = line:match("%s+devid.+path%s+([^%s]+)") 600 | if mb then 601 | members = members and (members .. ", ".. mb) or mb 602 | end 603 | end 604 | end 605 | 606 | if not _label or not uuid then return btrfs_info end 607 | local label = _label:match("^'([^']+)'") 608 | cmd = d.command.btrfs .. " filesystem usage -b " .. m_point 609 | local used, free, data_raid_level, metadata_raid_lavel 610 | for _, line in ipairs(luci.util.execl(cmd)) do 611 | if not used then 612 | used = line:match("^%s+Used:%s+(%d+)") 613 | elseif not free then 614 | free = line:match("^%s+Free %(estimated%):%s+(%d+)") 615 | elseif not data_raid_level then 616 | data_raid_level = line:match("^Data,%s-(%w+)") 617 | elseif not metadata_raid_lavel then 618 | metadata_raid_lavel = line:match("^Metadata,%s-(%w+)") 619 | end 620 | end 621 | if used and free and data_raid_level and metadata_raid_lavel then 622 | used = tonumber(used) 623 | free = tonumber(free) 624 | btrfs_info = { 625 | uuid = uuid, 626 | label = label, 627 | data_raid_level = data_raid_level, 628 | metadata_raid_lavel = metadata_raid_lavel, 629 | used = used, 630 | free = free, 631 | size = used + free, 632 | size_formated = byte_format(used + free), 633 | used_formated = byte_format(used), 634 | free_formated = byte_format(free), 635 | members = members, 636 | usage = string.format("%.2f",(used / (free+used) * 100)) .. "%" 637 | } 638 | end 639 | return btrfs_info 640 | end 641 | 642 | -- get btrfs subvolume 643 | -- {id={id, gen, top_level, path, snapshots, otime, default_subvolume}...} 644 | d.get_btrfs_subv = function(m_point, snapshot) 645 | local subvolume = {} 646 | if not m_point or not d.command.btrfs then return subvolume end 647 | 648 | -- get default subvolume 649 | local cmd = d.command.btrfs .. " subvolume get-default " .. m_point 650 | local res = luci.util.exec(cmd) 651 | local default_subvolume_id = res:match("^ID%s+([^%s]+)") 652 | 653 | -- get the root subvolume 654 | if not snapshot then 655 | local _, line, section_snap, _uuid, _otime, _id, _snap 656 | cmd = d.command.btrfs .. " subvolume show ".. m_point 657 | for _, line in ipairs(luci.util.execl(cmd)) do 658 | if not section_snap then 659 | if not _uuid then 660 | _uuid = line:match("^%s-UUID:%s+([^%s]+)") 661 | elseif not _otime then 662 | _otime = line:match("^%s+Creation time:%s+(.+)") 663 | elseif not _id then 664 | _id = line:match("^%s+Subvolume ID:%s+([^%s]+)") 665 | elseif line:match("^%s+(Snapshot%(s%):)") then 666 | section_snap = true 667 | end 668 | else 669 | local snapshot = line:match("^%s+(.+)") 670 | if snapshot then 671 | _snap = _snap and (_snap ..", /".. snapshot) or ("/"..snapshot) 672 | end 673 | end 674 | end 675 | if _uuid and _otime and _id then 676 | subvolume["0".._id] = {id = _id , uuid = _uuid, otime = _otime, snapshots = _snap, path = "/"} 677 | if default_subvolume_id == _id then 678 | subvolume["0".._id].default_subvolume = 1 679 | end 680 | end 681 | end 682 | 683 | -- get subvolume of btrfs 684 | cmd = d.command.btrfs .. " subvolume list -gcu" .. (snapshot and "s " or " ") .. m_point 685 | for _, line in ipairs(luci.util.execl(cmd)) do 686 | -- ID 259 gen 11 top level 258 uuid 26ae0c59-199a-cc4d-bd58-644eb4f65d33 path 1a/2b' 687 | local id, gen, top_level, uuid, path, otime, otime2 688 | if snapshot then 689 | id, gen, top_level, otime, otime2, uuid, path = line:match("^ID%s+([^%s]+)%s+gen%s+([^%s]+)%s+cgen.-top level%s+([^%s]+)%s+otime%s+([^%s]+)%s+([^%s]+)%s+uuid%s+([^%s]+)%s+path%s+([^%s]+)%s-$") 690 | else 691 | id, gen, top_level, uuid, path = line:match("^ID%s+([^%s]+)%s+gen%s+([^%s]+)%s+cgen.-top level%s+([^%s]+)%s+uuid%s+([^%s]+)%s+path%s+([^%s]+)%s-$") 692 | end 693 | if id and gen and top_level and uuid and path then 694 | subvolume[id] = {id = id, gen = gen, top_level = top_level, otime = (otime and otime or "") .." ".. (otime2 and otime2 or ""), uuid = uuid, path = '/'.. path} 695 | if not snapshot then 696 | -- use btrfs subv show to get snapshots 697 | local show_cmd = d.command.btrfs .. " subvolume show "..m_point.."/"..path 698 | local __, line_show, section_snap 699 | for __, line_show in ipairs(luci.util.execl(show_cmd)) do 700 | if not section_snap then 701 | local create_time = line_show:match("^%s+Creation time:%s+(.+)") 702 | if create_time then 703 | subvolume[id]["otime"] = create_time 704 | elseif line_show:match("^%s+(Snapshot%(s%):)") then 705 | section_snap = "true" 706 | end 707 | else 708 | local snapshot = line_show:match("^%s+(.+)") 709 | subvolume[id]["snapshots"] = subvolume[id]["snapshots"] and (subvolume[id]["snapshots"] .. ", /".. snapshot) or ("/"..snapshot) 710 | end 711 | end 712 | end 713 | end 714 | end 715 | if subvolume[default_subvolume_id] then 716 | subvolume[default_subvolume_id].default_subvolume = 1 717 | end 718 | -- if m_point == "/tmp/.btrfs_tmp" then 719 | -- luci.util.exec("umount " .. m_point) 720 | -- end 721 | return subvolume 722 | end 723 | 724 | d.format_partition = function(partition, fs) 725 | local partition_name = "/dev/".. partition 726 | if not nixio.fs.access(partition_name) then 727 | return 500, "Partition NOT found!" 728 | end 729 | 730 | local format_cmd = d.get_format_cmd() 731 | if not format_cmd[fs] then 732 | return 500, "Filesystem NOT support!" 733 | end 734 | local cmd = format_cmd[fs].cmd .. " " .. format_cmd[fs].option .. " " .. partition_name 735 | local res = luci.util.exec(cmd .. " 2>&1") 736 | if res and res:lower():match("error+") then 737 | return 500, res 738 | else 739 | return 200, "OK" 740 | end 741 | end 742 | 743 | return d 744 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/view/diskman/cbi/disabled_button.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <% if self:cfgvalue(section) ~= false then %> 3 | " type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> <% if self.view_disabled then %> disabled <% end %>/> 4 | <% else %> 5 | - 6 | <% end %> 7 | <%+cbi/valuefooter%> -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/view/diskman/cbi/format_button.htm: -------------------------------------------------------------------------------- 1 | <%+cbi/valueheader%> 2 | <% if self:cfgvalue(section) ~= false then %> 3 | " onclick="event.preventDefault();partition_format('<%=self.partitions[section].name%>', '<%=self.format_cmd%>', '<%=self.inputtitle%>');" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> <% if self.view_disabled then %> disabled <% end %>/> 4 | <% else %> 5 | - 6 | <% end %> 7 | <%+cbi/valuefooter%> 8 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/view/diskman/cbi/inlinebutton.htm: -------------------------------------------------------------------------------- 1 |
2 | <% if self:cfgvalue(section) ~= false then %> 3 | " type="submit"" <% if self.disable then %>disabled <% end %><%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.inputtitle or self.title)%> /> 4 | <% else %> 5 | - 6 | <% end %> 7 |
8 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/view/diskman/cbi/xnullsection.htm: -------------------------------------------------------------------------------- 1 |
2 | <% if self.title and #self.title > 0 then -%> 3 | <%=self.title%> 4 | <%- end %> 5 | <% if self.description and #self.description > 0 then -%> 6 |
<%=self.description%>
7 | <%- end %> 8 |
9 |
10 | <% self:render_children(1, scope or {}) %> 11 |
12 | <% if self.error and self.error[1] then -%> 13 |
14 |
    <% for _, e in ipairs(self.error[1]) do -%> 15 |
  • 16 | <%- if e == "invalid" then -%> 17 | <%:One or more fields contain invalid values!%> 18 | <%- elseif e == "missing" then -%> 19 | <%:One or more required fields have no value!%> 20 | <%- else -%> 21 | <%=pcdata(e)%> 22 | <%- end -%> 23 |
  • 24 | <%- end %>
25 |
26 | <%- end %> 27 |
28 |
29 | <%- 30 | if type(self.hidden) == "table" then 31 | for k, v in pairs(self.hidden) do 32 | -%> 33 | 34 | <%- 35 | end 36 | end 37 | %> -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm: -------------------------------------------------------------------------------- 1 | <% if not self.embedded then %> 2 |
> 14 | 15 | <% 16 | end 17 | 18 | %>
<% 19 | 20 | if self.title and #self.title > 0 then 21 | %>

<%=self.title%>

<% 22 | end 23 | 24 | if self.description and #self.description > 0 then 25 | %>
<%=self.description%>
<% 26 | end 27 | 28 | if self.message then 29 | %>
<%=self.message%>
<% 30 | end 31 | 32 | if self.errmessage then 33 | %>
<%=self.errmessage%>
<% 34 | end 35 | 36 | self:render_children() 37 | 38 | %>
<% 39 | 40 | if not self.embedded then 41 | if type(self.hidden) == "table" then 42 | local k, v 43 | for k, v in pairs(self.hidden) do 44 | %><% 45 | end 46 | end 47 | 48 | local display_back = (self.redirect) 49 | local display_cancel = (self.cancel ~= false and self.on_cancel) 50 | local display_skip = (self.flow and self.flow.skip) 51 | local display_submit = (self.submit ~= false) 52 | local display_reset = (self.reset ~= false) 53 | 54 | if display_back or display_cancel or display_skip or display_submit or display_reset then 55 | %>
<% 56 | 57 | if display_back then 58 | %> <% 59 | end 60 | 61 | if display_cancel then 62 | local label = pcdata(self.cancel or translate("Cancel")) 63 | %> <% 64 | end 65 | 66 | if display_skip then 67 | %> <% 68 | end 69 | 70 | if display_submit then 71 | local label = pcdata(self.submit or translate("Submit")) 72 | %> <% 73 | end 74 | 75 | if display_reset then 76 | local label = pcdata(self.reset or translate("Reset")) 77 | %> <% 78 | end 79 | 80 | %>
<% 81 | end 82 | 83 | %>
<% 84 | end 85 | %> 86 | 87 | 88 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/view/diskman/disk_info.htm: -------------------------------------------------------------------------------- 1 | 111 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm: -------------------------------------------------------------------------------- 1 | 53 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | S.M.A.R.T detail of <%=dev%> 4 | 49 | 50 | 51 |
52 |
53 | <%:S.M.A.R.T Attrbutes%>: /dev/<%=dev%> 54 | 55 | 56 | <% if dev:match("nvme") then %> 57 | 59 | <% else %> 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | <% end %> 70 | 71 | 72 | 73 | 74 |
<%:ID%><%:Attrbute%><%:Flag%><%:Value%><%:Worst%><%:Thresh%><%:Type%><%:Updated%><%:Raw%>

<%:Collecting data...%>
75 |
76 |
77 | 78 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/po/pl/diskman.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: PACKAGE VERSION\n" 4 | "PO-Revision-Date: 2023-04-21 02:03+0000\n" 5 | "Last-Translator: lisaac \n" 6 | "Language-Team: Polski (Polish) \n" 8 | "Language: pl\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=1; plural=0;\n" 13 | "X-Generator: Weblate 4.12.1-dev\n" 14 | 15 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:5 16 | msgid "-- Please choose --" 17 | msgstr "" 18 | 19 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:6 20 | msgid "-- custom --" 21 | msgstr "" 22 | 23 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:95 24 | msgid "Active" 25 | msgstr "Aktywny" 26 | 27 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:61 28 | msgid "Attrbute" 29 | msgstr "" 30 | 31 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:58 32 | msgid "Back to Overview" 33 | msgstr "" 34 | 35 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:19 36 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:104 37 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:244 38 | msgid "Btrfs" 39 | msgstr "" 40 | 41 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:27 42 | msgid "Btrfs Info" 43 | msgstr "Informacja o Btrfs" 44 | 45 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:314 46 | msgid "Btrfs Label" 47 | msgstr "Etykieta Btrfs" 48 | 49 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:327 50 | msgid "Btrfs Member" 51 | msgstr "Członek Btrfs" 52 | 53 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:318 54 | msgid "Btrfs Raid Level" 55 | msgstr "Poziom Raid Btrfs" 56 | 57 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:62 58 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 59 | msgid "Cancel" 60 | msgstr "" 61 | 62 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:72 63 | msgid "Collecting data..." 64 | msgstr "" 65 | 66 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:110 67 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:129 68 | msgid "Create" 69 | msgstr "Utwórz" 70 | 71 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:344 72 | msgid "Create Btrfs" 73 | msgstr "Utwórz Btrfs" 74 | 75 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:295 76 | msgid "Create Raid" 77 | msgstr "Utwórz RAID" 78 | 79 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:241 80 | msgid "Creation" 81 | msgstr "Kreator" 82 | 83 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:30 84 | msgid "Data" 85 | msgstr "Data" 86 | 87 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:121 88 | msgid "Default 2048 sector alignment, support +size{b,k,m,g,t} in End Sector" 89 | msgstr "" 90 | "Sektory wyrównywane są do wielokrotności 2048, sektor końcowy można podać " 91 | "jako rozmiar w postaci +size{b,k,m,g,t}" 92 | 93 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:114 94 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:118 95 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:127 96 | msgid "Delete" 97 | msgstr "Usuń" 98 | 99 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:184 100 | msgid "Destination Path (optional)" 101 | msgstr "Ścieżka docelowa (opcjonalnie)" 102 | 103 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:120 104 | msgid "Device" 105 | msgstr "" 106 | 107 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:28 108 | msgid "Device Info" 109 | msgstr "Informacja o urządzeniu" 110 | 111 | #: applications/luci-app-diskman/luasrc/controller/diskman.lua:24 112 | msgid "Disk Man" 113 | msgstr "Menadżer dysków" 114 | 115 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:11 116 | msgid "DiskMan" 117 | msgstr "Menadżer dysków" 118 | 119 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:34 120 | msgid "Disks" 121 | msgstr "Dyski" 122 | 123 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:52 124 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:91 125 | msgid "Eject" 126 | msgstr "Wysuń" 127 | 128 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:136 129 | msgid "End Sector" 130 | msgstr "Sektor końcowy" 131 | 132 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:139 133 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:184 134 | msgid "File System" 135 | msgstr "System plików" 136 | 137 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:62 138 | msgid "Flag" 139 | msgstr "" 140 | 141 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:199 142 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 143 | msgid "Format" 144 | msgstr "Formatuj" 145 | 146 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 147 | msgid "Format partation:" 148 | msgstr "Format partycji:" 149 | 150 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:106 151 | msgid "Formatting.." 152 | msgstr "" 153 | 154 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:34 155 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:160 156 | msgid "Free Space" 157 | msgstr "Wolna przestrzeń" 158 | 159 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:46 160 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:59 161 | msgid "Health" 162 | msgstr "Kondycja" 163 | 164 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:53 165 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:60 166 | msgid "ID" 167 | msgstr "" 168 | 169 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:320 170 | msgid "Invalid End Sector!" 171 | msgstr "Nieprawidłowy sektor końcowy!" 172 | 173 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:301 174 | msgid "Invalid Start Sector!" 175 | msgstr "Nieprawidłowy sektor początkowy!" 176 | 177 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:57 178 | msgid "KEY" 179 | msgstr "" 180 | 181 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:36 182 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:106 183 | msgid "Label" 184 | msgstr "Etykieta" 185 | 186 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:51 187 | msgid "Level" 188 | msgstr "" 189 | 190 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:19 191 | msgid "Manage Btrfs" 192 | msgstr "Zarządzaj Btrfs" 193 | 194 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:11 195 | msgid "Manage Disks over LuCI." 196 | msgstr "Zarządzaj dyskami przez LuCI." 197 | 198 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:29 199 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:94 200 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:107 201 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:52 202 | msgid "Members" 203 | msgstr "Członkowie" 204 | 205 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:31 206 | msgid "Metadata" 207 | msgstr "Metadata" 208 | 209 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:38 210 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:32 211 | msgid "Model" 212 | msgstr "Model urządzenia" 213 | 214 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:210 215 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:214 216 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:224 217 | msgid "Mount" 218 | msgstr "Montuj" 219 | 220 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:155 221 | msgid "Mount Options" 222 | msgstr "Opcje montowania" 223 | 224 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:119 225 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:184 226 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:162 227 | msgid "Mount Point" 228 | msgstr "Punkt montowania" 229 | 230 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:244 231 | msgid "Multiple Devices Btrfs Creation" 232 | msgstr "Kreator urządzeń Btrfs" 233 | 234 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:124 235 | msgid "Name" 236 | msgstr "" 237 | 238 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:279 239 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:285 240 | msgid "New" 241 | msgstr "Nowa" 242 | 243 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:166 244 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:192 245 | msgid "New Snapshot" 246 | msgstr "Nowy obraz" 247 | 248 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:43 249 | msgid "No Attrbute to display." 250 | msgstr "" 251 | 252 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xnullsection.htm:17 253 | msgid "One or more fields contain invalid values!" 254 | msgstr "" 255 | 256 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xnullsection.htm:19 257 | msgid "One or more required fields have no value!" 258 | msgstr "" 259 | 260 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:56 261 | msgid "Otime" 262 | msgstr "Otime" 263 | 264 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:17 265 | msgid "Partition Disk over LuCI." 266 | msgstr "Zarządzaj partycjami przez LuCI." 267 | 268 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:17 269 | msgid "Partition Management" 270 | msgstr "Menadżer partycji" 271 | 272 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:43 273 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:92 274 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:36 275 | msgid "Partition Table" 276 | msgstr "Tablica partycji" 277 | 278 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:352 279 | msgid "Partition not exists!" 280 | msgstr "Partycja nie istnieje!" 281 | 282 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:121 283 | msgid "Partitions Info" 284 | msgstr "Informacja o partycjach" 285 | 286 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:58 287 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:37 288 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:89 289 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:31 290 | msgid "Path" 291 | msgstr "Ścieżka" 292 | 293 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:206 294 | msgid "Please input Source Path of snapshot, Source Path must start with '/'" 295 | msgstr "" 296 | "Proszę podać ścieżkę źródłową dla obrazu, ścieżka musi zaczynać się od '/'" 297 | 298 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:133 299 | msgid "Please input Subvolume Path, Subvolume must start with '/'" 300 | msgstr "" 301 | "Proszę podać ścieżkę dla sub-wolumenu, sub-wolumen musi zaczynać się od '/'" 302 | 303 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:103 304 | msgid "Please select file system!" 305 | msgstr "Proszę wybrać system plików!" 306 | 307 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:243 308 | msgid "RAID" 309 | msgstr "" 310 | 311 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:243 312 | msgid "RAID Creation" 313 | msgstr "Kreator RAID" 314 | 315 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:87 316 | msgid "RAID Devices" 317 | msgstr "Urządzenia RAID" 318 | 319 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:90 320 | msgid "RAID mode" 321 | msgstr "Tryb RAID" 322 | 323 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:255 324 | msgid "Raid Level" 325 | msgstr "Poziom RAID" 326 | 327 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:278 328 | msgid "Raid Member" 329 | msgstr "Członek RAID" 330 | 331 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:250 332 | msgid "Raid Name" 333 | msgstr "Nazwa RAID" 334 | 335 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:68 336 | msgid "Raw" 337 | msgstr "" 338 | 339 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:175 340 | msgid "Readonly" 341 | msgstr "Tylko do odczytu" 342 | 343 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:89 344 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:276 345 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:348 346 | msgid "Remove" 347 | msgstr "Wysuń" 348 | 349 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:20 350 | msgid "Rescan Disks" 351 | msgstr "Skanuj dyski" 352 | 353 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:76 354 | msgid "Reset" 355 | msgstr "" 356 | 357 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:56 358 | msgid "Rotation Rate" 359 | msgstr "Obroty" 360 | 361 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:53 362 | msgid "S.M.A.R.T Attrbutes" 363 | msgstr "" 364 | 365 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:44 366 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:55 367 | msgid "SATA Version" 368 | msgstr "Wersja SATA" 369 | 370 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:35 371 | msgid "Sector Size" 372 | msgstr "Rozmiar sektora" 373 | 374 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:39 375 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:33 376 | msgid "Serial Number" 377 | msgstr "Numer seryjny" 378 | 379 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:75 380 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:82 381 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:86 382 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:93 383 | msgid "Set Default" 384 | msgstr "Ustaw domyślnie" 385 | 386 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:32 387 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:40 388 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:91 389 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:34 390 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:155 391 | msgid "Size" 392 | msgstr "Rozmiar" 393 | 394 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:67 395 | msgid "Skip" 396 | msgstr "" 397 | 398 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:57 399 | msgid "Snapshots" 400 | msgstr "Obrazy" 401 | 402 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:168 403 | msgid "Source Path" 404 | msgstr "Ścieżka źródłowa" 405 | 406 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:125 407 | msgid "Start Sector" 408 | msgstr "Sektor początkowy" 409 | 410 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:46 411 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:93 412 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:58 413 | msgid "Status" 414 | msgstr "Status" 415 | 416 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:52 417 | msgid "SubVolumes" 418 | msgstr "Sub-wolumeny" 419 | 420 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:71 421 | msgid "Submit" 422 | msgstr "" 423 | 424 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:41 425 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:54 426 | msgid "Temp" 427 | msgstr "Temperatura" 428 | 429 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:175 430 | msgid "The path where you want to store the snapshot" 431 | msgstr "Ścieżka w której chcesz przechowywać obraz" 432 | 433 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:168 434 | msgid "The source path for create the snapshot" 435 | msgstr "Ścieżka źródłowa do utworzenia obrazu" 436 | 437 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:65 438 | msgid "Thresh" 439 | msgstr "" 440 | 441 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:54 442 | msgid "Top Level" 443 | msgstr "Top Level" 444 | 445 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:157 446 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:66 447 | msgid "Type" 448 | msgstr "" 449 | 450 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:28 451 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:55 452 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:105 453 | msgid "UUID" 454 | msgstr "" 455 | 456 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:217 457 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:228 458 | msgid "Umount" 459 | msgstr "Odmontuj" 460 | 461 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:58 462 | msgid "Unsupported raid reject!" 463 | msgstr "" 464 | 465 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:42 466 | msgid "Update" 467 | msgstr "" 468 | 469 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:67 470 | msgid "Updated" 471 | msgstr "" 472 | 473 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:35 474 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:110 475 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:161 476 | msgid "Usage" 477 | msgstr "Wykorzystane" 478 | 479 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:33 480 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:159 481 | msgid "Used" 482 | msgstr "Zajęte" 483 | 484 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:58 485 | msgid "VALUE" 486 | msgstr "" 487 | 488 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:63 489 | msgid "Value" 490 | msgstr "" 491 | 492 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:74 493 | msgid "" 494 | "Warnning !! \\nTHIS WILL OVERWRITE EXISTING PARTITIONS!! \\nModify the " 495 | "partition table?" 496 | msgstr "" 497 | "Ostrzeżenie !! \n" 498 | "ISTNIEJĄCE PARTYCJE ZOSTANĄ NADPISANE!! \n" 499 | "Zmodyfikować tablicę partycji?" 500 | 501 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:64 502 | msgid "Worst" 503 | msgstr "" 504 | 505 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:63 506 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:99 507 | msgid "is in use! please unmount it first!" 508 | msgstr "aktualnie jest w użyciu, proszę najpierw odmontować!" 509 | 510 | #~ msgid "Partition NOT found!" 511 | #~ msgstr "Nie znaleziono partycji!" 512 | 513 | #~ msgid "Filesystem NOT support!" 514 | #~ msgstr "System plików nie jest obsługiwany!" 515 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/po/templates/diskman.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "Content-Type: text/plain; charset=UTF-8" 3 | 4 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:5 5 | msgid "-- Please choose --" 6 | msgstr "" 7 | 8 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:6 9 | msgid "-- custom --" 10 | msgstr "" 11 | 12 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:95 13 | msgid "Active" 14 | msgstr "" 15 | 16 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:61 17 | msgid "Attrbute" 18 | msgstr "" 19 | 20 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:58 21 | msgid "Back to Overview" 22 | msgstr "" 23 | 24 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:19 25 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:104 26 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:244 27 | msgid "Btrfs" 28 | msgstr "" 29 | 30 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:27 31 | msgid "Btrfs Info" 32 | msgstr "" 33 | 34 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:314 35 | msgid "Btrfs Label" 36 | msgstr "" 37 | 38 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:327 39 | msgid "Btrfs Member" 40 | msgstr "" 41 | 42 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:318 43 | msgid "Btrfs Raid Level" 44 | msgstr "" 45 | 46 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:62 47 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 48 | msgid "Cancel" 49 | msgstr "" 50 | 51 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:72 52 | msgid "Collecting data..." 53 | msgstr "" 54 | 55 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:110 56 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:129 57 | msgid "Create" 58 | msgstr "" 59 | 60 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:344 61 | msgid "Create Btrfs" 62 | msgstr "" 63 | 64 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:295 65 | msgid "Create Raid" 66 | msgstr "" 67 | 68 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:241 69 | msgid "Creation" 70 | msgstr "" 71 | 72 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:30 73 | msgid "Data" 74 | msgstr "" 75 | 76 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:121 77 | msgid "Default 2048 sector alignment, support +size{b,k,m,g,t} in End Sector" 78 | msgstr "" 79 | 80 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:114 81 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:118 82 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:127 83 | msgid "Delete" 84 | msgstr "" 85 | 86 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:184 87 | msgid "Destination Path (optional)" 88 | msgstr "" 89 | 90 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:120 91 | msgid "Device" 92 | msgstr "" 93 | 94 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:28 95 | msgid "Device Info" 96 | msgstr "" 97 | 98 | #: applications/luci-app-diskman/luasrc/controller/diskman.lua:24 99 | msgid "Disk Man" 100 | msgstr "" 101 | 102 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:11 103 | msgid "DiskMan" 104 | msgstr "" 105 | 106 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:34 107 | msgid "Disks" 108 | msgstr "" 109 | 110 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:52 111 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:91 112 | msgid "Eject" 113 | msgstr "" 114 | 115 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:136 116 | msgid "End Sector" 117 | msgstr "" 118 | 119 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:139 120 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:184 121 | msgid "File System" 122 | msgstr "" 123 | 124 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:62 125 | msgid "Flag" 126 | msgstr "" 127 | 128 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:199 129 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 130 | msgid "Format" 131 | msgstr "" 132 | 133 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 134 | msgid "Format partation:" 135 | msgstr "" 136 | 137 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:106 138 | msgid "Formatting.." 139 | msgstr "" 140 | 141 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:34 142 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:160 143 | msgid "Free Space" 144 | msgstr "" 145 | 146 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:46 147 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:59 148 | msgid "Health" 149 | msgstr "" 150 | 151 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:53 152 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:60 153 | msgid "ID" 154 | msgstr "" 155 | 156 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:320 157 | msgid "Invalid End Sector!" 158 | msgstr "" 159 | 160 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:301 161 | msgid "Invalid Start Sector!" 162 | msgstr "" 163 | 164 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:57 165 | msgid "KEY" 166 | msgstr "" 167 | 168 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:36 169 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:106 170 | msgid "Label" 171 | msgstr "" 172 | 173 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:51 174 | msgid "Level" 175 | msgstr "" 176 | 177 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:19 178 | msgid "Manage Btrfs" 179 | msgstr "" 180 | 181 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:11 182 | msgid "Manage Disks over LuCI." 183 | msgstr "" 184 | 185 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:29 186 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:94 187 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:107 188 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:52 189 | msgid "Members" 190 | msgstr "" 191 | 192 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:31 193 | msgid "Metadata" 194 | msgstr "" 195 | 196 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:38 197 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:32 198 | msgid "Model" 199 | msgstr "" 200 | 201 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:210 202 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:214 203 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:224 204 | msgid "Mount" 205 | msgstr "" 206 | 207 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:155 208 | msgid "Mount Options" 209 | msgstr "" 210 | 211 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:119 212 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:184 213 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:162 214 | msgid "Mount Point" 215 | msgstr "" 216 | 217 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:244 218 | msgid "Multiple Devices Btrfs Creation" 219 | msgstr "" 220 | 221 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:124 222 | msgid "Name" 223 | msgstr "" 224 | 225 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:279 226 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:285 227 | msgid "New" 228 | msgstr "" 229 | 230 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:166 231 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:192 232 | msgid "New Snapshot" 233 | msgstr "" 234 | 235 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:43 236 | msgid "No Attrbute to display." 237 | msgstr "" 238 | 239 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xnullsection.htm:17 240 | msgid "One or more fields contain invalid values!" 241 | msgstr "" 242 | 243 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xnullsection.htm:19 244 | msgid "One or more required fields have no value!" 245 | msgstr "" 246 | 247 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:56 248 | msgid "Otime" 249 | msgstr "" 250 | 251 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:17 252 | msgid "Partition Disk over LuCI." 253 | msgstr "" 254 | 255 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:17 256 | msgid "Partition Management" 257 | msgstr "" 258 | 259 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:43 260 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:92 261 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:36 262 | msgid "Partition Table" 263 | msgstr "" 264 | 265 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:352 266 | msgid "Partition not exists!" 267 | msgstr "" 268 | 269 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:121 270 | msgid "Partitions Info" 271 | msgstr "" 272 | 273 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:58 274 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:37 275 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:89 276 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:31 277 | msgid "Path" 278 | msgstr "" 279 | 280 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:206 281 | msgid "Please input Source Path of snapshot, Source Path must start with '/'" 282 | msgstr "" 283 | 284 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:133 285 | msgid "Please input Subvolume Path, Subvolume must start with '/'" 286 | msgstr "" 287 | 288 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:103 289 | msgid "Please select file system!" 290 | msgstr "" 291 | 292 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:243 293 | msgid "RAID" 294 | msgstr "" 295 | 296 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:243 297 | msgid "RAID Creation" 298 | msgstr "" 299 | 300 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:87 301 | msgid "RAID Devices" 302 | msgstr "" 303 | 304 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:90 305 | msgid "RAID mode" 306 | msgstr "" 307 | 308 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:255 309 | msgid "Raid Level" 310 | msgstr "" 311 | 312 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:278 313 | msgid "Raid Member" 314 | msgstr "" 315 | 316 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:250 317 | msgid "Raid Name" 318 | msgstr "" 319 | 320 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:68 321 | msgid "Raw" 322 | msgstr "" 323 | 324 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:175 325 | msgid "Readonly" 326 | msgstr "" 327 | 328 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:89 329 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:276 330 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:348 331 | msgid "Remove" 332 | msgstr "" 333 | 334 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:20 335 | msgid "Rescan Disks" 336 | msgstr "" 337 | 338 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:76 339 | msgid "Reset" 340 | msgstr "" 341 | 342 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:56 343 | msgid "Rotation Rate" 344 | msgstr "" 345 | 346 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:53 347 | msgid "S.M.A.R.T Attrbutes" 348 | msgstr "" 349 | 350 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:44 351 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:55 352 | msgid "SATA Version" 353 | msgstr "" 354 | 355 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:35 356 | msgid "Sector Size" 357 | msgstr "" 358 | 359 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:39 360 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:33 361 | msgid "Serial Number" 362 | msgstr "" 363 | 364 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:75 365 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:82 366 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:86 367 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:93 368 | msgid "Set Default" 369 | msgstr "" 370 | 371 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:32 372 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:40 373 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:91 374 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:34 375 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:155 376 | msgid "Size" 377 | msgstr "" 378 | 379 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:67 380 | msgid "Skip" 381 | msgstr "" 382 | 383 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:57 384 | msgid "Snapshots" 385 | msgstr "" 386 | 387 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:168 388 | msgid "Source Path" 389 | msgstr "" 390 | 391 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:125 392 | msgid "Start Sector" 393 | msgstr "" 394 | 395 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:46 396 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:93 397 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:58 398 | msgid "Status" 399 | msgstr "" 400 | 401 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:52 402 | msgid "SubVolumes" 403 | msgstr "" 404 | 405 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:71 406 | msgid "Submit" 407 | msgstr "" 408 | 409 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:41 410 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:54 411 | msgid "Temp" 412 | msgstr "" 413 | 414 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:175 415 | msgid "The path where you want to store the snapshot" 416 | msgstr "" 417 | 418 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:168 419 | msgid "The source path for create the snapshot" 420 | msgstr "" 421 | 422 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:65 423 | msgid "Thresh" 424 | msgstr "" 425 | 426 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:54 427 | msgid "Top Level" 428 | msgstr "" 429 | 430 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:157 431 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:66 432 | msgid "Type" 433 | msgstr "" 434 | 435 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:28 436 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:55 437 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:105 438 | msgid "UUID" 439 | msgstr "" 440 | 441 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:217 442 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:228 443 | msgid "Umount" 444 | msgstr "" 445 | 446 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:58 447 | msgid "Unsupported raid reject!" 448 | msgstr "" 449 | 450 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:42 451 | msgid "Update" 452 | msgstr "" 453 | 454 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:67 455 | msgid "Updated" 456 | msgstr "" 457 | 458 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:35 459 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:110 460 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:161 461 | msgid "Usage" 462 | msgstr "" 463 | 464 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:33 465 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:159 466 | msgid "Used" 467 | msgstr "" 468 | 469 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:58 470 | msgid "VALUE" 471 | msgstr "" 472 | 473 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:63 474 | msgid "Value" 475 | msgstr "" 476 | 477 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:74 478 | msgid "" 479 | "Warnning !! \\nTHIS WILL OVERWRITE EXISTING PARTITIONS!! \\nModify the " 480 | "partition table?" 481 | msgstr "" 482 | 483 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:64 484 | msgid "Worst" 485 | msgstr "" 486 | 487 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:63 488 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:99 489 | msgid "is in use! please unmount it first!" 490 | msgstr "" 491 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/po/zh-cn/diskman.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: PACKAGE VERSION\n" 4 | "PO-Revision-Date: 2023-04-21 02:03+0000\n" 5 | "Last-Translator: muink \n" 6 | "Language-Team: Chinese (Simplified) \n" 8 | "Language: zh_Hans\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=1; plural=0;\n" 13 | "X-Generator: Weblate 4.12.1-dev\n" 14 | 15 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:5 16 | msgid "-- Please choose --" 17 | msgstr "" 18 | 19 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:6 20 | msgid "-- custom --" 21 | msgstr "" 22 | 23 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:95 24 | msgid "Active" 25 | msgstr "活动" 26 | 27 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:61 28 | msgid "Attrbute" 29 | msgstr "" 30 | 31 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:58 32 | msgid "Back to Overview" 33 | msgstr "" 34 | 35 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:19 36 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:104 37 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:244 38 | msgid "Btrfs" 39 | msgstr "" 40 | 41 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:27 42 | msgid "Btrfs Info" 43 | msgstr "Btrfs 信息" 44 | 45 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:314 46 | msgid "Btrfs Label" 47 | msgstr "Btrfs 卷标" 48 | 49 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:327 50 | msgid "Btrfs Member" 51 | msgstr "Btrfs 阵列成员" 52 | 53 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:318 54 | msgid "Btrfs Raid Level" 55 | msgstr "Btrfs Raid 级别" 56 | 57 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:62 58 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 59 | msgid "Cancel" 60 | msgstr "" 61 | 62 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:72 63 | msgid "Collecting data..." 64 | msgstr "" 65 | 66 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:110 67 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:129 68 | msgid "Create" 69 | msgstr "创建" 70 | 71 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:344 72 | msgid "Create Btrfs" 73 | msgstr "创建 Btrfs" 74 | 75 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:295 76 | msgid "Create Raid" 77 | msgstr "创建 RAID" 78 | 79 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:241 80 | msgid "Creation" 81 | msgstr "创建" 82 | 83 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:30 84 | msgid "Data" 85 | msgstr "数据" 86 | 87 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:121 88 | msgid "Default 2048 sector alignment, support +size{b,k,m,g,t} in End Sector" 89 | msgstr "" 90 | "默认2048扇区对齐,【中止扇区】支持 +容量{b,k,m,g,t} 格式,例:+500m +10g +1t" 91 | 92 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:114 93 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:118 94 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:127 95 | msgid "Delete" 96 | msgstr "删除" 97 | 98 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:184 99 | msgid "Destination Path (optional)" 100 | msgstr "目标目录(可选)" 101 | 102 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:120 103 | msgid "Device" 104 | msgstr "" 105 | 106 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:28 107 | msgid "Device Info" 108 | msgstr "设备信息" 109 | 110 | #: applications/luci-app-diskman/luasrc/controller/diskman.lua:24 111 | msgid "Disk Man" 112 | msgstr "磁盘管理" 113 | 114 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:11 115 | msgid "DiskMan" 116 | msgstr "DiskMan 磁盘管理" 117 | 118 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:34 119 | msgid "Disks" 120 | msgstr "磁盘" 121 | 122 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:52 123 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:91 124 | msgid "Eject" 125 | msgstr "弹出" 126 | 127 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:136 128 | msgid "End Sector" 129 | msgstr "中止扇区" 130 | 131 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:139 132 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:184 133 | msgid "File System" 134 | msgstr "文件系统" 135 | 136 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:62 137 | msgid "Flag" 138 | msgstr "" 139 | 140 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:199 141 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 142 | msgid "Format" 143 | msgstr "格式化" 144 | 145 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 146 | msgid "Format partation:" 147 | msgstr "格式化分区:" 148 | 149 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:106 150 | msgid "Formatting.." 151 | msgstr "" 152 | 153 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:34 154 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:160 155 | msgid "Free Space" 156 | msgstr "空闲空间" 157 | 158 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:46 159 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:59 160 | msgid "Health" 161 | msgstr "健康" 162 | 163 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:53 164 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:60 165 | msgid "ID" 166 | msgstr "" 167 | 168 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:320 169 | msgid "Invalid End Sector!" 170 | msgstr "无效的终止扇区!" 171 | 172 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:301 173 | msgid "Invalid Start Sector!" 174 | msgstr "无效的起始扇区!" 175 | 176 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:57 177 | msgid "KEY" 178 | msgstr "" 179 | 180 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:36 181 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:106 182 | msgid "Label" 183 | msgstr "卷标" 184 | 185 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:51 186 | msgid "Level" 187 | msgstr "" 188 | 189 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:19 190 | msgid "Manage Btrfs" 191 | msgstr "Btrfs 管理" 192 | 193 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:11 194 | msgid "Manage Disks over LuCI." 195 | msgstr "通过 LuCI 管理磁盘" 196 | 197 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:29 198 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:94 199 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:107 200 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:52 201 | msgid "Members" 202 | msgstr "成员" 203 | 204 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:31 205 | msgid "Metadata" 206 | msgstr "元数据" 207 | 208 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:38 209 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:32 210 | msgid "Model" 211 | msgstr "型号" 212 | 213 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:210 214 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:214 215 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:224 216 | msgid "Mount" 217 | msgstr "挂载" 218 | 219 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:155 220 | msgid "Mount Options" 221 | msgstr "挂载选项" 222 | 223 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:119 224 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:184 225 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:162 226 | msgid "Mount Point" 227 | msgstr "挂载点" 228 | 229 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:244 230 | msgid "Multiple Devices Btrfs Creation" 231 | msgstr "Btrfs 阵列创建" 232 | 233 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:124 234 | msgid "Name" 235 | msgstr "" 236 | 237 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:279 238 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:285 239 | msgid "New" 240 | msgstr "新建" 241 | 242 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:166 243 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:192 244 | msgid "New Snapshot" 245 | msgstr "新建快照" 246 | 247 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:43 248 | msgid "No Attrbute to display." 249 | msgstr "" 250 | 251 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xnullsection.htm:17 252 | msgid "One or more fields contain invalid values!" 253 | msgstr "" 254 | 255 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xnullsection.htm:19 256 | msgid "One or more required fields have no value!" 257 | msgstr "" 258 | 259 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:56 260 | msgid "Otime" 261 | msgstr "创建时间" 262 | 263 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:17 264 | msgid "Partition Disk over LuCI." 265 | msgstr "通过LuCI分区磁盘。" 266 | 267 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:17 268 | msgid "Partition Management" 269 | msgstr "分区管理" 270 | 271 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:43 272 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:92 273 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:36 274 | msgid "Partition Table" 275 | msgstr "分区表" 276 | 277 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:352 278 | msgid "Partition not exists!" 279 | msgstr "分区不存在!" 280 | 281 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:121 282 | msgid "Partitions Info" 283 | msgstr "分区信息" 284 | 285 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:58 286 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:37 287 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:89 288 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:31 289 | msgid "Path" 290 | msgstr "路径" 291 | 292 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:206 293 | msgid "Please input Source Path of snapshot, Source Path must start with '/'" 294 | msgstr "请输入快照源路径,源路径必须以'/'开头" 295 | 296 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:133 297 | msgid "Please input Subvolume Path, Subvolume must start with '/'" 298 | msgstr "请输入子卷路径,子卷路径必须以'/'开头" 299 | 300 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:103 301 | msgid "Please select file system!" 302 | msgstr "请选择文件系统!" 303 | 304 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:243 305 | msgid "RAID" 306 | msgstr "" 307 | 308 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:243 309 | msgid "RAID Creation" 310 | msgstr "RAID 创建" 311 | 312 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:87 313 | msgid "RAID Devices" 314 | msgstr "RAID 设备" 315 | 316 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:90 317 | msgid "RAID mode" 318 | msgstr "RAID 模式" 319 | 320 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:255 321 | msgid "Raid Level" 322 | msgstr "RAID 级别" 323 | 324 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:278 325 | msgid "Raid Member" 326 | msgstr "磁盘阵列成员" 327 | 328 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:250 329 | msgid "Raid Name" 330 | msgstr "RAID 名称" 331 | 332 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:68 333 | msgid "Raw" 334 | msgstr "" 335 | 336 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:175 337 | msgid "Readonly" 338 | msgstr "只读" 339 | 340 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:89 341 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:276 342 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:348 343 | msgid "Remove" 344 | msgstr "移除" 345 | 346 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:20 347 | msgid "Rescan Disks" 348 | msgstr "重新扫描磁盘" 349 | 350 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:76 351 | msgid "Reset" 352 | msgstr "" 353 | 354 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:56 355 | msgid "Rotation Rate" 356 | msgstr "转速" 357 | 358 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:53 359 | msgid "S.M.A.R.T Attrbutes" 360 | msgstr "" 361 | 362 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:44 363 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:55 364 | msgid "SATA Version" 365 | msgstr "SATA 版本" 366 | 367 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:35 368 | msgid "Sector Size" 369 | msgstr "扇区/物理扇区大小" 370 | 371 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:39 372 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:33 373 | msgid "Serial Number" 374 | msgstr "序列号" 375 | 376 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:75 377 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:82 378 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:86 379 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:93 380 | msgid "Set Default" 381 | msgstr "默认子卷" 382 | 383 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:32 384 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:40 385 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:91 386 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:34 387 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:155 388 | msgid "Size" 389 | msgstr "容量" 390 | 391 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:67 392 | msgid "Skip" 393 | msgstr "" 394 | 395 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:57 396 | msgid "Snapshots" 397 | msgstr "快照" 398 | 399 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:168 400 | msgid "Source Path" 401 | msgstr "源目录" 402 | 403 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:125 404 | msgid "Start Sector" 405 | msgstr "起始扇区" 406 | 407 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:46 408 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:93 409 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:58 410 | msgid "Status" 411 | msgstr "状态" 412 | 413 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:52 414 | msgid "SubVolumes" 415 | msgstr "子卷" 416 | 417 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:71 418 | msgid "Submit" 419 | msgstr "" 420 | 421 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:41 422 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:54 423 | msgid "Temp" 424 | msgstr "温度" 425 | 426 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:175 427 | msgid "The path where you want to store the snapshot" 428 | msgstr "存放快照数据目录" 429 | 430 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:168 431 | msgid "The source path for create the snapshot" 432 | msgstr "创建快照的源数据目录" 433 | 434 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:65 435 | msgid "Thresh" 436 | msgstr "" 437 | 438 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:54 439 | msgid "Top Level" 440 | msgstr "父ID" 441 | 442 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:157 443 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:66 444 | msgid "Type" 445 | msgstr "" 446 | 447 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:28 448 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:55 449 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:105 450 | msgid "UUID" 451 | msgstr "" 452 | 453 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:217 454 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:228 455 | msgid "Umount" 456 | msgstr "卸载" 457 | 458 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:58 459 | msgid "Unsupported raid reject!" 460 | msgstr "" 461 | 462 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:42 463 | msgid "Update" 464 | msgstr "" 465 | 466 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:67 467 | msgid "Updated" 468 | msgstr "" 469 | 470 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:35 471 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:110 472 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:161 473 | msgid "Usage" 474 | msgstr "用量" 475 | 476 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:33 477 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:159 478 | msgid "Used" 479 | msgstr "已使用" 480 | 481 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:58 482 | msgid "VALUE" 483 | msgstr "" 484 | 485 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:63 486 | msgid "Value" 487 | msgstr "" 488 | 489 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:74 490 | msgid "" 491 | "Warnning !! \\nTHIS WILL OVERWRITE EXISTING PARTITIONS!! \\nModify the " 492 | "partition table?" 493 | msgstr "" 494 | "警告!!\n" 495 | "此操作会覆盖现有分区\n" 496 | "确定修改分区表?" 497 | 498 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:64 499 | msgid "Worst" 500 | msgstr "" 501 | 502 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:63 503 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:99 504 | msgid "is in use! please unmount it first!" 505 | msgstr "正在被使用!请先卸载!" 506 | 507 | #~ msgid "Partition NOT found!" 508 | #~ msgstr "分区未找到!" 509 | 510 | #~ msgid "Filesystem NOT support!" 511 | #~ msgstr "文件系统不支持!" 512 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/po/zh-tw/diskman.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: PACKAGE VERSION\n" 4 | "PO-Revision-Date: 2023-04-21 02:03+0000\n" 5 | "Last-Translator: muink \n" 6 | "Language-Team: Chinese (Traditional) \n" 8 | "Language: zh_Hant\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "Plural-Forms: nplurals=1; plural=0;\n" 13 | "X-Generator: Weblate 4.12.1-dev\n" 14 | 15 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:5 16 | msgid "-- Please choose --" 17 | msgstr "" 18 | 19 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:6 20 | msgid "-- custom --" 21 | msgstr "" 22 | 23 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:95 24 | msgid "Active" 25 | msgstr "活躍" 26 | 27 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:61 28 | msgid "Attrbute" 29 | msgstr "" 30 | 31 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:58 32 | msgid "Back to Overview" 33 | msgstr "" 34 | 35 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:19 36 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:104 37 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:244 38 | msgid "Btrfs" 39 | msgstr "" 40 | 41 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:27 42 | msgid "Btrfs Info" 43 | msgstr "Btrfs 信息" 44 | 45 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:314 46 | msgid "Btrfs Label" 47 | msgstr "Btrfs 卷標" 48 | 49 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:327 50 | msgid "Btrfs Member" 51 | msgstr "Btrfs 陣列成員" 52 | 53 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:318 54 | msgid "Btrfs Raid Level" 55 | msgstr "Btrfs Raid 等級" 56 | 57 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:62 58 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 59 | msgid "Cancel" 60 | msgstr "" 61 | 62 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:72 63 | msgid "Collecting data..." 64 | msgstr "" 65 | 66 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:110 67 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:129 68 | msgid "Create" 69 | msgstr "創建" 70 | 71 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:344 72 | msgid "Create Btrfs" 73 | msgstr "創建 Btrfs" 74 | 75 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:295 76 | msgid "Create Raid" 77 | msgstr "創建 RAID" 78 | 79 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:241 80 | msgid "Creation" 81 | msgstr "創建" 82 | 83 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:30 84 | msgid "Data" 85 | msgstr "數據" 86 | 87 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:121 88 | msgid "Default 2048 sector alignment, support +size{b,k,m,g,t} in End Sector" 89 | msgstr "" 90 | "默認 2048 磁區對齊,【結束磁區】支持 +容量{b,k,m,g,t} 格式,例:+500m +10g " 91 | "+1t" 92 | 93 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:114 94 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:118 95 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:127 96 | msgid "Delete" 97 | msgstr "刪除" 98 | 99 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:184 100 | msgid "Destination Path (optional)" 101 | msgstr "目標目錄(可選)" 102 | 103 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:120 104 | msgid "Device" 105 | msgstr "" 106 | 107 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:28 108 | msgid "Device Info" 109 | msgstr "裝置信息" 110 | 111 | #: applications/luci-app-diskman/luasrc/controller/diskman.lua:24 112 | msgid "Disk Man" 113 | msgstr "硬碟管理" 114 | 115 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:11 116 | msgid "DiskMan" 117 | msgstr "DiskMan 硬碟管理" 118 | 119 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:34 120 | msgid "Disks" 121 | msgstr "硬碟" 122 | 123 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:52 124 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:91 125 | msgid "Eject" 126 | msgstr "彈出" 127 | 128 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:136 129 | msgid "End Sector" 130 | msgstr "結束磁區" 131 | 132 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:139 133 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:184 134 | msgid "File System" 135 | msgstr "文件系統" 136 | 137 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:62 138 | msgid "Flag" 139 | msgstr "" 140 | 141 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:199 142 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 143 | msgid "Format" 144 | msgstr "格式化" 145 | 146 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:132 147 | msgid "Format partation:" 148 | msgstr "格式化分割區:" 149 | 150 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:106 151 | msgid "Formatting.." 152 | msgstr "" 153 | 154 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:34 155 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:160 156 | msgid "Free Space" 157 | msgstr "空閒空間" 158 | 159 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:46 160 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:59 161 | msgid "Health" 162 | msgstr "健康" 163 | 164 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:53 165 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:60 166 | msgid "ID" 167 | msgstr "" 168 | 169 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:320 170 | msgid "Invalid End Sector!" 171 | msgstr "無效的結束磁區!" 172 | 173 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:301 174 | msgid "Invalid Start Sector!" 175 | msgstr "無效的起始磁區!" 176 | 177 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:57 178 | msgid "KEY" 179 | msgstr "" 180 | 181 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:36 182 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:106 183 | msgid "Label" 184 | msgstr "卷標" 185 | 186 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:51 187 | msgid "Level" 188 | msgstr "" 189 | 190 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:19 191 | msgid "Manage Btrfs" 192 | msgstr "Btrfs 管理" 193 | 194 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:11 195 | msgid "Manage Disks over LuCI." 196 | msgstr "通过 LuCI 管理硬碟" 197 | 198 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:29 199 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:94 200 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:107 201 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:52 202 | msgid "Members" 203 | msgstr "成員" 204 | 205 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:31 206 | msgid "Metadata" 207 | msgstr "元數據" 208 | 209 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:38 210 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:32 211 | msgid "Model" 212 | msgstr "型號" 213 | 214 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:210 215 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:214 216 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:224 217 | msgid "Mount" 218 | msgstr "掛載" 219 | 220 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:155 221 | msgid "Mount Options" 222 | msgstr "掛載選項" 223 | 224 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:119 225 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:184 226 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:162 227 | msgid "Mount Point" 228 | msgstr "掛載點" 229 | 230 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:244 231 | msgid "Multiple Devices Btrfs Creation" 232 | msgstr "Btrfs 陣列創建" 233 | 234 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:124 235 | msgid "Name" 236 | msgstr "" 237 | 238 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:279 239 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:285 240 | msgid "New" 241 | msgstr "新建" 242 | 243 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:166 244 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:192 245 | msgid "New Snapshot" 246 | msgstr "新建快照" 247 | 248 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:43 249 | msgid "No Attrbute to display." 250 | msgstr "" 251 | 252 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xnullsection.htm:17 253 | msgid "One or more fields contain invalid values!" 254 | msgstr "" 255 | 256 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xnullsection.htm:19 257 | msgid "One or more required fields have no value!" 258 | msgstr "" 259 | 260 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:56 261 | msgid "Otime" 262 | msgstr "創建時間" 263 | 264 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:17 265 | msgid "Partition Disk over LuCI." 266 | msgstr "通過 LuCI 分割硬碟。" 267 | 268 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:17 269 | msgid "Partition Management" 270 | msgstr "分割區管理" 271 | 272 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:43 273 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:92 274 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:36 275 | msgid "Partition Table" 276 | msgstr "分割區表" 277 | 278 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:352 279 | msgid "Partition not exists!" 280 | msgstr "分割區不存在!" 281 | 282 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:121 283 | msgid "Partitions Info" 284 | msgstr "分割區信息" 285 | 286 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:58 287 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:37 288 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:89 289 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:31 290 | msgid "Path" 291 | msgstr "路徑" 292 | 293 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:206 294 | msgid "Please input Source Path of snapshot, Source Path must start with '/'" 295 | msgstr "請輸入快照源路径,源路径必須以'/'開頭" 296 | 297 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:133 298 | msgid "Please input Subvolume Path, Subvolume must start with '/'" 299 | msgstr "請輸入子卷路径,子卷路径必須以'/'開頭" 300 | 301 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:103 302 | msgid "Please select file system!" 303 | msgstr "請選擇文件系統!" 304 | 305 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:243 306 | msgid "RAID" 307 | msgstr "" 308 | 309 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:243 310 | msgid "RAID Creation" 311 | msgstr "RAID 創建" 312 | 313 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:87 314 | msgid "RAID Devices" 315 | msgstr "RAID 裝置" 316 | 317 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:90 318 | msgid "RAID mode" 319 | msgstr "RAID 模式" 320 | 321 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:255 322 | msgid "Raid Level" 323 | msgstr "RAID 等級" 324 | 325 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:278 326 | msgid "Raid Member" 327 | msgstr "硬碟陣列成員" 328 | 329 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:250 330 | msgid "Raid Name" 331 | msgstr "RAID 名稱" 332 | 333 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:68 334 | msgid "Raw" 335 | msgstr "" 336 | 337 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:175 338 | msgid "Readonly" 339 | msgstr "只讀" 340 | 341 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:89 342 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:276 343 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:348 344 | msgid "Remove" 345 | msgstr "移除" 346 | 347 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:20 348 | msgid "Rescan Disks" 349 | msgstr "重新掃描硬碟" 350 | 351 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:76 352 | msgid "Reset" 353 | msgstr "" 354 | 355 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:56 356 | msgid "Rotation Rate" 357 | msgstr "轉速" 358 | 359 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:53 360 | msgid "S.M.A.R.T Attrbutes" 361 | msgstr "" 362 | 363 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:44 364 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:55 365 | msgid "SATA Version" 366 | msgstr "SATA 版本" 367 | 368 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:35 369 | msgid "Sector Size" 370 | msgstr "磁區/物理磁區大小" 371 | 372 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:39 373 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:33 374 | msgid "Serial Number" 375 | msgstr "序列號" 376 | 377 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:75 378 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:82 379 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:86 380 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:93 381 | msgid "Set Default" 382 | msgstr "默認子卷" 383 | 384 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:32 385 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:40 386 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:91 387 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:34 388 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:155 389 | msgid "Size" 390 | msgstr "容量" 391 | 392 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:67 393 | msgid "Skip" 394 | msgstr "" 395 | 396 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:57 397 | msgid "Snapshots" 398 | msgstr "快照" 399 | 400 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:168 401 | msgid "Source Path" 402 | msgstr "源目錄" 403 | 404 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:125 405 | msgid "Start Sector" 406 | msgstr "起始磁區" 407 | 408 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:46 409 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:93 410 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:58 411 | msgid "Status" 412 | msgstr "狀態" 413 | 414 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:52 415 | msgid "SubVolumes" 416 | msgstr "子卷" 417 | 418 | #: applications/luci-app-diskman/luasrc/view/diskman/cbi/xsimpleform.htm:71 419 | msgid "Submit" 420 | msgstr "" 421 | 422 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:41 423 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:54 424 | msgid "Temp" 425 | msgstr "溫度" 426 | 427 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:175 428 | msgid "The path where you want to store the snapshot" 429 | msgstr "存放快照的數據目錄" 430 | 431 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:168 432 | msgid "The source path for create the snapshot" 433 | msgstr "創建快照的源數據目錄" 434 | 435 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:65 436 | msgid "Thresh" 437 | msgstr "" 438 | 439 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:54 440 | msgid "Top Level" 441 | msgstr "父 ID" 442 | 443 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:157 444 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:66 445 | msgid "Type" 446 | msgstr "" 447 | 448 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:28 449 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:55 450 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:105 451 | msgid "UUID" 452 | msgstr "" 453 | 454 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:217 455 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:228 456 | msgid "Umount" 457 | msgstr "卸載" 458 | 459 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:58 460 | msgid "Unsupported raid reject!" 461 | msgstr "" 462 | 463 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:42 464 | msgid "Update" 465 | msgstr "" 466 | 467 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:67 468 | msgid "Updated" 469 | msgstr "" 470 | 471 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:35 472 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:110 473 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:161 474 | msgid "Usage" 475 | msgstr "用量" 476 | 477 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/btrfs.lua:33 478 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:159 479 | msgid "Used" 480 | msgstr "已使用" 481 | 482 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:58 483 | msgid "VALUE" 484 | msgstr "" 485 | 486 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:63 487 | msgid "Value" 488 | msgstr "" 489 | 490 | #: applications/luci-app-diskman/luasrc/view/diskman/partition_info.htm:74 491 | msgid "" 492 | "Warnning !! \\nTHIS WILL OVERWRITE EXISTING PARTITIONS!! \\nModify the " 493 | "partition table?" 494 | msgstr "" 495 | "警告!!\n" 496 | "此操作会覆蓋現有分割區\n" 497 | "確定修改分割區表?" 498 | 499 | #: applications/luci-app-diskman/luasrc/view/diskman/smart_detail.htm:64 500 | msgid "Worst" 501 | msgstr "" 502 | 503 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/disks.lua:63 504 | #: applications/luci-app-diskman/luasrc/model/cbi/diskman/partition.lua:99 505 | msgid "is in use! please unmount it first!" 506 | msgstr "正在被使用!請先卸載!" 507 | 508 | #~ msgid "Partition NOT found!" 509 | #~ msgstr "分割區未找到!" 510 | 511 | #~ msgid "Filesystem NOT support!" 512 | #~ msgstr "文件系統不支持!" 513 | -------------------------------------------------------------------------------- /applications/luci-app-diskman/po/zh_Hans: -------------------------------------------------------------------------------- 1 | zh-cn -------------------------------------------------------------------------------- /applications/luci-app-diskman/po/zh_Hant: -------------------------------------------------------------------------------- 1 | zh-tw -------------------------------------------------------------------------------- /doc/disk_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisaac/luci-app-diskman/78969ed3ddc6c9facb05f2888455444768096818/doc/disk_info.png -------------------------------------------------------------------------------- /doc/partitions_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lisaac/luci-app-diskman/78969ed3ddc6c9facb05f2888455444768096818/doc/partitions_info.png --------------------------------------------------------------------------------